cancel
Showing results for 
Search instead for 
Did you mean: 
cancel
773
Views
0
Helpful
9
Replies
Highlighted
Beginner

CUCM sql commands using concat

Hello,

I'm trying to run some sql commands on the CUCM and want to use concat.  For example I have tried all of the following:

admin:run sql select concat(firstname, ',' lastname) from enduser;

admin:run sql select concat(firstname || ',' || lastname) from enduser;

admin:run sql select firstname, lastname SET firstname = (CONCAT(dnorpattern, ',')) from enduser;

It seems that concat just doesn't work as I get 'syntax error' every time.  

Can anyone let me know if this can be made to work?  

Thanks in advance,

Neil

9 REPLIES 9
Highlighted
Cisco Employee

admin:run sql select firstname,lastname from enduser
firstname lastname  
========= =========  
Mohammed  Khan      
Asif      Khan      
Emergency Responder
Jonny     Walker    
James     Bond      
admin:

Highlighted

Thanks for your reply Mohammed.  What I'm trying to do is get output like this:

admin:run sql select firstname,lastname from enduser

firstname,lastname

======================,===================

JOHN,SMITH

JANE,DOE

Unfortunately the above in your reply doesn't do this for us.  When I run this on a mysql database the command is select concat(firstname,',',lastname) from enduser.  I know that 'concat' is an option in db2 but it doesn't seem to work on the appliance.   

Highlighted

Other way around to achieve this is thru BAT user export.

Highlighted

Do you mean BATCH mode?  Problem at the moment is we don't have permission to write to a file.  Can you confirm if it is possible to run concat or not with CUCM?  If so what is the correct syntax please?

Highlighted

You can use concat in update query, Seems select has a limitation.

Highlighted

Why not just run the query you have and then copy and paste to Excel and concatenate the cells there?

Highlighted
Beginner

Hi Neil,

May be late for you, but the following could help someone else...

run sql select firstname || ',' || lastname from enduser

Highlighted

i tried your suggestion using double pipe (||) characters. But the SSH Session does not accept it. Copy/paste is not working, also. CUCM Version 11.5.1.12900-21

 

Is there any way around this?

 

/Robert

Highlighted
Contributor

It looks like concat just doesn't like taking more than 2 parameters.

run sql select concat (firstname, lastname) from enduser 

worked for me. 

 

I also tried

run sql select concat ( concat (firstname, ","), lastname) from enduser 

 

Hope this helps.

 

Content for Community-Ad