On Fri 10 Sep 2004 21:13, Steven Lembark <[EMAIL PROTECTED]> wrote:
>
> > What happens if you postpend a null character?
> >
> > my $zero = "0\0";
>
> Nope:
>
> SQL> create table foo ( bar number(1,0) );
>
> SQL> insert into foo (bar) values ( 1 );
>
> 1 row created.
>
> SQL> insert into foo(bar) values ('2\0');
This is not the same as the perl code
DBI->trace (4);
$dbh->do ("create table foo (bar number (1, 0));
$sth = $dbh->prepare ("insert into foo values (?)");
$sth->execute (1);
$sth->execute ("2\0");
> insert into foo(bar) values ('2\0')
> *
> ERROR at line 1:
> ORA-01722: invalid number
>
> Without some knowlege of underlying data types I cannot quote
> stringy-numerics so that the database will accept them via
> cut+paste from an error message from the vendor's SQL command
> line utilities (e.g., sqlplus, shown above).
--
H.Merijn Brand Amsterdam Perl Mongers (http://amsterdam.pm.org/)
using perl-5.6.1, 5.8.0 & 633 on HP-UX 10.20 & 11.00, AIX 4.2, AIX 4.3,
WinNT 4, Win2K pro & WinCE 2.11 often with Tk800.024 &/| DBD-Unify
ftp://ftp.funet.fi/pub/languages/perl/CPAN/authors/id/H/HM/HMBRAND/