Problem witch OCI ofen()

From: Thomas Helberg <helberg_at_lodsun1.lod.uni-karlsruhe.de>
Date: 29 Apr 1994 10:36:33 GMT
Message-ID: <2pqnvi$mpn_at_nz12.rz.uni-karlsruhe.de>


Hello,
I'm trying to use the OCI functions V1.1(?) with ORACLE V6.0.36 within a C++ program. Everything is working fine. Only with the ofen() function a problem arise. If I try to fetch more than 35 rows by one call - as in the sample program belowI  get a segmentation fault or floating exception.

Any ideas or hints ?

#include <iostream.h>

#include "database.h"
#include "util.h"

extern "C" {

   int ofetch(CursorDef*);
   int olon(CursorDef*, char*, int, char*, int, int);    int ologof(CursorDef*);
   int odsc(CursorDef*, int, short*, short*, short*, \

            short*, char*, short*, short*);    int oclose(CursorDef*);
   int ofen(CursorDef*, int);
   int oopen(CursorDef*, CursorDef*, char*,int, int, char*, int);    int odefin(CursorDef*, int, int*, int, int, int, short*, char*, \

              int, int, short*, short*);    int osql3(CursorDef*, char*, int);
   int oexec(CursorDef*);    

}
extern const char* Name;
char* Passwd;

CursorDef LDA;

int main()
{

   static CursorDef cursor;
   static short ind_a[100];
   static int grp_id[100];
   short rl,rc;
   olon(&LDA,Name,-1,Passwd,-1,-1);
   oopen(&cursor,&LDA,(char*)0,-1,-1,(char*)0,-1);    osql3(&cursor,(char*)"select gruppen_id from archiv_site where sitename_p =1",\

         -1);
   odefin(&cursor,1,(int*)grp_id,sizeof(int),3,-1,ind_a,(char*)0,-1,-1,&rl,&rc); oexec(&cursor);    ofen(&cursor,100);
   for ( int i=0; i<100 ; i++)

      cout << grp_id[i] << " " ;
   cout << endl << flush;
  .....

Thanks in advance

Thomas Received on Fri Apr 29 1994 - 12:36:33 CEST

Original text of this message