Oracle FAQ Your Portal to the Oracle Knowledge Grid
HOME | ASK QUESTION | ADD INFO | SEARCH | E-MAIL US
 

Home -> Community -> Usenet -> c.d.o.server -> OCIBindArrayOfStruct i can only see the last importline

OCIBindArrayOfStruct i can only see the last importline

From: subsilver <101.114533_at_germanynet.de>
Date: 11 Mar 2003 07:44:07 -0800
Message-ID: <af2f1b22.0303110744.6d87f0d7@posting.google.com>


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 see i 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 Tue Mar 11 2003 - 09:44:07 CST

Original text of this message

HOME | ASK QUESTION | ADD INFO | SEARCH | E-MAIL US