vk,

I routinely use this syntax in perl scripts to call SQL Server 2000 stored
procedures that accepts parameters (error checking deliberately omitted): 

$query = "{ call your_sp($param1, $param2, $param3) }";
$sel = $dbh->prepare( $query );

Hope helpful,

Elliot

Elliot M. Fielstein, Ph.D.
Assistant Professor of Psychiatry
and
Fellow in Biomedical Informatics
Vanderbilt University School of Medicine


-----Original Message-----
From: v79k [mailto:[EMAIL PROTECTED]
Sent: Tuesday, April 20, 2004 11:46 AM
To: [EMAIL PROTECTED]
Subject: Syntax for calling stored procedure from Perl Script


Hi, 
My Perl script connects to the database(SQL Server
2000) and queries it. Also updates a column.
It works fine but now I have to do it with stored
procedures. I created the stored procedures
but am unsure of the syntax to call it from Perl
script. The procedure takes in one parameter, 
a perl variable say $x.

I even tried without paramaters but in either case get
the following error.

my $query = $dbh->prepare("{call procedureName ($x)
}");
 $query->execute(); # Execute SQL Query!

Error: Incorrect syntax near '{'...


I must pass parameters to the stored procedure. the
procedure exists in the database.

Any help/comments are appreciated.

Thanks,
vk


        
                
__________________________________
Do you Yahoo!?
Yahoo! Photos: High-quality 4x6 digital prints for 25¢
http://photos.yahoo.com/ph/print_splash

Reply via email to