ODBC Arrays of Parameters

Go back to: Code Samples
SQLPrepare (hstmt, "INSERT INTO DailyLedger (...)" + 
            "VALUES (?,?,...)", SQL_NTS);
SQLSetStmtAttr (hstmt, SQL_ATTR_PARAMSET_SIZE, (UDWORD)100, 
                SQL_IS_UINTEGER);
SQLSetStmtAttr (hstmt, SQL_ATTR_PARAMS_PROCESSED_PTR, 
                &rows_processed, SQL_IS_POINTER);
 
/* Specify an array in which to retrieve the status of 
   each set of parameters. */
SQLSetStmtAttr(hstmt, SQL_ATTR_PARAM_STATUS_PTR, 
   ParamStatusArray, SQL_IS_POINTER);
 
/* Pass 100 parameters per execute */
/* Bind parameters */
...
do {
 
/* Read up to 100 ledger values into 
   bound parameter buffers */
...
rc = SQLExecute (hstmt);  
 
/* Insert a group of 100 rows */
} while ! (eof);




Like what you see? Share and Enjoy:
  • Digg
  • Sphinn
  • del.icio.us
  • Facebook
  • Mixx
  • Google
  • LinkedIn
  • Reddit
  • StumbleUpon
  • Technorati
  • TwitThis

Book Content Copyright © 2009 by Prentice Hall PTR. All rights reserved. | Corporate Sponsor DataDirect Technologies.