OCI question
From: <jmruiz_at_cicyt.es>
Date: 1997/07/15
Message-ID: <5qg3q7$sfn$1_at_news.rediris.es>#1/1
} while (sqldap==NULL);
sqldap->N=sqldap->F;
}
Date: 1997/07/15
Message-ID: <5qg3q7$sfn$1_at_news.rediris.es>#1/1
[Quoted] I am porting a C program that includes dynamic SQL
(method 4) to OCI. I have several Select clauses in the
form SELECT * FROM TABLE. With method 4 I can get the
unknown number of columns doing the following:
numcol=1;
sqldap=NULL;
do {
sqldap=(SQLDA *)allocsqlda(numcol,MAX_VNAME_LEN); EXEC SQL DESCRIBE SELECT LIST FOR S1 INTO sqldap; if(sqlca.sqlcode) return(NULL); /* If F is negative, there are more select-list items than originally allocated by allocsqlda(). */ if(sqldap->F < 0) { numcol=-sqldap->F; /* get the number of columns */ freesqlda(sqldap); sqldap=NULL; }
} while (sqldap==NULL);
sqldap->N=sqldap->F;
[Quoted] With OCI, I do not know how to do it in just ONE call. If I use odescr, I have to implement something like this:
for(i=1;;i++)
{
odescr(cursor,i,...) if (error) break;
}
If this is the right way, how many internal calls to the server are required
[Quoted] (I hope there is not need for one call for each odescr ...)?
Regards
Jose Ruiz
jmruiz_at_cicyt.es
Received on Tue Jul 15 1997 - 00:00:00 CEST