sqlexecute is not working
571817Sep 9 2007 — edited Sep 11 2007Hi,
Im suffering failure in sqlexecute of my update statemnt .
(I want to update a cached table in TT with passthrough=0)
update_stmt= "UPDATE sd_deposit_m SET aval_bal= aval_bal + ? , auth_bal = ? , last_authbal_dt = SYSDATE, last_txn_dt = SYSDATE, last_txn_type = NVL(? ,'D') WHERE customername = 'RaviC' " ;
rc=SQLPrepare(upstmt,(SQLCHAR*) update_stmt,SQL_NTS); //rc=0 success
rc = SQLBindParameter(upstmt,1,SQL_PARAM_INPUT,SQL_C_LONG,SQL_INTEGER,0,0,&txn_amt,0, NULL);//rc=0 success
rc = SQLBindParameter (upstmt,2,SQL_PARAM_INPUT,SQL_C_CHAR,SQL_CHAR,20,0,txn_type,0,NULL);//rc=0 success
printf("Excecuting the update \n");
rc = SQLExecute (upstmt); // rc= -1 ie update is not done
I have updated the corresponding query hardcoded in Timesten .
Its working ..
hardcoded query
UPDATE sd_deposit_m SET aval_bal= aval_bal + 1000 , auth_bal = 1000 , last_authbal_dt = SYSDATE, = SYSDATE, last_txn_type = NVL('' ,'D') WHERE customername = 'RaviC'
variables I declared in the beggining of the program
long int cardNo=1;
char * card_validty_dt="26-MAR-08";
long int txn_amt=1000;
long int cifno=120000;
But thru appication its not working ..I think the query is right ..
Also its prepared and bind parameters with variables
I tried ..but could not find a solution so far ..
plz anybody can help ...
thanks
sanal