[Info-ingres] RE: OpenAPI Calling a database procedure
- From: "Croker, Grant" <Grant.Croker@xxxxxx>
- Date: Wed, 13 Jul 2005 16:09:48 +0100
AFAIK queryInfoParm.gq_procedureReturn is the value sent back via a procedure 'return' call. queryInfoParm.gq_procedureReturn is defined as II_LONG which, on windows at least, is typedef'd to long so what you are doing there is ok.
Did you change setDescrParm.sd_descriptorCount to 1? If so then at some point an error is occurring. Your best bet is to run an API trace to see at what point its happening or check the respective status after each IIapi_* call for IIAPI_ST_SUCCESS. If you like, you can send me the trace offline and I will have a look.
g
________________________________________
From: martin.bowes@xxxxxxxxxxxxx [mailto:martin.bowes@xxxxxxxxxxxxx]
Sent: Wednesday, July 13, 2005 4:52 PM
To: Croker, Grant
Cc: info-ingres@xxxxxxxxxxxxxxx
Subject: RE: OpenAPI Calling a database procedure
Hi Grant,
Solved the hang by installing the generic Parameter values correctly for the IIapi_query call. Now the program runs to completion but...
The value returned from the procedure is 0 and not the 100 it would be if this procedure was executed from ESQLC.
I use the code...
if (queryInfoParm.gq_mask & IIAPI_GQ_PROCEDURE_RET) {
printf("A returned value was available=%f\n",
queryInfoParm.gq_procedureReturn
);
printf("gq_flags=%x\n", queryInfoParm.gq_flags);
returned_value=queryInfoParm.gq_procedureReturn; /*May not be reliable*/
};
The gq_flags was 0x80 ie. IIAPI_GQF_TRANSACTION_INACTIVE
I'm wondering if the procedure return status and the value returned by the procedure using return [return_status] are the same thing?
I note in the SQL Manual:
The optional return_status returns a value to the calling application when the
return statement executes. Return_status must be a non-null integer constant,
variable, or parameter whose data type is comparable with the data type of the
variable to which its value will be assigned. If the return_status is not specified or if a return statement is not executed, then the procedure returns 0 to the calling application.
In this case the procedure returns an integer variable. I'm assiging this to a long. I would have thought this would be acceptable.
Marty
.
- Prev by Date: [Info-ingres] RE: OpenAPI Calling a database procedure
- Next by Date: Re: [Info-ingres] RE: OpenAPI Calling a database procedure
- Previous by thread: [Info-ingres] RE: OpenAPI Calling a database procedure
- Next by thread: Re: [Info-ingres] RE: OpenAPI Calling a database procedure
- Index(es):
Relevant Pages
|