mysql - Using a case then in an insert statement -


i want insert answer-dependent data mysql table. first problem everytime run script, fails:

insert outgoing_sms (timestamp,dest_msisdn,text_message,sender_name,service_id) values (now(),last_inserted_number, case last_inserted_message             when 'no' "you choose not secure payslip."             when 'yes' "you choose secure payslip."             else "invalid choice."         end, 90294,0000002000099451); 

second question: mysql account case sensitivity of "yes" / "no" or "yes" , "no" or "yes" / "no" or "yes" / "no".

my queries should case-insensitive; enough characters correct.

for error, syntax seems invalid. not have mysql instance test against, should work:

insert outgoing_sms (timestamp,dest_msisdn,text_message,sender_name,service_id) values (now(),last_inserted_number,          case last_inserted_message           when 'no' select "you choose not secure payslip.";           when 'yes' select "you choose secure payslip.";           else "invalid choice.";         end case;,      90294,0000002000099451); 

the easiest way take care of lower casing dummy transformation data before submit, ex. no = 0, yes = 1.


Comments

Popular posts from this blog

java - How to specify maven bin in eclipse maven plugin? -

single sign on - Logging into Plone site with credentials passed through HTTP -

php - Why does AJAX not process login form? -