[Sqlrelay-discussion] side effect in TCL API inputBinds
Brought to you by:
mused
|
From: Rodney H. <rh...@et...> - 2006-03-22 16:33:51
|
Im using the inputBinds method to pass parameters to an oracle stored procedure.
sample table definition
=====
num_field number(10)
char_field varchar2(24)
Passing this data to inputBinds
===============================
123456
0123456000009
It appears that the inputBind and inputBinds sections in api/tcl/sqlrelayCmd.C
use a sequence of steps in an attempt to automatically determine the data type
of the parameter.
<<< BEGIN snippet >>>
if ( Tcl_GetLongFromObj(interp, valueObj, &value) == TCL_OK ||
Tcl_GetIntFromObj(interp, valueObj, (int *)&value) == TCL_OK ) {
cur->inputBind(Tcl_GetString(variableObj), value);
} else {
cur->inputBind(Tcl_GetString(variableObj),
Tcl_GetString(valueObj));
}
<<< END snippet >>>
Seems to me that either Tcl_GetLongFromObj, or Tcl_GetIntFromObj are seeing
'0123456000009' and treating it as a number rather than a string, this causes
the data to be changed when it is put in the &value.
Is there a way to force the data to be interpreted as a string rather than a
number in this case?
rodney
|