Home » Developer & Programmer » Precompilers, OCI & OCCI » OCIDefine function wrapper
OCIDefine function wrapper [message #394294] Thu, 26 March 2009 07:06
vaishali.verma18
Messages: 6
Registered: March 2009
Junior Member
Can anybody help me in giving a wrapper function for OCIDefine.
Each time I have to write a function for each table structure like:

void oci_define(OciHandle_t * ctxptr)
{
//printf("Inside oci_define_SubSubCatInfo\n");
checkerr(ctxptr->errhp, status =
OCIDefineByPos(ctxptr->stmthp, &ctxptr->dfnhp, ctxptr->errhp, 1, &var1,
sizeof(var1), SQLT_INT, NULL, NULL, NULL, OCI_DEFAULT));
checkerr(ctxptr->errhp, status =
OCIDefineByPos(ctxptr->stmthp, &ctxptr->dfnhp, ctxptr->errhp, 2, (dvoid *) & var2,(sb4) sizeof(var2), SQLT_STR, (dvoid *) 0, (ub2 *) 0, (ub2 *) 0, OCI_DEFAULT));

}

I want a function which takes argument like given below in which variable can be on any type like int,float,string :

void oci_define(OciHandle_t * ctxptr,int position, variable)
{
checkerr(ctxptr->errhp, status =
OCIDefineByPos(ctxptr->stmthp, &ctxptr->dfnhp, ctxptr->errhp, position, (dvoid *) & variable,(sb4) sizeof(variable),
}

Can anybody give me an idea...U knw wot.. an Idea can change your life
Wink

Previous Topic: PCC-F-02102, Fatal error while doing C preprocessing
Next Topic: How to start learning Pro*C...
Goto Forum:
  


Current Time: Thu Mar 28 16:51:54 CDT 2024