Newby Q: How to bind a *.NextVal with OCI

Newby Q: How to bind a *.NextVal with OCI

Post by Frans van der Reijde » Sun, 31 Dec 1899 09:00:00

Hi all

I'm trying to add a record to a table which looks like this:

ID = sequence
field1 = VARCHAR
field2 = VARCHAR

Can anybody tell me how the OCI command OCIBindByName has to look like, to
insert a record?


Frans van der Reijden

PS: This is how I tried it so far:

  char * pID="SQ_NEWS_ID.NextVal";

  if ((status = OCIBindByName(stmthp, &bnd1p, errhp, (text *) ":ID",
             -1, (dvoid *) pID,
             strlen(pID)+1, SQLT_STR, (dvoid *) 0,
             (ub2 *) 0, (ub2 *) 0, (ub4) 0, (ub4 *) 0, OCI_DEFAULT)))