Re: reset SQL to reprocess a subfile in an inquiry program(SQLRPGLE)
- From: Birgitta.Hauser@xxxxxxxxxxx
- Date: 29 Jun 2006 11:54:00 -0700
Karl Hanson schrieb:
A small clarification.. a statement is prepared (not a cursor); the
cursor can be associated with the statement. When the cursor is opened,
parameter marker values can be supplied with the USING option of OPEN.
To rerun the query with different input values, I believe a CLOSE
followed by an OPEN (with new input values) should suffice (a new
PREPARE should not be needed).
See example 2 here:
http://publib.boulder.ibm.com/infocenter/iseries/v5r4/index.jsp?topic=/db2/rbafzmsthopen.htm
--
Karl Hanson
The SQL PREPARE-Statement only converts a character string into an
executable SQL statement.
In this way a PREPARE statement is only needed when the string that
contains the SQL statement gets changed. In the string parameter
markers (?) can be specified and placed for variable field values. If
you only want to use different field value, i.e. excuting the SQL
statement for different customer no, you only have to close the cursor
and reopen it. In the OPEN statement you'll specify the variables that
contain the desired values.
C/EXEC SQL Open MyCsr Using :HostVar1, :HostVar2, ....
C/END-EXEC
If you want to change the String that contains the SQL statement, the
cursor must be closed first and the PREPARE statement executed after.
Birgitta
.
- References:
- reset SQL to reprocess a subfile in an inquiry program(SQLRPGLE)
- From: shopping
- Re: reset SQL to reprocess a subfile in an inquiry program(SQLRPGLE)
- From: Kurt
- Re: reset SQL to reprocess a subfile in an inquiry program(SQLRPGLE)
- From: Saml
- Re: reset SQL to reprocess a subfile in an inquiry program(SQLRPGLE)
- From: Karl Hanson
- reset SQL to reprocess a subfile in an inquiry program(SQLRPGLE)
- Prev by Date: Re: Parsing XML from RPGLE
- Next by Date: Re: stopping client access session
- Previous by thread: Re: reset SQL to reprocess a subfile in an inquiry program(SQLRPGLE)
- Next by thread: Re: reset SQL to reprocess a subfile in an inquiry program(SQLRPGLE)
- Index(es):
Relevant Pages
|