Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Chris Miller on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Execute SQL 2000 Stored Procedure from Perl

Status
Not open for further replies.

BobWeston

Programmer
Mar 18, 2002
13
US
Hello!
I'm trying to figure out how I can execute a call to a Stored Procedure on our remote SQL Server 2000 box within a Perl script on a Linux box (if it helps, running Samba).

The script would need to pass a username variable to the procedure and receive a numeric output variable for later use in the Perl script.

I've googled the subject and only found examples related to PHP. This particular Perl script will be executed from within a shell script.

Any guidance would be appreciated.

Thanks,

Bob
 
How would you execute this from a command line (or is it possible from the command line)

--Paul

It's important in life to always strike a happy medium, so if you see someone with a crystal ball, and a smile on their face ...
 
Paul,
From a windows environment, I'd use isql.exe from command line to connect to the SQL Server. From Linux, I'm not sure. This will be my first go at it.

Thanks,

Bob
 
You could use Net::Telnet to login into the NT console, run the isql from there. You'll most likely have to start the telnet service on the NT/XP box though and it'll send stuff clear text, so that could be an issue.

Dunno if there's an SSH service to run on NT, most likely there is.

Could you set up the stored procedure as a trigger, associated with a query to a dummy table, and just send the query (Dunno if this'll work if you're expecting output back, and not just fire the SP)


HTH
--Paul



It's important in life to always strike a happy medium, so if you see someone with a crystal ball, and a smile on their face ...
 
I'm not sure the ODBC layer will allow you to fire Stored procedures?

--Paul

It's important in life to always strike a happy medium, so if you see someone with a crystal ball, and a smile on their face ...
 
Bob,
Don't have time to look at these now

Let us know hoe you get on

--Paul

It's important in life to always strike a happy medium, so if you see someone with a crystal ball, and a smile on their face ...
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top