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

How to prepare a file for insert into MSSQL

by myuserid7 (Scribe)
on May 15, 2007 at 19:14 UTC ( #615625=perlquestion: print w/replies, xml ) Need Help??

myuserid7 has asked for the wisdom of the Perl Monks concerning the following question:

I have dbi,Sybase,freetds setup and have no problem inserting text into MSSQL (SQL 2000).

I have a file on the filesystem, how do I prepare this file to be inserted into MSSQL?

Does the answer lie somewhere in binmode and pack?
  • Comment on How to prepare a file for insert into MSSQL

Replies are listed 'Best First'.
Re: How to prepare a file for insert into MSSQL
by thezip (Vicar) on May 15, 2007 at 19:58 UTC

    myuserid7,

    As an aside, I also have a FreeBSD box that has the same sort of setup as you have (DBI, DBD::Sybase, FreeTDS, connecting to MS SQL Server 2000). You've probably noticed that placeholders (?) are NOT supported in this configuration, so don't exert any effort towards this end.

    (Granted, I researched this over seven months ago, so the status may have changed since then...)


    Where do you want *them* to go today?
Re: How to prepare a file for insert into MSSQL
by EvanCarroll (Chaplain) on May 15, 2007 at 19:38 UTC
    I'm not sure what your question is, but you use binmode if you are reading in a non-text-file, and you use pack to prepare to write a data structure in a specified format. I'm guessing you need binmode, and not pack.

    You probably more want to look into $sth->bind_param, as some DBDs require you to manually bind them to use blob functionality. Run a quick google for Sybase, and blob.


    Evan Carroll
    www.EvanCarroll.com

Log In?
Username:
Password:

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

How do I use this? | Other CB clients
Other Users?
Others studying the Monastery: (4)
As of 2023-05-31 15:38 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found

    Notices?