[Info-ingres] RE: OpenAPI Calling a database procedure




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
            


.



Relevant Pages

  • RE: function doesnt return value - SOMETIMES!
    ... It seems the calling stack has some issues. ... If not, I suggest that you create a new database, and import the ... |> thing I can see is that you are declaring 3 of your numerical values as ... |> when it does work correctly that would be because this data type is ...
    (microsoft.public.access.modulesdaovba)
  • Re: Can allocatable dummies be optional?
    ... the calling program doesn't even have to know ... that's exactly data abstraction - one of the fundamental ... separating the abstract properties of a data type from the ...
    (comp.lang.fortran)
  • Re: Can allocatable dummies be optional?
    ... the calling program doesn't even have to know ... that's exactly data abstraction - one of the fundamental ... separating the abstract properties of a data type from the ... without the need to modify user code. ...
    (comp.lang.fortran)
  • Re: Calling a function to fill (update) field value in query/table
    ... Klatuu wrote: ... What data type is the SerialNumber field? ... Have you tried calling it in the immediate window to see what it returns? ...
    (microsoft.public.access.modulesdaovba)