Beefy Boxes and Bandwidth Generously Provided by pair Networks
Perl: the Markov chain saw

Re: mssqlserver dsn

by Rhose (Priest)
on Mar 24, 2003 at 21:58 UTC ( #245554=note: print w/replies, xml ) Need Help??

in reply to mssqlserver dsn

Not exactly the answer to your question, but here is some concept code I left in my temp directory which might help.
#/usr/bin/perl -w use strict; use DBI; my $DSN = 'dbi:ODBC:driver={SQL Server};server={myserver};database={my +db}'; my $dbh = DBI->connect($DSN, undef, undef) or die "$DBI::errstr\n"; my $gSQLCmd = 'SELECT col1, col2, col3 FROM mytable'; my $gSQLHandle = $dbh->prepare ( $gSQLCmd ) || die 'Error with SQL statement ['.$DBI::errstr.' - '.$DBI::err.' +]'; $gSQLHandle->execute() || die 'Error with SQL statement ['.$DBI::errst +r.' - '.$DBI::err.']'; while (my @gFields = $gSQLHandle->fetchrow_array) { print 'Row: ',$gFields[0],"\t",$gFields[1],"\t",$gFields[2],"\n"; } $dbh->disconnect;

The code will work a little better if you replace myserver, mydb, and mytable with ones from your actual system. *Smiles* Also, please note that this code connects to the database without a userid or password -- it is using my domain account for authorization.

Update I forgot to give credit where credit is due -- my code is based on the information from DBD::ODBC Connecting without DSN from Win32 by sparkyichi

Log In?

What's my password?
Create A New User
Node Status?
node history
Node Type: note [id://245554]
[choroba]: RonW Yes, but then, one day, they needed to switch from FTP to SFTP, and... but I can't give the whole talk away here :)
[RonW]: Tunnel FTP through stunnel?
[james28909]: i guess i should have done it in perl. i bet it woulnt have taken me 5 hours to figure out haha
[choroba]: In the end, I was able to upgrade Perl from 5.8.3 to 5.22 and install Net::SFTP::Foreign , at least for the task involved
[james28909]: what would be the best way to capture that stream with perl? ffmpeg args -rtp rtp://
[LanX]: if I was forced to talk about all security risks I encountered oO

How do I use this? | Other CB clients
Other Users?
Others examining the Monastery: (11)
As of 2017-05-22 21:45 GMT
Find Nodes?
    Voting Booth?