Beefy Boxes and Bandwidth Generously Provided by pair Networks
Think about Loose Coupling
 
PerlMonks  

Re^7: Writing NULL values to a MySQL record via DBI

by Anonymous Monk
on Feb 26, 2015 at 23:25 UTC ( [id://1118017]=note: print w/replies, xml ) Need Help??


in reply to Re^6: Writing NULL values to a MySQL record via DBI
in thread Writing NULL values to a MySQL record via DBI

The first argument is your SQL statement. The second argument is a special thing. Just ignore it and use what i provided until you understand. The remaining arguments are your values you want inserted.

Finish writing the code i provided and run it and see what happens. Let us know.

Replies are listed 'Best First'.
Re^8: Writing NULL values to a MySQL record via DBI
by ureco (Acolyte) on Feb 26, 2015 at 23:31 UTC
    Ok, Thanks - really appreciate your help. Need to fix a few other parts of my code before I can run it again - which I'll do tomorrow as it's late here! I'll update the code with that you have written and let you know - Thanks again.
      You are welcome. Thank you in return for simply having the desire to write more secure (and maintainable) code. :)

      If you have more questions i recommend starting a new thread tomorrow, and reference this one to let others know what advice has been given so far. Good luck!

        It worked, :o) the values that are not defined in the CSV file are now being written as NULL's in the database. Huge thanks, I need to read up on what exactly the second variable (containing the undef) is doing, I think I get the rest of it, but most of the simple examples only show a like for like match on the placeholders to the variables. But, that is for additional knowledge - my immediate problem is resolved.

Log In?
Username:
Password:

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

How do I use this?Last hourOther CB clients
Other Users?
Others chilling in the Monastery: (5)
As of 2024-03-28 13:03 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found