Jeff,

So, assuming sp_foo takes no paramters, my whole script could be:

#####################
use DBI;
        my $dbh = DBI->connect('DBI:ODBC:OSTDB', 'user', 'password')
                or die "Couldn't connect to database: " . DBI->errstr;
 
{call sp_foo}


#####################


Rgds,

Brien


-----Original Message-----
From: Jeff Urlwin
To: Brien Pirkle; [EMAIL PROTECTED]
Sent: 28/11/02 14:55
Subject: RE: Calling SQLServer Stored Procedures


> 
> How can I execute a SQL Server stored proc from my Perl script?  
> The Cheeta
> book (DBD::ODBC Driver pg 296) suggests using the following ODBC
escape
> sequence:
> 
> {call procedure1_name}
> 
> Fine.  But what's the rest of the syntax?

Err, that is the syntax.  If your procedure name is sp_foo, then:
        {call sp_foo}

If your procedure takes parameters:

        {call sp_foo(1, 2, 3)}

etc.

> 
> My platform is NT, ActivePerl 633...database is SQLServer2000.
> 

Jeff

CONFIDENTIALITY AND DISCLAIMER NOTICE 

The information contained in this e-mail and any attachments 
is confidential and intended for the addressee only and may 
be protected by copyright.  Copying or forwarding any part of 
this e-mail is prohibited. If you have received this e-mail in 
error please delete it and notify us by telephone or return 
e-mail immediately. Any views or opinions contained in 
this message are solely those of the sender and do not 
necessarily represent those of Microgen-OST Limited. 
We advise you to carry out your own virus check before 
opening any attachments as we do not accept liability for 
any damage sustained as a result of any software viruses.

Microgen-OST Limited registered address: 
11, Park Street, 
Windsor, 
Berkshire 
SL4 1LU 

Company Registration No 3475849 

Reply via email to