How do I call a stored procedure using perl DBI and evaluate the output

From: Evelyn Schwartz via SQLMonster.com (forum_at_SQLMonster.com)
Date: 02/08/05


Date: Tue, 08 Feb 2005 18:40:26 GMT

I'm trying to run sp_dbcmptlevel @dbname='master' from within a perl
script.

What I've tried:

my $sth=$oa->prepare(qq[sp_dbcmptlevel @dbname='master']);
$sth->execute();
while (@row = $sth->fetchrow_array) {
  #do something;
}
$sth->finish();

my $output;
my $sth=$oa->prepare(qq[? = sp_dbcmptlevel @dbname='master']);
$sth->bind_param_inout(1, \$output, 1000);
$sth->execute();

I'm a newbie to sql server so I may be missing something very basic.

-- 
Message posted via http://www.sqlmonster.com


Relevant Pages

  • Re: Returning specific data from a webpage?
    ... Case matters in Perl. ... Please read the posting guidelines for this group. ... actual script itself and so copied and pasted wrong. ... just bash a newbie or find a reason to put them on ignore than help them. ...
    (comp.lang.perl.misc)
  • Recover data with updated transaction Log only
    ... I am newbie in MS SQL Server, today I wrongly run a script to clear all data of a table, and the backup is one month ago. ...
    (microsoft.public.sqlserver.server)
  • Re: working example File::Taill
    ... > As a newbie to perl i have problems to get the following script to run ... Thank you for using strict! ... The error messages are because you need to explicitly tell Perl what the ...
    (comp.lang.perl.misc)
  • GD::Graph isnt numeric etc.
    ... using RRDs, Mysql and GD while being a very very newbie in perl.. ... The lines in the script are: (I know the sed lines look a 'bit' newbie-like ...
    (comp.lang.perl.modules)
  • Re: working example File::Taill
    ... > As a newbie to perl i have problems to get the following script to run ... I'm fairly new to perl but I believe you should add the line: ... to declare your variables (since you use strict). ...
    (comp.lang.perl.misc)