1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33
|
char* linkedStrings[ 3 ];
linkedStrings[ 0 ] = new char[ 2 ];
strcpy( linkedStrings[ 0 ], "A" );
linkedStrings[ 1 ] = new char[ 2 ];
strcpy( linkedStrings[ 1 ], "B" );
linkedStrings[ 2 ] = new char[ 2 ];
strcpy( linkedStrings[ 2 ], "C" );
ub2 eltSizes3[ 3 ];
eltSizes3[ 0 ] = strlen( linkedStrings[ 0 ] ) + 1;
eltSizes3[ 1 ] = strlen( linkedStrings[ 1 ] ) + 1;
eltSizes3[ 2 ] = strlen( linkedStrings[ 2 ] ) + 1;
OCIBind* pBindh3;
char* name3 = ":col5";
st = ::OCIBindByName( m_pStmt, &pBindh3, m_pErr,
reinterpret_cast< text* >( name3 ), strlen( name3 ),
&linkedStrings, 2, SQLT_VCS,
NULL, (ub2*) eltSizes3, NULL,
0, NULL, OCI_DEFAULT );
if ( st != OCI_SUCCESS && st != OCI_SUCCESS_WITH_INFO ) {
CString ret = GetErrorText( m_pErr );
cout << ret.GetBuffer( 0 ) << endl;
return false;
}
st = ::OCIStmtExecute( m_pService, m_pStmt, m_pErr, iters, 0, NULL, NULL, OCI_DEFAULT );
if ( st != OCI_SUCCESS && st != OCI_SUCCESS_WITH_INFO ) {
CString ret = GetErrorText( m_pErr );
cout << ret.GetBuffer( 0 ) << endl;
return false;
} |
Partager