09-20-2016 05:22 AM - edited 03-19-2019 11:36 AM
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
09-20-2016 05:38 AM
admin:run sql select firstname,lastname from enduser
firstname lastname
========= =========
Mohammed Khan
Asif Khan
Emergency Responder
Jonny Walker
James Bond
admin:
09-20-2016 06:39 AM
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.
09-20-2016 09:05 AM
Other way around to achieve this is thru BAT user export.
09-20-2016 09:29 AM
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?
09-20-2016 09:47 AM
You can use concat in update query, Seems select has a limitation.
06-22-2017 06:29 AM
Why not just run the query you have and then copy and paste to Excel and concatenate the cells there?
06-21-2017 06:22 AM
Hi Neil,
May be late for you, but the following could help someone else...
run sql select firstname || ',' || lastname from enduser
12-30-2018 10:52 AM
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
01-06-2019 09:22 PM - edited 01-06-2019 09:27 PM
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.
Find answers to your questions by entering keywords or phrases in the Search bar above. New here? Use these resources to familiarize yourself with the community: