MVSFORUMS.com Forum Index MVSFORUMS.com
A Community of and for MVS Professionals
 
 FAQFAQ   SearchSearch   Quick Manuals   RegisterRegister 
 ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 

DSNREXX and Commit

 
Post new topic   Reply to topic   printer-friendly view    MVSFORUMS.com Forum Index -> Database
View previous topic :: View next topic  
Author Message
danm
Intermediate


Joined: 29 Jun 2004
Posts: 170
Topics: 73

PostPosted: Thu Oct 12, 2006 9:31 am    Post subject: DSNREXX and Commit Reply with quote

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.
Back to top
View user's profile Send private message
kolusu
Site Admin
Site Admin


Joined: 26 Nov 2002
Posts: 12376
Topics: 75
Location: San Jose

PostPosted: Thu Oct 12, 2006 9:51 am    Post subject: Reply with quote

danm,

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

Hope this helps...

Cheers

Kolusu
_________________
Kolusu
www.linkedin.com/in/kolusu
Back to top
View user's profile Send private message Send e-mail Visit poster's website
Display posts from previous:   
Post new topic   Reply to topic   printer-friendly view    MVSFORUMS.com Forum Index -> Database All times are GMT - 5 Hours
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum


MVSFORUMS
Powered by phpBB © 2001, 2005 phpBB Group