Beefy Boxes and Bandwidth Generously Provided by pair Networks
Problems? Is your data what you think it is?
 
PerlMonks  

Re: Why does my insert work with DBI but fails with DBIx::Simple?

by Tux (Abbot)
on Feb 18, 2013 at 13:19 UTC ( #1019338=note: print w/replies, xml ) Need Help??


in reply to Why does my insert work with DBI but fails with DBIx::Simple?

While your example might look harmless, are all the records like that? As in, do ALL the lines validate on splitting on ;?

The example line has no quotation (or UTF-8 or embedded newlines), but once it does, reading your source like this is bound to lead to errors - somewhere.

Use Text::CSV_XS or Text::CSV to parse CSV data. Better yet, if you are doing DBI anyway, why not use DBD::CSV to start with?


Enjoy, Have FUN! H.Merijn

Replies are listed 'Best First'.
Re^2: Why does my insert work with DBI but fails with DBIx::Simple?
by karlgoethebier (Prior) on Feb 18, 2013 at 14:10 UTC

    Hi Tux,

    "...are all the records like that?"

    Yes, and i have no influence on it.

    Update:
    "...do ALL the lines validate on splitting on ;?"

    Yes, i had luck ;-)

    "...why not use DBD::CSV to start with?"

    Good question. I didn't know it. It looks good, so i'll give it a try.

    Thank you and best regards, Karl

    «The Crux of the Biscuit is the Apostrophe»

Log In?
Username:
Password:

What's my password?
Create A New User
Node Status?
node history
Node Type: note [id://1019338]
help
Chatterbox?
[stonecolddevin]: erix seems pretty good, i listened to "So Many Roads" and it was nice. Not everyone's cup of tea but this guy can absolutely shred, he and the guy from Mastodon are definitely up there: https://www. youtube.com/watch? v=VzhMkSN9dQc
[erix]: ha, good stuff - loud and fast...
[stonecolddevin]: here's some Mastodon for when you have 13 minutes to have your mind blown: https://www. youtube.com/watch? v=4pvfQtUhtNE
[karlgoethebier]: goes to Brownsville one more time..

How do I use this? | Other CB clients
Other Users?
Others browsing the Monastery: (9)
As of 2017-06-22 21:48 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?
    How many monitors do you use while coding?















    Results (531 votes). Check out past polls.