D
dn_perl
I am running into a problem with inserting a blank (not null) in a
non-null field via a placeholder.
sqlplus> desc mytable
fld01 not null varchar2(16) .
In Perl code :
use strict;
use DBI ;
my $dbh ; # DBI-> connect has been used to set value of $dbh
# database is Oracle 9i on solaris
my $user_id = ' ' ; # single space char in the string
my $dst = $dbh->prepare(" insert into
mytable (fld01) values(? ) " );
$dst->execute( $user_id ) or die "sql call failed." ;
---------------
But I get a DBD error that a null value cannot be entered into fld01. I
set $user_id to single-blank to insert a non-null value into
mytable.fld01 .
How can I add one space to mytable.fld01 ?
TIA.
non-null field via a placeholder.
sqlplus> desc mytable
fld01 not null varchar2(16) .
In Perl code :
use strict;
use DBI ;
my $dbh ; # DBI-> connect has been used to set value of $dbh
# database is Oracle 9i on solaris
my $user_id = ' ' ; # single space char in the string
my $dst = $dbh->prepare(" insert into
mytable (fld01) values(? ) " );
$dst->execute( $user_id ) or die "sql call failed." ;
---------------
But I get a DBD error that a null value cannot be entered into fld01. I
set $user_id to single-blank to insert a non-null value into
mytable.fld01 .
How can I add one space to mytable.fld01 ?
TIA.