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 -> Help Please!!! - SQLBindParameter

Help Please!!! - SQLBindParameter

From: Harp <hmetu_at_gmx.net>
Date: 22 Feb 2005 03:05:05 -0800
Message-ID: <1109070305.293898.113580@c13g2000cwb.googlegroups.com>


#define SMALL_LEN 50

SQLCHAR *helpCType[SMALL_LEN];
string cType[] = {"SQL_C_CHAR","SQL_C_CHAR","SQL_C_CHAR","SQL_C_CHAR"};
string sqlType[] = {"SQL_CHAR","SQL_CHAR","SQL_CHAR","SQL_CHAR"};

rc = SQLNumParams(hstmt,&numCols);
if(rc == SQL_SUCCESS){
  for(int i = 0; i < numCols; i++){
//rc = SQLBindParameter(hstmt, (SQLSMALLINT)i+1,
//SQL_PARAM_OUTPUT, SQL_C_CHAR,(SQLSMALLINT)sqlType[i].c_str(),
//len, 0,(void *)name[i].c_str(),0,&DataLen[i]);

    lstrcpy((char *)helpCType, cType[i].c_str());     rc = SQLBindParameter(hstmt, (SQLSMALLINT)i+1,SQL_PARAM_OUTPUT,     (SQLSMALLINT)helpCType,(SQLSMALLINT)sqlType[i].c_str(),len,0,     (void *)name[i].c_str(),0,&DataLen[i]);   }
}
The commented statement works fine, and the uncommented does not work - paramtertype out of range...
The difference b/w the two is the ValueType (fCType) - one entered as it is (SQL_C_CHAR) and the other as a variable helpCType(it fails to accept this, though it gets the right value) I do use odbc from oracle9i (vers:9.00.11.00). Please could anyone try it and give me feedbacks. How can I improve it?
Regards,
Harp Received on Tue Feb 22 2005 - 05:05:05 CST

Original text of this message

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