![]() ![]() ![]() It should be: `emailTransport` = ''', `emailTransport_In`, ''', It's easy to get mixed up with the multiple levels of quoting. The following is wrong: `emailTransport` = ',`emailTransport_In`,',īecause the variable is a VARCHAR but you don't quote it as a string literal in your SQL statement. This should therefore be: SET := CONCAT('UPDATE `tbl_JustSayThanks`', The following is wrong: SET := CONCAT('UPDATE ',`tbl_JustSayThanks`,'īecause you seem to be concatenating your SQL text with the value of tbl_JustSayThanks, but I think you mean to use the identifier itself. But, I wanted to get it to work on a simplified level before going there. Just FYI, I'm using the CONCAT based on a previous answer I received from wchiquito and will be passing in the table name eventually. WHERE `formSecret` = ', `formSecret_In`, '') `emailTransport` = ',`emailTransport_In`,', SET := CONCAT('UPDATE ',`tbl_JustSayThanks`,' The code I'm trying to use is: CREATE PROCEDURE `sp_Test`( I've got the following but keep getting an error "#1064 - You have an error in your SQL syntax check the manual that corresponds to your MySQL server version for the right syntax to use near '' at line 7 - yet I don't see anything off at line 7 - at least to my eye. I'm also adding the date and time to another field to know when the procedure ran. I'm passing in 3 variables - a bit indicating the email got sent, a string indicating which SMTP server has been used to sent the email and a unique record id so I'll know what record to update. I've had a working procedure in MSSQL for a long time but am trying to convert it to MySQL. The procedure gets called from a web form once a record has been inserted into the database and en email sent successfully (or at least passed off to the SMTP server) I'm converting all of my existing MSSQL databases and stored procedures am stuck on a new stored procedure where I need to update an existing record.
0 Comments
Leave a Reply. |