multi-statement prepare
Posted in 1997
I recieved a syntax error on something similar to the following sort of prepare: let sql_stmt= "update tbl1 set (col1, col2)= ", "(col1+1, (col3/col4)*100) ", "where col2=? and col4!=0; ", "update tbl1 set (col1, col2)= ", "(col1+1, (col3/20)*100) ", "where col2=? and (col4=0 or col4 is null); ", "update tbl2 set (col1)=(col1+1) where col2=?;" prepare sql_id from sql_stmt I understand that you're supposed to think of the statements as a unit which get executed in no particular order (even though I found an example in the manual which drops a table then creates one with the same name), therefore you could get into trouble updating the same table twice in the same statement, but this example updates mutually exclusive rows in tbl1. Has anyone else ever experienced this? Apparently I'm the first to report this. Any opinions on whether or not it's a real problem? Douglas Wilson