Beefy Boxes and Bandwidth Generously Provided by pair Networks
Syntactic Confectionery Delight
 
PerlMonks  

Re: DBI - Insert NULL value into DB

by GotToBTru (Prior)
on Aug 24, 2016 at 13:09 UTC ( [id://1170309]=note: print w/replies, xml ) Need Help??


in reply to DBI - Insert NULL value into DB

Suggested by DBI:

while (($id,$value) = $hStatement->fetchrow_arrayref) { foreach (($id,$value)) { $_ = '' unless defined }; ...

Update: in Informix at least, this does not work. An empty string does not equate to NULL. Also, I don't get any warnings when updating a table using a undefined variable.

But God demonstrates His own love toward us, in that while we were yet sinners, Christ died for us. Romans 5:8 (NASB)

Replies are listed 'Best First'.
Re^2: DBI - Insert NULL value into DB
by hippo (Bishop) on Aug 24, 2016 at 14:07 UTC

    Won't that mean that the second table has no NULLs in it and is therefore not a real copy of the first table?

      Good point - this would be something to test, if the DB interprets an empty string as a NULL value.

      But God demonstrates His own love toward us, in that while we were yet sinners, Christ died for us. Romans 5:8 (NASB)

Log In?
Username:
Password:

What's my password?
Create A New User
Domain Nodelet?
Node Status?
node history
Node Type: note [id://1170309]
help
Chatterbox?
and the web crawler heard nothing...

How do I use this?Last hourOther CB clients
Other Users?
Others avoiding work at the Monastery: (4)
As of 2024-03-29 05:29 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found