Oracle FAQ Your Portal to the Oracle Knowledge Grid
HOME | ASK QUESTION | ADD INFO | SEARCH | E-MAIL US
 

Home -> Community -> Usenet -> c.d.o.misc -> binding a number to a char

binding a number to a char

From: JONL <jon.m.landenburger_at_verizon.com>
Date: 2 Jun 2006 13:47:54 -0700
Message-ID: <1149281274.022549.219620@i39g2000cwa.googlegroups.com>


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

Original text of this message

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