DBI NULLs Test

2020-07-11 Thread Carl Reynolds
Using DBI:mysql:database=mysql;hostname=localhost, db version: 5.5.5-10.1.41-MariaDB-0ubuntu0.18.04.1 => Drop table 'dbi__null_test_tmp', if it already exists... => Create table 'dbi__null_test_tmp'... => Insert 4 rows into the table...    Inserting values (1, 'Homer')    Inserting values (2, NULL)

Re: Extra nulls inserted with binary data (DBD::ODBC on Win7)

2016-01-28 Thread Jerrad Pierce
Martin has informed me that Microsoft doesn't support SQLDescribeParam and in the absence of an explicit bind_param, miscasts the data as VARCHAR. $sth->bind_param(1, undef, SQL_LONGVARBINARY); Solved the problem.

Fwd: Re: Extra nulls inserted with binary data (DBD::ODBC on Win7)

2016-01-28 Thread Martin J. Evans
--- Begin Message --- On 28/01/16 15:08, Jerrad Pierce wrote: Hello Martin, $DBI::VERSION = 1.634 $DBD::ODBC::VERSION = 1.52 It would also be useful to know the column type in your access DB. I'm updating a LONGBINARY column in a Jet 4 (MDB) database. Thanks Thank you I forgot, MS Acces

Re: Extra nulls inserted with binary data (DBD::ODBC on Win7)

2016-01-28 Thread Martin J. Evans
On 27/01/16 22:10, Jerrad Pierce wrote: Hello all, I'm updating a LONGBINARY column in a Jet 4 (MDB) database on Windows 7 with DBD::ODBC and have encountered an odd issue. Rather than the common problem of Unicode data being treated as bytes, I have bytes that seem to be being treated as UCS-

Extra nulls inserted with binary data (DBD::ODBC on Win7)

2016-01-28 Thread Jerrad Pierce
Hello all, I'm updating a LONGBINARY column in a Jet 4 (MDB) database on Windows 7 with DBD::ODBC and have encountered an odd issue. Rather than the common problem of Unicode data being treated as bytes, I have bytes that seem to be being treated as UCS-2LE. Data that should look like this in

Re: Extra nulls inserted with binary data (DBD::ODBC on Win7)

