Subject | Re: [IBO] Stored procedure, ExecSQL and Suspend |
---|---|
Author | Helen Borrie |
Post date | 2002-11-04T08:56:16Z |
At 04:01 PM 02-11-02 +0000, you wrote:
effect at the end of a For...Select..Do loop. In all other cases, it means
the same thing as EXIT.
The server always returns the values in the return parameter block
following the COMMIT, and IBO reads them in from there. You should read
them as Fields[], not Params[]. IBO reserves Params[] for input parameters.
is the native IBO method.
a dataset.
of SP is distinguished by a FOR...SELECT....DO...SUSPEND loop, each
iteration of which outputs a single row of a dataset.
Use EXECUTE for a SP that performs *anything* except a FOR..SELECT..etc.
Don't design SELECTable SPs that modify data (yes, the engine will let you
do it but commonsense and ACID rules say "No").
Read output parameters from the Fields[] array AFTER the executable
procedure's work has been committed.
Helen
> IF ((OUT_DIFFERENZIA='E') OR (OUT_DIFFERENZIA IS NULL)) THENThe SUSPEND won't make any difference on the server side. It *only* takes
> OUT_DIFFERENZIA='N';
> SUSPEND; /* ****************************** */
>END
>
>Needs the final suspend...
>
>The question is:
>What component must I use in IBO for retrieving output values from this
>kind of SP? What method do I have to call (i.e. ExecSQL, Open...)?
effect at the end of a For...Select..Do loop. In all other cases, it means
the same thing as EXIT.
The server always returns the values in the return parameter block
following the COMMIT, and IBO reads them in from there. You should read
them as Fields[], not Params[]. IBO reserves Params[] for input parameters.
>Jason once told about ExecSQL "That method is what you call to execute aIn fact, ExecSQL is there just for compatibility with the VCL. Execute()
>non-select SQL statement",
is the native IBO method.
>is this EXECUTE PROCEDURE GET_CONTO_DIFFERENZIA_GR in myNo, it is an execute statement and is correct for a SP that does not return
>IB_StoredProcedure to be considered a "select" statement?
a dataset.
>What is the general rule?Use SELECT for a SP that you have defined to return a dataset. This style
of SP is distinguished by a FOR...SELECT....DO...SUSPEND loop, each
iteration of which outputs a single row of a dataset.
Use EXECUTE for a SP that performs *anything* except a FOR..SELECT..etc.
Don't design SELECTable SPs that modify data (yes, the engine will let you
do it but commonsense and ACID rules say "No").
Read output parameters from the Fields[] array AFTER the executable
procedure's work has been committed.
Helen