Oracle FAQ | Your Portal to the Oracle Knowledge Grid |
![]() |
![]() |
Home -> Community -> Usenet -> c.d.o.misc -> binding a number to a char
I have a curious problem. perl, v5.8.6 built for sun4-solaris with DBI
1.50 oracle database
have a prepared statement
$GetGoodPoint = $DBI->prepare (qq (
select point, UP.provider_id from usage_points UP where point_region = ? )) or die "Cannot prepare GetGoodCtePoint\n";
I execute the statement like :
$GetGoodPoint->execute($ac);
($point, $providerid) = $GetGoodPoint->fetchrow_array;
point_region is a char(24), but in a lot of cases the values are all digits
In sqlplus the ? would be modified to '&PR' . Without the quotes it does not fail, but it returns nothing.
In perl I can not get it to return anything if the bound value is all digits.
I have tried all sorts of combinations of double and single quotes, with and without escaping, even $DBI->quote. But in all cases if the value is all digits it returns nothing.
Now this does works
$GetGoodPoint = $DBI->prepare (qq (
select point, UP.provider_id from usage_points UP where point_region = '$ac' )) or die "Cannot prepare GetGoodCtePoint\n";
But then I need to re prepare it for every call.
I would appreciate any ideas.
Jon L
Received on Fri Jun 02 2006 - 15:47:54 CDT
![]() |
![]() |