Calling a SQL Server Stored Procedure from within Perl
- From: ab <absmienk@xxxxxxxxxxx>
- Date: Wed, 21 Nov 2007 07:41:52 -0800 (PST)
Hi,
I'm trying to call a simple Stored Procedure from within my Perl
script. I tested the SP named "usp_test" in the Query Analyzer and it
ran OK. My perl script looks like this
use Win32::ODBC;
if (!($MyDB = new Win32::ODBC("DSN=MyDSN;UID=MyLoginID;PWD=MyPwd;")))
{
print "Error: Unable to connect to the database\n";
exit;
}
The connection is OK, I've tested it by listing all the rows in a test
table. Now I have to call the SP. I tried something like this but that
didn't work:
my $sth = $MyDB -> prepare("EXEC usp_test");
$sth -> execute;
Any information is welcome.
Thanks,
Ab
.
- Follow-Ups:
- Prev by Date: Re: is there any command for catch in tcl in perl
- Next by Date: Re: list context inside term
- Previous by thread: is there any command for catch in tcl in perl
- Next by thread: Re: Calling a SQL Server Stored Procedure from within Perl
- Index(es):
Relevant Pages
|