Beefy Boxes and Bandwidth Generously Provided by pair Networks
Pathologically Eclectic Rubbish Lister
 
PerlMonks  

Re: DBD::ODBC insert first line, but not line 2

by jfroebe (Parson)
on Oct 06, 2015 at 19:42 UTC ( [id://1143970]=note: print w/replies, xml ) Need Help??


in reply to DBD::ODBC insert first line, but not line 2

The data type for at least one field is too small for the data you're trying to import. In your code, verify the data type (and length) with the data you're trying to import before you attempt to insert it.

On a side note, why aren't you just using bcp to import your csv file? Insert statements are far slower than bcp.

Jason L. Froebe

Tech Blog

  • Comment on Re: DBD::ODBC insert first line, but not line 2

Replies are listed 'Best First'.
Re^2: DBD::ODBC insert first line, but not line 2
by ksublondie (Friar) on Oct 06, 2015 at 20:11 UTC
    The data type for at least one field is too small for the data you're trying to import. In your code, verify the data type (and length) with the data you're trying to import before you attempt to insert it.

    I've done that. All columns are varchar(50), date, or decimal(18,2) and I've tested the command in sql management studio and line 1 inserts, but not line 2. I've included the actual data being passed (in the form of the print output) in my OP.

    ...why aren't you just using bcp to import your csv file?

    Because this was SUPPOSED to be a quick script to get going. I have an existing script somewhere else on another server. Theoretically, I should just be able to copy/paste, change a few variables, and done. But no.

Log In?
Username:
Password:

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

How do I use this?Last hourOther CB clients
Other Users?
Others imbibing at the Monastery: (6)
As of 2024-04-19 08:02 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found