SQL Clone
SQLServerCentral is supported by Redgate
 
Log in  ::  Register  ::  Not logged in
 
 
 


Connecting With Perl Using Win32 : ODBC


Connecting With Perl Using Win32 : ODBC

Author
Message
Nik Ansell
Nik Ansell
Grasshopper
Grasshopper (11 reputation)Grasshopper (11 reputation)Grasshopper (11 reputation)Grasshopper (11 reputation)Grasshopper (11 reputation)Grasshopper (11 reputation)Grasshopper (11 reputation)Grasshopper (11 reputation)

Group: General Forum Members
Points: 11 Visits: 1

Great article, very comprehensive.

However I have found there are memory leaks with the Win32:DBC module.

After spending a great deal of time trying checking my code for objects/variables not destoyed in subs I ended up using Perl DBI.

I have found this very useful and would recommend others trying this module to see which they prefer.


Roger L Reid
Roger L Reid
SSC-Enthusiastic
SSC-Enthusiastic (198 reputation)SSC-Enthusiastic (198 reputation)SSC-Enthusiastic (198 reputation)SSC-Enthusiastic (198 reputation)SSC-Enthusiastic (198 reputation)SSC-Enthusiastic (198 reputation)SSC-Enthusiastic (198 reputation)SSC-Enthusiastic (198 reputation)

Group: General Forum Members
Points: 198 Visits: 166

Perl is very much for the administrator and developer and not for the end user. It has a prominent place in the toolbox, but it's not for end users.

My one criticism of the article is, as with most SQL Server script examples, it has a password hard coded in, in plain text. No wonder the young folk all think that's perfectly acceptable! DBAs kill themselves setting up least privelege and "useless by default", and then here are these plain text passwords in the code - or worse, on the command line!

Aside from that, let me mention DBI:Sybase (and perhaps, Sybperl).

If you are connecting from a non-Windows box, the Win32 module won't do you a bit of good. Or, if you come from a database background instead of a Windows background, you might be more comfortable with db-lib than ODBC. In that case, the DBI:Sybase modules are the way to go.

The trick is to compile with the FreeTDS libraries instead of the Microsoft or the Sybase libraries, and you can talk to anything that uses a TDS stream from a single binary.

Roger Reid



Roger L Reid
K. Brian Kelley
K. Brian Kelley
Keeper of the Duck
Keeper of the Duck (10K reputation)

Group: Moderators
Points: 10210 Visits: 1917
Keep in mind, though, that in writing articles, you focus on the technology that the article is primarily about. While I agree with you about securing the connection string, the truth of it is that with respect to this article it's a rabbit trail. Explaining why it's an issue and various ways to secure the connection string would double the length of the present article, if not more. In the mean time, the focus on using Perl to connect to SQL Server is lost.

K. Brian Kelley
@‌kbriankelley
Josh Blair
Josh Blair
Grasshopper
Grasshopper (18 reputation)Grasshopper (18 reputation)Grasshopper (18 reputation)Grasshopper (18 reputation)Grasshopper (18 reputation)Grasshopper (18 reputation)Grasshopper (18 reputation)Grasshopper (18 reputation)

Group: General Forum Members
Points: 18 Visits: 48
Brian,

Thanks for article. I am a complete Perl newbie and was able to take the samples and article content and successfully query data from my legacy ERP system in about 10 minutes. Thanks very much. Looking forward to your upcoming articles.

Josh Blair
Go


Permissions

You can't post new topics.
You can't post topic replies.
You can't post new polls.
You can't post replies to polls.
You can't edit your own topics.
You can't delete your own topics.
You can't edit other topics.
You can't delete other topics.
You can't edit your own posts.
You can't edit other posts.
You can't delete your own posts.
You can't delete other posts.
You can't post events.
You can't edit your own events.
You can't edit other events.
You can't delete your own events.
You can't delete other events.
You can't send private messages.
You can't send emails.
You can read topics.
You can't vote in polls.
You can't upload attachments.
You can download attachments.
You can't post HTML code.
You can't edit HTML code.
You can't post IFCode.
You can't post JavaScript.
You can post emoticons.
You can't post or upload images.

Select a forum

































































































































































SQLServerCentral


Search