Oracle FAQ | Your Portal to the Oracle Knowledge Grid |
Home -> Community -> Usenet -> c.d.o.server -> OCIDescribeAny() difficulties -
I am working with OCI for the first time and have run into problems with the
OCIDecribeAny() function. I am using Oracle 8 Enterprise Edition ( trial )
on WNT 4.0 server. Does anyone have a source code file with an example of
OCIDescribeAny() used successfully in its natural habitat ? The runtime
error I am getting is an access violation suggesting some pointer
difficulties. Here are selected cuts of my source :
// declarations ...
static OCIEnv *OCI_Environment = ( OCIEnv* ) 0;
static OCIServer *OCI_Server = ( OCIServer* ) 0; static OCIError *OCI_Error = ( OCIError* ) 0; static OCISvcCtx *OCI_Service_Context = ( OCISvcCtx* ) 0;static OCIStmt *OCI_Statement_1;
// all the basics ... yadda yadda yadda ... ( initialization )
(void) OCIInitialize((ub4) OCI_DEFAULT, (dvoid *)0,
(dvoid * (*)(dvoid *, size_t)) 0, (dvoid * (*)(dvoid *, dvoid *, size_t))0, (void (*)(dvoid *, dvoid *)) 0 );
(size_t) 0, (dvoid **) 0);// server contexts
(size_t) 0, (dvoid **) 0);
(size_t) 0, (dvoid **) 0);
OCI_ATTR_SERVER, (OCIError *) OCI_Error);
(size_t) 0, (dvoid **) 0);
// load the user name and the password into the session handle
(void) OCIAttrSet((dvoid *) OCI_Session, (ub4) OCI_HTYPE_SESSION,
(dvoid *) username, (ub4) strlen((char *)username), (ub4) OCI_ATTR_USERNAME, OCI_Error);// login
(void) OCIAttrSet((dvoid *) OCI_Session, (ub4) OCI_HTYPE_SESSION,
(dvoid *) password, (ub4) strlen((char *)password), (ub4) OCI_ATTR_PASSWORD, OCI_Error);
(ub4) OCI_DEFAULT));
// attach the session to the service context ?
(void) OCIAttrSet((dvoid *) OCI_Service_Context, (ub4) OCI_HTYPE_SVCCTX,
(dvoid *) OCI_Session, (ub4) 0, (ub4) OCI_ATTR_SESSION, OCI_Error);// allocate the statement handles
OCI_HTYPE_STMT, (size_t) 0, (dvoid **) 0)); checkerr(OCI_Error, OCIHandleAlloc( (dvoid *) OCI_Environment, (dvoid **) &OCI_Statement_2,
OCI_HTYPE_STMT, (size_t) 0, (dvoid **) 0));
// allocate the describe handle
checkerr( OCI_Error,
HandleAlloc(
( dvoid* ) OCI_Environment, ( dvoid** ) &OCI_Describe_ITEM_199701, OCI_HTYPE_DESCRIBE, ( size_t ) 0, ( dvoid** ) 0 ) ); // THIS STATEMENT PRODUCES THE ACCESS VIOLATION // // | // | // | // \|/
// Describe the item_199701 table
checkerr( OCI_Error, OCIDescribeAny(
OCI_Service_Context, OCI_Error, ( dvoid* ) "RLD.ITEM_199701", 15, ( ub1 ) OCI_OTYPE_NAME, ( ub1 ) OCI_DEFAULT, ( ub1 ) OCI_PTYPE_TABLE, OCI_Describe_ITEM_199701 ) );
//
SO WHAT AM I DOING WRONG ?
Received on Mon Jun 15 1998 - 13:41:52 CDT