Oracle FAQ | Your Portal to the Oracle Knowledge Grid |
![]() |
![]() |
Home -> Community -> Usenet -> c.d.o.misc -> Binding arrays with OCI
Gentlemen,
I'm trying to bind a simple array of integers before an INSERT
statement. I guess something in the documentation escaped my
attention, because I'm unable to make the bind. For exemple, on the
following code, I get an ORA-01485 error (traduced from french : the
length of bind at compile time is not the same than at execution time).
[code]
[...]
int linkedInts[] = { 33,34,35 };
ub2 eltSizes[3];
eltSizes[ 0 ] = eltSizes[ 1 ] = eltSizes[ 2 ] = sizeof( int );
ub4 count = 3;
//sb2 indicator[ 2 ];
OCIBind* pBindh;
char* name = ":col1";
st = ::OCIBindByName( m_pStmt, &pBindh, m_pErr,
reinterpret_cast< text* >( name ), strlen( name ), &linkedInts, sizeof( int ), SQLT_INT, NULL, eltSizes, NULL, 0, &count, OCI_DEFAULT );if ( st != OCI_SUCCESS && st != OCI_SUCCESS_WITH_INFO ) { CString ret = GetErrorText( m_pErr ); cout << ret.GetBuffer( 0 ) << endl;
![]() |
![]() |