CGI/Perl Guide | Learning Center | Forums | Advertise | Login
Site Search: in

  Main Index MAIN
INDEX
Search Posts SEARCH
POSTS
Who's Online WHO'S
ONLINE
Log in LOG
IN

Home: Perl Programming Help: Intermediate:
connecting to database

 



anupma_83
New User

Dec 30, 2009, 1:56 AM

Post #1 of 2 (621 views)
connecting to database Can't Post

Hi,

I am new to perl. I need to create a perl script that will connect to database and run the sql file to fetch the data and then to put that data in some txt file. I have some sample perl script that r being used in my project. I ned to create new scripts similer to them. In the sample perl script to connect to the sql server DBI is not being used. They are using something like as follows:

system "$MSSQL_OSQL -U$USRNAME -P$PSWNAME -S$SVRNAME -d$DBNAME -l 120 < $SQL > $OUT";

where,

MSSQL_OSQL : is some directory path in microsoft sql server

USR : user name

PSWNAME : pwd

SVRNAME : srvr name

DBNAME : database name

SQL and OUT : path to some sql and output file.

But i am not able to understand that how it wud work?

when i am trying to run my script it gives error :

"path for MSSQL_OSQL " is not recognized as an internal or external command,
operable program or batch file.

please guide me ...


FishMonger
Veteran / Moderator

Dec 30, 2009, 4:58 AM

Post #2 of 2 (615 views)
Re: [anupma_83] connecting to database [In reply to] Can't Post

Perl's DBI module along with the specific DBD module for the database that you're connecting to is Perl's De facto standard method of doing DB scripting.

http://search.cpan.org/~timb/DBI-1.609/DBI.pm

 
 


Search for (options) Powered by Gossamer Forum v.1.2.0

Web Applications & Managed Hosting Powered by Gossamer Threads
Visit our Mailing List Archives