DSNREXX and Commit
Select messages from
# through # FAQ
[/[Print]\]

MVSFORUMS.com -> Database

#1: DSNREXX and Commit Author: danm PostPosted: Thu Oct 12, 2006 9:31 am
    —
Code:

DelRow = "DELETE FROM TABLEA WHERE COL1 = ?"
"EXECSQL PREPARE S1 FROM :DELROW"
Parms = 'AAAA BBBB CCCC DDDD EEEE........'

Do I = 1 by 1 while Parms <> ''
   parse value Parms Parm Parms
   Parm = "'"Parm"'"
   "EXECSQL EXECUTE S1 USING :PARM"
   If 0 = I // 10 then "EXECSQL COMMIT"     <-- works without a COMMIT
End   
"EXECSQL COMMIT"

The above code works fine without executing a COMMIT inside the DO loop. If a COMMIT is executed, Sqlcode = -518 (The statement named in the EXECUTE statement has not been prepared). How can I preserve the PREPARE statement after a COMMIT.

#2:  Author: kolusuLocation: San Jose PostPosted: Thu Oct 12, 2006 9:51 am
    —
danm,

Check this link for a detailed explanation of Keeping prepared statements after commit points

Hope this helps...

Cheers

Kolusu



MVSFORUMS.com -> Database


output generated using printer-friendly topic mod. All times are GMT - 5 Hours

Page 1 of 1

Powered by phpBB © 2001, 2005 phpBB Group