[Info-ingres] OpenAPI Status Codes

DATABASE

    Sponsored Links

    Next

  • 1. "group by" behaviour different on R3 compared to 2.x
    Hi all, I have a table that was created like this: create table missaskh( artnr varchar(15), kdnr varchar(10), datum date, umsatz float, hk float, monat integer, jjjjkw integer not null default 0 ) with duplicates, page_size = 4096, location = (ii_database), security_audit=(table,norow) ; modify missaskh to btree on kdnr, jjjjkw ; I have a query select jjjjkw, sum(umsatz) as summeumsatz from missaskh group by jjjjkw On R3: result will be grouped by jjjjkw, but the jjjjkw column will be in a "random" order. On 2.6: result is grouped *and* ordered by jjjjkw Of course, I can use an additional "order by" so R3 will also group and order the result, but why does it behave differently? Any chance to get the "old" behaviour back in R3? Any CBF setting? TIA Gerhard
  • 2. [Info-ingres] Assigning II_GCNII_LCL_VNODE value to the hostname when ingres process starts
    Ajay Dalvi wrote: > Hi All, > There is ingres envionment variable *II_GCNII_LCL_VNODE*. > When we install ingres, II_GCNII_LCL_VNODE gets the vaule as host name > of the machine on which installation is done. > If suppose we change the hostname of the machine somewhere after ingres > installation is over. > I just want the value of II_GCNII_LCL_VNODE env variable also to be > change to new hostname of the machine. > This can be done using ingsetenv manually, but can any one > suggest any automated way to do that. > or Is there any way to assigne the new value of hostname to > II_GCNII_LCL_VNODE when we start the ingres process.? > On Windows platform, you could write something like that into a batch file: ingsetenv II_GCN_LCL_VNODE %computername% net start ingres_database_ii Regards Gerhard

Re: [Info-ingres] OpenAPI Status Codes

Postby Paul Mason » Thu, 21 Apr 2005 03:15:07 GMT



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

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

HTH


-- 
Paul Mason


Re: [Info-ingres] OpenAPI Status Codes

Postby Richard Marsden » Thu, 21 Apr 2005 04:20:21 GMT

Thanks Paul. In the last few minutes I managed to match "5" with 
IIAPI_ST_FAILURE after a disk-wide search on my PC here (I have Ingres 
installed on this PC, but of course it works for me!). That didn't help 
very much - but your explaination helps greatly.

I'll pass the reinstall suggestion on. Unfortunately the machines are 
not handy (infact I'm trying to fix the problem from a few thousand 
miles :-(  )




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

Similar Threads:

1.[Info-ingres] OpenAPI Status Codes

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

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");
    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?


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 connect - what am I missing?



Return to DATABASE

 

Who is online

Users browsing this forum: No registered users and 95 guest