Topic
No replies
JSSK_Chumma_Dede
JSSK_Chumma_Dede
1 Post
ACCEPTED ANSWER

Pinned topic Multi row insert and bind variables

‏2013-05-02T14:24:25Z |

Hi,

I have two questions related to DB2 10.1 LUW. I have a statement like this that is dynamically built in PHP and run against a MYSQL database. We are migrating the MYSQL db to DB2, and I need to figure out the best approach for converting this sql to DB2.

 

INSERT INTO rxc_casecondition (ConditionName, CardID, CardName, SubRule, ProgramName)
VALUES ('Elderly', '90456881100', 'WM2', 'WM2-Phone', 'MTM2013')
     , ('Dyslipidemia', '90456881100', 'WM2', 'WM2-Phone', 'MTM2013')
     , ('Osteoporosis', '90456881100', 'WM2', 'WM2-Phone', 'MTM2013')
     , ('ESI Hypertension', '90456881100', 'WM2', 'WM2-Phone', 'MTM2013')
;
 

Question1: Is it better to run this statement using bind variables in DB2 or leave as is with string literals?

Question2: If bind vars is better, is there an example out there that shows how to bind in cases like this where there are multiple rows in same INSERT?

Thanks,

JGP

 

 

 

Updated on 2013-05-02T14:24:36Z at 2013-05-02T14:24:36Z by JSSK_Chumma_Dede