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

Home -> Community -> Usenet -> c.d.o.misc -> ORACLE ODBC doesn't ignore set of parameters

ORACLE ODBC doesn't ignore set of parameters

From: Marek Smrz <m.smrz_at_atlas.cz>
Date: 8 Apr 2004 00:24:59 -0700
Message-ID: <20353557.0404072324.1dbe5790@posting.google.com>


I am using set of parameters for multirow inserting into ORACLE (8.1.7.) table.
There is no problem to insert full set of rows defined by SQLSetStmtAttr( ..., SQL_ATTR_PARAMSET_SIZE, count, ... ). But if I want to insert only 1 row, and ignore the rest (by setting elements in operation array to SQL_PARAM_IGNORE), ORACLE ignores this setting, and inserts full set of rows again.

There is my code here:

SQLSetStmtAttr( hstmt, SQL_ATTR_PARAM_BIND_TYPE, SQL_BIND_BY_COLUMN, 0 );

SQLSetStmtAttr( hstmt, SQL_ATTR_PARAMSET_SIZE, (void*)COUNT, 0 ));
SQLSetStmtAttr( hstmt, SQL_ATTR_PARAM_STATUS_PTR, status, 0 );
SQLSetStmtAttr( hstmt, SQL_ATTR_PARAMS_PROCESSED_PTR, &processed, 0 );
SQLSetStmtAttr( hstmt, SQL_ATTR_PARAM_OPERATION_PTR, operation, 0 );

QLPrepare( hstmt, "INSERT INTO if39( k_interrupt ) VALUES( ? );", SQL_NTS );
SQLBindParameter( hstmt, 1, SQL_PARAM_INPUT, SQL_C_CHAR, SQL_CHAR, 10, 0, data, 10, data_ind );

for( i = 0; i < COUNT; i++ ) {
  operation[ i ] = SQL_PARAM_IGNORE;
}

for( i = 0; i < COUNT / 2; i++ ) {
  operation[ i ] = SQL_PARAM_PROCEED;
  sprintf( data[ i ], "A%d", i );
  data_ind[ i ] = SQL_NTS;
}

SQLExecute( hstmt );

I would expect this inserts COUNT/2 rows. But it inserts COUNT rows.

Any advice?

Thanks

Marek Received on Thu Apr 08 2004 - 02:24:59 CDT

Original text of this message

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