problem with concat and concat_ws function
Posted by: Radhakant Samal
Date: February 12, 2011 08:22AM

i am getting problem with concat and concat_ws function it as follows

SELECT msd.send_id,concat_ws(' ',ei.emp_name,'replied on',date(rd.reply_date),time(rd.reply_date))'name'
FROM send_detail msd
JOIN re_de rd ON msd.reply_id=rd.reply_id
JOIN m_cont mc ON mc.msg_id=msd.msg_id
JOIN .employee ei ON ei.emp_id=msd.receiver_id
WHERE msd.send_id=1024;

The above query is working fine, But when i am trying to format the date and time using date_fomat and time_format function, then it is showing error.

SELECT msd.sender_id,concat_ws(' ','me','replied','to',ei.emp_name,'on',date_format(date(rd.reply_id),'%d%c%Y'),time_format(time(rd.reply_date),'%r'))'name'
FROM send_detail msd
JOIN re_de rd ON msd.reply_id=rd.reply_id
JOIN m_cont mc ON mc.msg_id=msd.msg_id
JOIN .employee ei ON ei.emp_id=msd.receiver_id
WHERE msd.send_id=1024;

this one gives the following error.
Error Code : 1271
Illegal mix of collations for operation 'concat_ws'
(0 ms taken)


can't i use the date_format and time_format function in concat and concat_ws function.



Edited 1 time(s). Last edit at 02/13/2011 04:42AM by Radhakant Samal.

Options: ReplyQuote


Subject
Views
Written By
Posted
problem with concat and concat_ws function
4401
February 12, 2011 08:22AM


Sorry, you can't reply to this topic. It has been closed.

Content reproduced on this site is the property of the respective copyright holders. It is not reviewed in advance by Oracle and does not necessarily represent the opinion of Oracle or any other party.