2016-01-28 Thread Jerrad Pierce
I have the problem whether I use the default DBD::ODBC from Strawberry Perl, or one built specifically with Unicode disabled. DBI::db=HASH(0x25f2608) trace level set to 0x6000100/2 (DBI @ 0x0/0) in DBI1.634-ithread (pid 1844) -> prepare for DBD::ODBC::db (DBI::db=HASH(0x25f26e0)~0x25f260

Re: Getting off the DBI-Users mailing list [was: Re: SQLite 3.3.16 nulls test results]

2007-05-04 Thread Alexander Foken
Improvement proposal for this list: Add a footer to each message send out by ezmlm, stating at least how to unsubscribe. I know that this information is already in the mail headers, but most people do not read the mail headers, except for those headers displayed by their mail user agent with

Getting off the DBI-Users mailing list [was: Re: SQLite 3.3.16 nulls test results]

2007-05-03 Thread Jonathan Leffler
The email headers say: List-Unsubscribe: List-Help: Send email to [EMAIL PROTECTED] from your registered email acccount, or go to the web site dbi.perl.org and unsubscribe from there. On 5/2/07, OMAR BARADI <[EMAIL PROTECTED]> wrote: I h

RE: SQLite 3.3.16 nulls test results

2007-05-03 Thread OMAR BARADI
Bunce; Alex Teslik; dbi-users@perl.org; [EMAIL PROTECTED] Subject: Re: SQLite 3.3.16 nulls test results On Tue, May 01, 2007 at 05:09:50PM -0500, CAMPBELL, BRIAN D (BRIAN) wrote: > Some points... > > 1. My response to the style 6 failure > > I am also puzzled why 6 failed. The non-n

Re: SQLite 3.3.16 nulls test results

2007-05-02 Thread Alex Teslik
t? > > > > But that current version has a couple of bugs. Attached is a revision I > > came up with, that fixes the bugs and improves the output format just a > > bit. Also attached is a diff listing. Tim, are YOU maintaining files > > at the link location above?

Re: SQLite 3.3.16 nulls test results

2007-05-02 Thread Tim Bunce
n (r9490). Thanks Brian. Alex, please run Brian's script and post the results. Thanks. Tim. > -Original Message- > From: Tim Bunce [mailto:[EMAIL PROTECTED] > Sent: Monday, April 30, 2007 5:08 AM > To: Alex Teslik > Cc: dbi-users@perl.org; [EMAIL PROTECTED] > Subject

RE: SQLite 3.3.16 nulls test results

2007-05-01 Thread CAMPBELL, BRIAN D \(BRIAN\)
30, 2007 5:08 AM To: Alex Teslik Cc: dbi-users@perl.org; [EMAIL PROTECTED] Subject: Re: SQLite 3.3.16 nulls test results On Fri, Apr 27, 2007 at 08:52:21AM -0700, Alex Teslik wrote: > as requested by the DBI man page: > > > [root]/home/alex# perl perl_dbi_nulls_test.pl Using connect

Re: SQLite 3.3.16 nulls test results

2007-04-30 Thread Tim Bunce
On Fri, Apr 27, 2007 at 08:52:21AM -0700, Alex Teslik wrote: > as requested by the DBI man page: > > > [root]/home/alex# perl perl_dbi_nulls_test.pl > Using connect arguments, db version: 3.3.16 > => Drop table 'dbi__null_test_tmp', if it already exists... > DBD::SQLite::db do failed: no such tab

SQLite 3.3.16 nulls test results

2007-04-27 Thread Alex Teslik
as requested by the DBI man page: [root]/home/alex# perl perl_dbi_nulls_test.pl Using connect arguments, db version: 3.3.16 => Drop table 'dbi__null_test_tmp', if it already exists... DBD::SQLite::db do failed: no such table: dbi__null_test_tmp(1) at dbdimp.c line 271 at perl_dbi_nulls_test.pl li

Re: NULLs in Text::CSV_XS and DBD::CSV

2005-03-16 Thread Michael A Chase tech
On 03/16/2005 09:50 AM, NIPP, SCOTT V (SBCSI) said: Still banging my head into a wall... Now I am getting NULLs inserted as expected into the database, but I am getting errors on the compare. my @old = $test->fetchrow_array (); foreach $n (0..20) { chomp($file_val = $data

RE: NULLs in Text::CSV_XS and DBD::CSV

2005-03-16 Thread NIPP, SCOTT V \(SBCSI\)
Still banging my head into a wall... Now I am getting NULLs inserted as expected into the database, but I am getting errors on the compare. my @old = $test->fetchrow_array (); foreach $n (0..20) { chomp($file_val = $data[$n]); $file_val =~ s/\s*$//; #ch

Re: NULLs in Text::CSV_XS and DBD::CSV

2005-03-16 Thread Jeff Zucker
Jeff Zucker wrote: 1,,2 1,"",2 In case I was unclear: the first is three fields with the second field NULL, the second is three fields with the second field an empty string. -- Jeff

Re: NULLs in Text::CSV_XS and DBD::CSV

2005-03-16 Thread Jeff Zucker
Ronald J Kimball wrote: Jeff Zucker [mailto:[EMAIL PROTECTED] wrote: Yes, currently Text::CSV_XS returns empty string for both empty strings and NULLs. I am considering providing an option to differentiate the two and return undef for NULLs. How do you distinguish between empty string and

Re: NULLs in Text::CSV_XS and DBD::CSV

2005-03-16 Thread Jeff Zucker
Jeff Zucker wrote: I forgot to mention that DBD::AnyData (which also handles CSV and "pipe delimited" formats) returns undef for NULL, so if you use DBD::AnyData or plain AnyData you can get the undefs you want. Using plain AnyData, this will generate use of unitialized value warning for all NU

RE: NULLs in Text::CSV_XS and DBD::CSV

2005-03-16 Thread Ronald J Kimball
> -Original Message- Jeff Zucker [mailto:[EMAIL PROTECTED] wrote: > Yes, currently Text::CSV_XS returns empty string for both empty strings > and NULLs. I am considering providing an option to differentiate the > two and return undef for NULLs. How do you distinguish b

NULLs in Text::CSV_XS and DBD::CSV

2005-03-16 Thread Jeff Zucker
f value). Yes, currently Text::CSV_XS returns empty string for both empty strings and NULLs. I am considering providing an option to differentiate the two and return undef for NULLs. I'm used to Oracle, which treats an empty string as NULL. Is it different for MySQL? DBD::CSV also currently

RE: Perl DBI Documentation Proposal: Using NULLs in Placeholders

2005-01-26 Thread CAMPBELL, BRIAN D (BRIAN)
(BRIAN) [mailto:[EMAIL PROTECTED] Sent: Thursday, December 16, 2004 10:33 AM To: dbi-users@perl.org Subject: Perl DBI Documentation Proposal: Using NULLs in Placeholders Fellow DBI Users, Tim Bunce has asked me to help revise the NULLs subsection in the "Placeholders and Bind Values&qu

Re: Perl DBI Documentation Proposal: Using NULLs in Placeholders

2004-12-16 Thread Michael A Chase tech
Suggested changes {before : after}. On 12/16/2004 09:33 AM, CAMPBELL, BRIAN D (BRIAN) said: Undefined values, or C, are used to indicate NULL values. You can insert {: or} update columns with a NULL value as you would a non-NULL value. These examples insert and update the column C with a NULL valu

Perl DBI Documentation Proposal: Using NULLs in Placeholders

2004-12-16 Thread CAMPBELL, BRIAN D (BRIAN)
Fellow DBI Users, Tim Bunce has asked me to help revise the NULLs subsection in the "Placeholders and Bind Values" section in the DBI documention for DBI 1.47. Attached is the proposed text to be included, along with an associated perl script. You are invited to review them. P

Re: Perl DBI Documentation Proposal: Using NULLs in Placeholders

2004-12-16 Thread Jeff Zucker
CAMPBELL, BRIAN D (BRIAN) wrote: $sth = $dbh->prepare("CREATE TABLE $tablename (key int, mycol char(8))"); You might want to change the name of the first column since KEY is a SQL keyword and some databases will reject it. That might also apply to the NAME column in your examples. -- Jeff

RE: Correct way to deal with returned NULLs?

2004-04-26 Thread Greg Sabino Mullane
-BEGIN PGP SIGNED MESSAGE- Hash: SHA1 > Convert undef to empty string: > > while (my($id, $value) = $sth->fetchrow_array()) { > foreach ($id, $value) { >$_ ||= ''; > } > print "$id = $value\n"; > } Please do not do this. Using ||= tests if the variable is *true*, not if it is

Re: Correct way to deal with returned NULLs?

2004-04-26 Thread Lincoln A. Baxter
t;$description"; > print "$dateclosed"; > print "\n"; > } This only works if projectno is a NOT NULL column. (It would be kind of stupid to allow nulls in something like this however). Otherwise, you are better of NOT using fetchrow_array. Conside fetch

RE: [DBI] RE: Correct way to deal with returned NULLs?

2004-04-26 Thread Jesse, Rich
April 26, 2004 12:43 PM > To: Jesse, Rich > Cc: 'Michael Ragsdale'; '[EMAIL PROTECTED]' > Subject: Re: [DBI] RE: Correct way to deal with returned NULLs? > > > On Mon, 26 Apr 2004, Jesse, Rich wrote: > > > Thanks all for your responses. We wen

Re: [DBI] RE: Correct way to deal with returned NULLs?

2004-04-26 Thread Dave Cash
Dave > Thanks again! > Rich > > Rich JesseSystem/Database Administrator > [EMAIL PROTECTED] QuadTech, Sussex, WI USA > > > > -Original Message- > > From: Michael Ragsdale [mailto:[EMAIL PROTECTED] > > Sent: Monday, April 26, 2004 10

RE: Correct way to deal with returned NULLs?

2004-04-26 Thread Jesse, Rich
Tech, Sussex, WI USA > -Original Message- > From: Michael Ragsdale [mailto:[EMAIL PROTECTED] > Sent: Monday, April 26, 2004 10:29 AM > To: Jesse, Rich > Subject: Re: Correct way to deal with returned NULLs? > > > You can place the following near the beginning of y

RE: Correct way to deal with returned NULLs?

2004-04-26 Thread Reidy, Ron
BioPharma, Inc. -Original Message- From: David N Murray [mailto:[EMAIL PROTECTED] Sent: Monday, April 26, 2004 9:26 AM To: Jesse, Rich Cc: [EMAIL PROTECTED] Subject: Re: Correct way to deal with returned NULLs? $dateclosed = '' if !defined($dateclosed); On Apr 26, Jesse, Rich

Re: Correct way to deal with returned NULLs?

2004-04-26 Thread Chuck Fox
Correct way to deal with returned NULLs? Howdy, I have a question from one of our developers that's been bugging me and I can't find an answer. Given this v1.37 DBI code fragement: while ( my ($projectno,$description,$dateclosed) = $sth->fetchrow_array ) { print &

RE: Correct way to deal with returned NULLs?

2004-04-26 Thread Ronald J Kimball
> Howdy, > > I have a question from one of our developers that's been bugging me and I > can't find an answer. Given this v1.37 DBI code fragement: > > while ( my ($projectno,$description,$dateclosed) = $sth->fetchrow_array ) > { > print "$projectno"; > print "$description"; >

RE: Correct way to deal with returned NULLs?

2004-04-26 Thread Ronald Kimball
> -Original Message- > From: Jesse, Rich [mailto:[EMAIL PROTECTED] > Sent: Monday, April 26, 2004 10:12 AM > To: '[EMAIL PROTECTED]' > Subject: Correct way to deal with returned NULLs? > > Howdy, > > I have a question from one of our developers that

Re: Correct way to deal with returned NULLs?

2004-04-26 Thread David N Murray
$dateclosed = '' if !defined($dateclosed); On Apr 26, Jesse, Rich scribed: > Howdy, > > I have a question from one of our developers that's been bugging me and I > can't find an answer. Given this v1.37 DBI code fragement: > > while ( my ($projectno,$description,$dateclosed) = $sth->fetchrow_arr

Correct way to deal with returned NULLs?

2004-04-26 Thread Jesse, Rich
Howdy, I have a question from one of our developers that's been bugging me and I can't find an answer. Given this v1.37 DBI code fragement: while ( my ($projectno,$description,$dateclosed) = $sth->fetchrow_array ) { print "$projectno"; print "$description"; print "$datec

Re: Inserting 'typed' nulls

2003-01-20 Thread Ron Savage
On Mon, 20 Jan 2003 15:03:10 -0600, Ben Siders wrote: Hi Ben >This isn't strictly Perl-related, but sorta. I'm trying to build a >generic web-based database browser for PostgreSQL and I can't figure >out >how to query the database for a list of tables, indeces, and >columns. >Naturally, my brows

Re: Inserting 'typed' nulls

2003-01-20 Thread Ben Siders
This isn't strictly Perl-related, but sorta. I'm trying to build a generic web-based database browser for PostgreSQL and I can't figure out how to query the database for a list of tables, indeces, and columns. Naturally, my browser will be a collection of Perl CGI scripts, but in this case, I'

Inserting 'typed' nulls

2003-01-20 Thread Paul Wayper
Hi, people! I've scanned through the FAQ and various other materials but I can't see anything answering my question, so I thought I'd ask the gurus here. I'm wanting to do a lot of inserts into a database, and some of the fields contain nulls. I'm inserting this data f

Re: DBI Nulls and exists...

2002-09-17 Thread Tim Peters
On Mon, Sep 16, 2002 at 07:24:29PM -0500, Herbold, John W. wrote: > > Any Ideas of what I am doing wrong? Can I not use an exist to check for > NULLS, if not what can I use. (DB2 is the source database if it matters) DBI uses the perl undefined value to represent a NULL, so... [

Re: Nulls, undef, split and ODBC

2002-05-07 Thread Simon Oliver
Felix Geerinckx wrote: > > > my @data = map {length($_) ? $_ : undef} split(@$row); > > You do realize that you are splitting $_ here? Now I do (I should have stayed in bed this morning). Of course I meant: my @data = map {length($_) ? $_ : undef} @$row; -- Simon Oliver

Re: Nulls, undef, split and ODBC

2002-05-07 Thread Felix Geerinckx
on Tue, 07 May 2002 09:48:39 GMT, [EMAIL PROTECTED] (Simon Oliver) wrote: > my @data = map {length($_) ? $_ : undef} split(@$row); You do realize that you are splitting $_ here? -- felix

Re: Nulls, undef, split and ODBC

2002-05-07 Thread Simon Oliver
> >my @Fields = map {defined($_) ? $_ : undef} split(/,/); > > But this has zero effect. You're turning undef into undef. There is no > undefined value to begin with. It did what he asked to do, but as you say, it is pointless and I should have read it back before posting. I adapted it from an a

Re: Nulls, undef, split and ODBC

2002-05-07 Thread Bart Lateur
On Tue, 07 May 2002 09:11:23 +0100, Simon Oliver wrote: >Michael Blackmore wrote: >> I am trying to avoid doing the following on 80 columns >> >> >> my ($col1,$col2,.) = split(/,/); >> $col1 = undef unless($col1); Turning 0 into undef is OK? I think not. >> > >How about using map

Re: Nulls, undef, split and ODBC

2002-05-07 Thread Simon Oliver
Michael Blackmore wrote: > I am trying to avoid doing the following on 80 columns > > > my ($col1,$col2,.) = split(/,/); > $col1 = undef unless($col1); > How about using map to do it for you? my @Fields = map {defined($_) ? $_ : undef} split(/,/); $sth->execute(@Fields); -- Sim

Re: Nulls, undef, split and ODBC

2002-05-06 Thread Waldemar Zurowski
On Mon, 6 May 2002 08:39:37 +1000 "Michael Blackmore" <[EMAIL PROTECTED]> wrote: > > my ($col1,$col2,.) = split(/,/); > $col1 = undef unless($col1); > > > I realise that this is not strictly a DBI problem, really 'split' > should return undef's, shouldn't it? Anyway I wondered if a

Nulls, undef, split and ODBC

2002-05-05 Thread Michael Blackmore
Dear All, (NT4 SP6 Activeperl 5.6.0 build 623) I am wanting to load data from a text file into a database (Access). The files contain a number of columns (up to 80 in some cases). As a result I am trying to do the following. use strict; use DBI qw(:sql_types); use DBD::ODBC; my $dsn = "Test

Re: dbi and nulls

2002-01-14 Thread Ronald J Kimball
; <[EMAIL PROTECTED]> > Sent: Friday, January 11, 2002 11:50 PM > Subject: Re: dbi and nulls > > > > 'foo' is not a column, 'foo' is a value. > > > > The SQL will be either: > > > > domain = 'foo' OR ( 'foo' IS NUL

Re: dbi and nulls

2002-01-12 Thread Ronnie Anderson
n 11, 2002 at 10:05:56PM +0100, M.W. > Koskamp wrote: >> >> - Original Message - >> From: "Ronnie Anderson" <[EMAIL PROTECTED]> >> To: <[EMAIL PROTECTED]> >> Sent: Friday, January 11, 2002 8:36 PM >> Subject: dbi and nulls >>

Re: dbi and nulls

2002-01-12 Thread Ronald J Kimball
On Fri, Jan 11, 2002 at 04:08:44PM -0500, Ronnie Anderson wrote: > I just figured it out. > > If $DOMAIN is NULL, I'm setting it to "undef" and then > passing that in to the execute statement. It seems to > be taking the _string_ "undef" instead of the _value_ > of undef. So my query was doing "W

Re: dbi and nulls

2002-01-12 Thread Ronald J Kimball
On Fri, Jan 11, 2002 at 10:05:56PM +0100, M.W. Koskamp wrote: > > - Original Message - > From: "Ronnie Anderson" <[EMAIL PROTECTED]> > To: <[EMAIL PROTECTED]> > Sent: Friday, January 11, 2002 8:36 PM > Subject: dbi and nulls > > > &

Re: dbi and nulls

2002-01-11 Thread M.W. Koskamp
- Original Message - From: "Ronald J Kimball" <[EMAIL PROTECTED]> To: "M.W. Koskamp" <[EMAIL PROTECTED]> Cc: "Ronnie Anderson" <[EMAIL PROTECTED]>; <[EMAIL PROTECTED]> Sent: Friday, January 11, 2002 11:50 PM Subject: Re: dbi and n

Re: dbi and nulls

2002-01-11 Thread M.W. Koskamp
- Original Message - From: "Ronnie Anderson" <[EMAIL PROTECTED]> To: <[EMAIL PROTECTED]> Sent: Friday, January 11, 2002 8:36 PM Subject: dbi and nulls > my $hosthandler = $dbh->prepare(q{ > SELECT id > FROM host > WHERE tid = ? > AND (dom

Re: dbi and nulls

2002-01-11 Thread Ronnie Anderson
on" <[EMAIL PROTECTED]> > To: <[EMAIL PROTECTED]> > Sent: Friday, January 11, 2002 8:36 PM > Subject: dbi and nulls > > > >> my $hosthandler = $dbh->prepare(q{ >> SELECT id >> FROM host >> WHERE tid = ? >> AND (domain = ? OR (? IS

Re: dbi and nulls

2002-01-11 Thread Jeff Boes
subdom IS NULL)) > AND (misc = ? OR (? IS NULL AND misc IS NULL)) > }) or die "Couldn't prepare statement: $DBI::errstr; > stopped"; > > $hosthandler->execute > ($tid,$DOMAIN,$DOMAIN,$SUBDOM,$SUBDOM,$MISC,$MISC); > > $DOMAIN,$SUBDOM,$MISC can a

dbi and nulls

2002-01-11 Thread Ronnie Anderson
select rows which have a NULL product_code! Refer to the SQL manual for your database engine or any SQL book for the reasons for this. To explicitly select NULLs you have to say "WHERE product_code IS NULL" and to make that general you have to say: ... WHERE (product_code = ? OR (? IS N

Re: DBD::Pg breaks with embedded ASCII nulls

2001-10-30 Thread Jeff Boes
On Thu, 25 Oct 2001 14:10:10 -0400 Jeff Boes <[EMAIL PROTECTED]> wrote: > The following code fails with an 'Unterminated quote string' error. > > #!/usr/bin/perl -w > use strict; > use DBI; > use Carp; > > my $dbh = DBI->connect('dbi:Pg:dbname=nexcerpt', '', '', {AutoCommit=>0, >

DBD::Pg breaks with embedded ASCII nulls

2001-10-25 Thread Jeff Boes
The following code fails with an 'Unterminated quote string' error. #!/usr/bin/perl -w use strict; use DBI; use Carp; my $dbh = DBI->connect('dbi:Pg:dbname=nexcerpt', '', '', {AutoCommit=>0, RaiseError=>0,

RE: -w does not allow undef for NULLs

2001-06-29 Thread Tim Harsch
l [mailto:[EMAIL PROTECTED]] > Sent: Friday, June 29, 2001 3:31 PM > To: Tim Harsch > Cc: [EMAIL PROTECTED] > Subject: Re: -w does not allow undef for NULLs > > > You will get this if you use the older DBD::Sybase. I struggled with this > stuff and made ugly workarounds ju

Re: -w does not allow undef for NULLs

2001-06-29 Thread Curt Russell Crandall
You will get this if you use the older DBD::Sybase. I struggled with this stuff and made ugly workarounds just get stuff undef through a placeholder with DBD::Sybase 0.21. Either switch to 0.91 or check for an undef value and do a $dbh->quote() on it... unfortunately, you won't be able to use pl

RE: -w does not allow undef for NULLs

2001-06-28 Thread Tim Harsch
e line 1 5 DB<3> > -Original Message- > From: Mark Stosberg [mailto:[EMAIL PROTECTED]] > Sent: Thursday, June 28, 2001 5:36 PM > To: Tim Harsch > Cc: [EMAIL PROTECTED] > Subject: Re: -w does not allow undef for NULLs > > > Tim Harsch wrote: > > > &g

Re: -w does not allow undef for NULLs

2001-06-28 Thread Mark Stosberg
Tim Harsch wrote: > > how do you use undef when you mean to without -w barking this at you: > Use of uninitialized value at > /usr/local/perl5.005/lib/site_perl/DBD/Sybase.pm line 121. > > code snip: > $hDB->do( < create table #temp_for_this_session > ( fld1 int not null,

Re: -w does not allow undef for NULLs

2001-06-28 Thread Michael Peppler
Tim Harsch writes: > how do you use undef when you mean to without -w barking this at you: > Use of uninitialized value at > /usr/local/perl5.005/lib/site_perl/DBD/Sybase.pm line 121. Just tried that, and I don't get a warning. Is that with 0.91? Michael -- Michael Peppler - Data Migrations

-w does not allow undef for NULLs

2001-06-28 Thread Tim Harsch
how do you use undef when you mean to without -w barking this at you: Use of uninitialized value at /usr/local/perl5.005/lib/site_perl/DBD/Sybase.pm line 121. code snip: $hDB->do(

RE: Oracle and nulls

2001-06-19 Thread Sterin, Ilya
Dawson To: [EMAIL PROTECTED] Sent: 06/19/2001 9:32 AM Subject: Oracle and nulls Hi, I am trying to insert a record into an oracle database, and i need to insert leave some of the fields null, but other time's I may need to insert data into those fields within the same script. Does anyone hav

Oracle and nulls

2001-06-19 Thread Edd Dawson
Hi, I am trying to insert a record into an oracle database, and i need to insert leave some of the fields null, but other time's I may need to insert data into those fields within the same script. Does anyone have any ideas how I might achieve the null business? thanks very much Edd Dawson -

Re: DBD-ADO and NULLs

2001-06-19 Thread Garrison G. Lutz
ow results. What am I doing wrong? - Original Message - From: Garrison G. Lutz To: [EMAIL PROTECTED] Sent: Monday, June 18, 2001 11:56 AM Subject: DBD-ADO and NULLs Hello all, I am using DBD-ADO (latest version) and DBI 1.14. I am trying to call an MS-SQL Server stored

DBD-ADO and NULLs

2001-06-18 Thread Garrison G. Lutz
Hello all, I am using DBD-ADO (latest version) and DBI 1.14. I am trying to call an MS-SQL Server stored procedure using placeholders this way: if (condition) { $hash{'param'} = 'text'; } else { $hash{'param'} = undef; } @placeholders = ($hash{'param'}); $sth = $dbh->prepare('{call proc(?)}'

Re: NULLs

2001-04-25 Thread Tommy Wareing
On Wed, Apr 25, 2001 at 05:19:14PM +0200, Sean Carte wrote: > I'm trying (unsuccessfully) to get DBI:Pg to insert NULL values into > a table. The following works in psql (and dbish): > > 'UPDATE null_test SET dwarf_1=NULL WHERE dwarf_2='Grumpy';' > > It also works in a $dbh->do() statement: >

Re: NULLs

2001-04-25 Thread Christian Hammers
On Wed, Apr 25, 2001 at 05:19:14PM +0200, Sean Carte wrote: > $cursor->execute(NULL, 'Grumpy') || die $dbh->errstr; Try: $cursor->execute(undef, 'Grumpy') || die $dbh->errstr; BTW: Is there a Difference between $dbh->errstr and $DBI::errstr ? I always used the last and it works, too. bye, -chri

Re: NULLs

2001-04-25 Thread Ronald J Kimball
On Wed, Apr 25, 2001 at 05:19:14PM +0200, Sean Carte wrote: > I'm trying (unsuccessfully) to get DBI:Pg to insert NULL values into > a table. The following works in psql (and dbish): > > 'UPDATE null_test SET dwarf_1=NULL WHERE dwarf_2='Grumpy';' > > It also works in a $dbh->do() statement: >

Re: NULLs

2001-04-25 Thread Tommy Wareing
On Wed, Apr 25, 2001 at 05:38:47PM +0200, Christian Hammers wrote: > On Wed, Apr 25, 2001 at 04:34:26PM +0100, Tommy Wareing wrote: > > Oracle have mentioned in the past that they might differentiate > > between NULL and an empty string, but it's going to break so much > > code, that I think we're

Re: NULLs

2001-04-25 Thread Christian Hammers
On Wed, Apr 25, 2001 at 04:34:26PM +0100, Tommy Wareing wrote: > Oracle have mentioned in the past that they might differentiate > between NULL and an empty string, but it's going to break so much > code, that I think we're safe with this... I would be horrified if any database would treat undef a

Re: NULLs

2001-04-25 Thread Sean Carte
At 5:27 pm +0200 25/4/01, Christian Hammers wrote: >BTW: Is there a Difference between $dbh->errstr and $DBI::errstr ? >I always used the last and it works, too. $DBI::errstr refers to the last handle used within DBI, whereas $dbh->errstr is associated with the current error flagged against the

NULLs

2001-04-25 Thread Sean Carte
I'm trying (unsuccessfully) to get DBI:Pg to insert NULL values into a table. The following works in psql (and dbish): 'UPDATE null_test SET dwarf_1=NULL WHERE dwarf_2='Grumpy';' It also works in a $dbh->do() statement: But when I attempt the same with placeholders: $cursor = $dbh->prepare( q

Re: Unwanted nulls at the end of retrieved char fields

2001-02-20 Thread Michael Peppler
Cecil Stump writes: > Hi all, > > I am getting unwanted null chars at the end of every retrieved char field. > This would be fine in C, but in Perl, "Bob" != "Bob\0". I am quite certain > that these nulls are not in the SQL database data. > > Is

Unwanted nulls at the end of retrieved char fields

2001-02-20 Thread Cecil Stump
Hi all, I am getting unwanted null chars at the end of every retrieved char field. This would be fine in C, but in Perl, "Bob" != "Bob\0". I am quite certain that these nulls are not in the SQL database data. Is this some sort of configuration item that I have missed, an M