cancel
Showing results for 
Search instead for 
Did you mean: 
cancel
1756
Views
0
Helpful
9
Replies

CUCM sql commands using concat

Neil Martin
Level 1
Level 1

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

Mohammed Khan
Cisco Employee
Cisco Employee

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

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.   

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

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?

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

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

f.hallier
Level 1
Level 1

Hi Neil,

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

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

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

valerie.kan
Level 5
Level 5

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.