Re: [Sqlrelay-discussion] side effect in TCL API inputBinds
Brought to you by:
mused
|
From: Rodney H. <rh...@et...> - 2006-03-22 18:34:46
|
another note on this. The value '0123456000009' is being treated as an octal
and is converted from octal to decimal by the Tcl_GetLongFromObj before being
sent to the database.
rodney
Rodney Holm wrote:
> 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
>
>
>
>
>
>
> -------------------------------------------------------
> This SF.Net email is sponsored by xPML, a groundbreaking scripting language
> that extends applications into web and mobile media. Attend the live
> webcast
> and join the prime developer group breaking into this new coding territory!
> http://sel.as-us.falkag.net/sel?cmd=lnk&kid=110944&bid=241720&dat=121642
> _______________________________________________
> Sqlrelay-discussion mailing list
> Sql...@li...
> https://lists.sourceforge.net/lists/listinfo/sqlrelay-discussion
|