[Info-ingres] OpenAPI Status Codes


RE: [Info-ingres] Re: OpenAPI Status Codes

Postby Ball, David » Sat, 30 Apr 2005 00:00:25 GMT


I've not played with ODBC for a while, but it used to be the case that this
kind of failure was down to ingres/bin &/or ingres/utility being absent from
PATH (also, sometimes the named DLL is just plain wrong!).


-----Original Message-----
From: Richard Marsden [mailto: XXXX@XXXXX.COM ]
Sent: 28 April 2005 14:56
Subject: [Info-ingres] Re: OpenAPI Status Codes

Is IIAPI.DLL the correct name, and where should it be?

Yes this problem keeps coming back (that's the problem with a customer 
chain). The end customer is reporting that they can't find IIAPI.DLL. 
I've just a search on this PC and can't find it - but then Windows 
decided the Winnt\system(32) directories would not interest me!!!
Manual searches of the two system directories failed to come up with 
A search for ii*.dll came up with some ii*api.dll files in the Ingres 

At the moment I'm beginning to suspect Jet->ODBC->Ingres is at fault.
(ie. Jet's handling of ODBC fails when the end database is Ingres)

Yes Jet is old, and we have a plan to replace it for direct ODBC in the 
near future.

Richard Marsden
Winwaed Software Technology,  http://www.**--****.com/ 
 http://www.**--****.com/  for MapPoint tools and add-ins
Info-ingres mailing list

The information contained in this e-mail is confidential and intended only
for the use of the addressee. If the reader of this message is not the
addressee, you are hereby notified that you have received this e-mail in
error and you must not copy, disseminate, distribute, use or take any action
as a result of the information contained in it.
If you have any queries, please contact the IT Service Desk on 1870


This e-mail is provided for general information purposes only and does not constitute investment or transactional advice. For  the avoidance of doubt the contents of this e-mail are subject to contract and will not constitute a legally binding contract. 

The information contained in this e-mail is confidential and intended only for the use of the addressee. If the reader of this message is not the addressee, you are hereby notified that you have received this e-mail in error and you must not copy, disseminate, distribute, use or take any action as a result of the information contained in it.
If you have received this e-mail in error, please notify  XXXX@XXXXX.COM  (UK 01384 275454) and delete it immediately from your system.
Neither Npower nor any of the other companies in the RWE Npower group from whom this e-mail originates accept any responsibility for losses or damage as a result of any viruses and it is your responsibility to check attachments (if any) for viruses.  Npower Limited Registered office: Windmill Hill Business Park, Whitehill Way, Swindon SN5 6PB. Registered in England and Wales: number 3653277. This e-mail may be sent on behalf of a member of the RWE Npower group of companies.


Similar Threads:

1.[Info-ingres] OpenAPI Status Codes

On 4/19/05, Richard Marsden < XXXX@XXXXX.COM > wrote:
> Unfortunately I can't reproduce the problem, but a customer is having a
> problem with ODBC->Ingres. This is a local Ingres database on a Windows
> machine.
> OpenAPI is reporting "IIapi_initialize() return code = 5".
> I've found the IIapi_initialize documentation, and I assume "5" refers
> to one of the Ingres status codes IIAPI_ST_OUT_OF_MEMORY or
> IIAPI_ST_FAILURE. I've tried searching the docs and Google without any
> luck on finding these values.
> The ODBC loc reports that SQLAllocHandle on SQL_HANDLE_ENV failed.
> We thought there might be a user/pwd problem, but the above two error
> messages don't appear to be related; and we've tried to fix any user/pwd
> problems at our end.
> Apparantly other apps are accessing Ingres okay.
> Does anyone have any ideas? Are handles limited, and it is running out
> of them?   What does the code "5" refer to?
> Is this a common kind of error?

5 refers to IIAPI_ST_FAILURE which has to do with the version of the
API. This error has occurred in the past when there's been a mixture
of files from different Ingres versions on the machine.

Easiest way to fix it is to uninstall/re-install.However since you've
got local databases that would mean an unload/reload.

If there's more than one installation of Ingres, at different
versions, and one is unused, you could try removing the unused one, if

Otherwise it's a question of making sure that the paths only contain
directories to one version of Ingres at a time.


Paul Mason

2.OpenAPI Status Codes

3.[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:
    I don't wait on gp_completed.


    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.

	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...

4.[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");

printf("Generate_Analysed_Data returns %d\n", ret_value);
return (ret_value);
} /*Generate_Analysed_Data*/

int Terminate_API (void) {
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 
!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?

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 
Illegal binarty value in query text
OpenAPI function cannot be called in current state.

We get the first if we set queryParm.qy_parameters=FALSE or TRUE 

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 
Duckman: And I guess just saying "calm down" would be considered 

6. [Info-ingres] OpenAPI error function called in wrong state

7. [Info-ingres] OpenAPI Calling a database procedure

8. [Info-ingres] OpenAPI connect - what am I missing?

Return to DATABASE


Who is online

Users browsing this forum: No registered users and 55 guest