Oracle FAQ | Your Portal to the Oracle Knowledge Grid |
![]() |
![]() |
Home -> Community -> Usenet -> c.d.o.misc -> OCIBindArrayOfStruct i cannot find my error
hi all,
i have the following problem, i will import many lines from a file.
binding and execute per line functioned super.
now i will reduce round trips with function OCIBindArrayOfStruct()
i look after the import into the database i see only the last line of
the file.
what i make wrongly ?
thx for your help
ciao subsilver
for (int i = 0; i < counter; i++){
bndhp[i] = (OCIBind *) 0;
};//for
for(int a=0;a<counter;a++){
try {
//1. parameter
swdReturnCode = OCIBindByPos ((OCIStmt*) pOCIStatement,
(OCIBind**) &bndhp[a],
(OCIError*) ptrOCIError,
(ub4) columnIndex[1],
(dvoid*) lname[a],
(sb4) (lname[a] == NULL) ? 0 : (1+strlen(lname[a])),
(ub2) SQLT_STR,
(dvoid*) NULL,
(ub2*) NULL,
(ub2*) NULL,
(ub4) NULL, (ub4*) NULL,
(ub4) OCI_DEFAULT
);
//cut errorhandling
swdReturnCode = OCIBindArrayOfStruct(bndhp[a], ptrOCIError, s1,
indsk[a], rlsk[a], rcsk[a]);
//cut errorhandling
//2.parameter
swdReturnCode = OCIBindByPos ((OCIStmt*) pOCIStatement,
(OCIBind**) &bndhp[a],
(OCIError*) ptrOCIError,
(ub4) columnIndex[1],
(dvoid*) fname[a],
(sb4) (fname[a] == NULL) ? 0 : (1+strlen(fname[a])),
(ub2) SQLT_STR,
(dvoid*) NULL,
(ub2*) NULL,
(ub2*) NULL,
(ub4) NULL, (ub4*) NULL,
(ub4) OCI_DEFAULT
);
//cut errorhandling
swdReturnCode = OCIBindArrayOfStruct(bndhp[a], ptrOCIError,
s1, indsk[a], rlsk[a], rcsk[a]);
//cut errorhandling
//3. parameter
swdReturnCode = OCIBindByPos ((OCIStmt*) pOCIStatement,
(OCIBind**) &bndhp[a],
(OCIError*) ptrOCIError,
(ub4) columnIndex[3],
(dvoid*) &aname[a],,
(sb4) sizeof(aname[a]),
(ub2) SQLT_STR,
(dvoid*) NULL,
(ub2*) NULL,
(ub2*) NULL,
(ub4) NULL, (ub4*) NULL,
(ub4) OCI_DEFAULT
);
//cut errorhandling
swdReturnCode = OCIBindArrayOfStruct(bndhp[a], ptrOCIError,
s1, indsk[a], rlsk[a], rcsk[a]);
//cut errorhandling
} catch (...) {
...
}//catch
};//for
swdReturnCode = OCIStmtExecute( (OCISvcCtx* ptrOCIServiceContext,
(OCIStmt*) pOCIStatement,
(OCIError*) ptrOCIError,
(ub4) 1, (ub4)
0, (CONST OCISnapshot*) NULL,
(OCISnapshot *) NULL,
(ub4) OCI_COMMIT_ON_SUCCESS
);
//cut errorhandling
Received on Fri Mar 14 2003 - 05:44:50 CST
![]() |
![]() |