Similar Threads:
1.[Info-ingres] [ingres] [Info-ingres] Logging trace conundrum - what am I missing?
XXXX@XXXXX.COM wrote:
>> Hi Dudes,
>>
>> II2.6/0305 for linux
>>
>> Someone is going to answer this one with a simple one line response
>> and I'm going to kick myself, but here goes...
>
> Judging by the thundering silence either:
> - No one cares.
> - No one believes me
> - No one knows
>
I can't speak for anyone else but I didn't see the original message.
I've just checked google groups and the original appears as a reply to
the reply - which is odd.
>
>
2.[Info-ingres] OpenAPI Caling a database procedure
Hi Grant et al,
I'm trying call a database procedure synchronously from an OpenAPI
application. The procedure has no parameters, all I want is the return
value. My understanding is that I set IIapi_query to say I'm executing a
database procedure. It will not do anything until the necessary
parameters (including procedure name and owner) are supplied and
filled in.
However, the code seems to hang at the initial iiapi_query() call.
I am using in order the following:
IIapi_query()
QueryParm.qy_queryType=IIAPI_QT_EXEC_PROCEDURE;
QueryParm.qy_queryText=NULL;
QueryParm.qy_parameters=TRUE;
I don't wait on gp_completed.
IIapi_setDescriptor()
setDescParm.sd_stmtHandle=QueryParm.qy_stmtHandle;
setDescParm.sd_descriptorCount=2;
I then allocate storage for two parameter descriptors for the
array setDescParm.sd_descriptor. In each element of which I
set ds_dataType = IIAPI_CHA_TYPE,
ds_nullable = FALSE,
ds_columnType = IIAPI_COL_SVCPARM
ds_columnName = NULL
I wait on gp_completed.
IIapi_putParms()
Fill in the procedure name, owner values described above, call
the procedure an wait on gp_completed.
At this point I wait on the IIapi_query to complete.
Then I call IIapi_get_QueryInfo to pick up the procedure return value.
Martin Bowes
Random Farscape Quote #26:
John - I think we have to put Grandma in a home.
Ka'Dargo - We could burn her.
John - You burn your old people!
Ka'Dargo - No, but in her case...
3.[Info-ingres] OpenAPI Weirdness
Hi Grant et al,
Sorry to bother you directly Grant, but I'm at my wits end on this one
and could use some advice. If anyone else in the newsgroup would like
to chip in 2c worth, I'd be happy too.
I've written a C program which has a subroutine full of API stuff. This
subroutine controls connecting to three databases in sequence to do
stuff. From the final database connection it reads in a lot (17511 rows)
of data to the program before disconnecting and then terminating the
API before returning to the main program.
All of which appears to work perfectly well. The data returned to the
program is exactly what is in the database.
But after the IIapi_terminate succeeds, the subroutine will return a
TRUE. Diagnostics indicates this is all happening. But the subroutine
NEVER returns to the main program. Instead it either loops? or causes
a coredump.
The code is literally:
main (...) {
if (Generate_Analysed_Data(&SayWhat)) {
printf("Generate_Analysed_Data completed OK!\n");
} else {
printf("Unexpected Error: Failed to Generate Analysed Data\n");
printf("Program Aborts\n");
exit (1);
};
} /*main*/
int Generate_Analysed_Data ( ParmDetails *buf) {
... stuff ...
/* Initialise OpenAPI */
if (!Init_API(&InitParm)) {return(FALSE);};
... Lots of stuff ...
/* In all cases we an now terminate the API connection */
printf("Terminate me!\n");
if (!Terminate_API) {
printf("Failure in API termination!\n");
ret_value=FALSE;
};
printf("Generate_Analysed_Data returns %d\n", ret_value);
return (ret_value);
} /*Generate_Analysed_Data*/
int Terminate_API (void) {
IIAPI_TERMPARM termParm;
IIapi_terminate(&termParm);
if ( termParm.tm_status != IIAPI_ST_SUCCESS ) {
printf( "Open_API::Terminate_API. Error in IIapi_terminate: %d\n",
termParm.tm_status );
};
return termParm.tm_status;
} /*Terminate_API*/
The diagnostic output is:
Terminate me!
Generate_Analysed_Data returns 1
Segmentation fault (core dumped)
I've run in api_trace mode (5) and the trace file (1.2M) is beautiful:
grep 'status =' $II_SYSTEM/ingres/files/api_trace.log| grep -v
SUCCESS
!IIapi_appCallback: request completed, status = NO_DATA
All the connects/disconnects are cool. All started statements are
closed, commits are issued etc.
I've run this on II2.5 and from an II2.6 installation using vnodes back to
the II2.5 database and the effect is the same.
Any Ideas gratefully received. I have the core dump and dbx but I have
no idea what I'm looking for or how to drive dbx....
Martin Bowes
Random Duckman Quote #20:
Ajax - By the hand of Zeus what manner of deviltry is this?
I mean... what gives?
4.[Info-ingres] OpenAPI Status Codes
5.[Info-ingres] OpenAPI Parameter Place Holders
Hi Grant et al,
If you have a spare second or two....
Is there any difference between using the '?' place holder for an SQL
statement and using a '~V'?
eg insert into fred values(?,?,?,?) works.
But if we change the '?' to space tilda V space. The query fails with
either:
Illegal binarty value in query text
or
OpenAPI function cannot be called in current state.
We get the first if we set queryParm.qy_parameters=FALSE or TRUE
respectively.
The manual suggests these are equivalenet and hints that ~V is
preferred - although we may be reading too much into that...
Martin Bowes
Random Duckman Quote #89:
Cornfed: I'm sorry I slapped you Duckman, but I was trying to calm you
down.
Duckman: And I guess just saying "calm down" would be considered
hopelessly
simplistic!
6. [Info-ingres] OpenAPI error function called in wrong state
7. [Info-ingres] OpenAPI Calling a database procedure
8. [Info-ingres] OpenAPI Status Codes