Beefy Boxes and Bandwidth Generously Provided by pair Networks
No such thing as a small change
 
PerlMonks  

Re: I seek DBI wisdom concerning bind parameters

by SimonPratt (Friar)
on Oct 23, 2015 at 10:42 UTC ( [id://1145745]=note: print w/replies, xml ) Need Help??


in reply to I seek DBI wisdom concerning bind parameters

I agree with previous posters that you have likely snipped the cause of the issue from your example. Is it possible to create a simplified script that demonstrates the problem in a way that doesn't give up restricted information?

Also, just in relation to connecting to your DB, I strongly suggest you use something similar to the following:

my $sqlserver = 'SERVERNAME'; my $sqldb = 'DBNAME'; my $dbs = "dbi:ODBC:Driver=SQL Server;Database=$sqldb;Server=$sq +lserver;Trusted_Connection=yes"; my $dbhandle = DBI->connect($dbs, undef, undef, {RaiseError => 1, Aut +oCommit => 1}) or die DBI->errstr();
That Trusted_Connection=yes means the user account configured to run the script is the one that is used to authenticate and you don't have to store any passwords anywhere. Specifically setting AutoCommit also makes you consciously think about your work-flow. If you're running essentially bulk operations, committing after every statement can severely limit your performance.

Log In?
Username:
Password:

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

How do I use this?Last hourOther CB clients
Other Users?
Others chilling in the Monastery: (3)
As of 2024-04-19 20:23 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found