Results 1 to 3 of 3
  1. #1
    Join Date
    Dec 2013
    Posts
    14

    Unanswered: How to execute stored procedure in perl

    Hi All

    i am trying to run a stored procedure in perl.
    #!/usr/bin/perl
    use strict;
    use Data:umper;

    my $dataserver=$ARGV[0];
    my $username=$ARGV[1];
    my $pass=$ARGV[2];

    if(@ARGV < 1)
    {

    print "Usage :\n";
    print " ./test.pl dataserver username pass\n";
    exit;
    }

    my $result = qx { isql -U$username -S$dataserver -P$pass -s"," -b <<EOF

    set nocount on
    sp_monitorconfig "all"
    go
    exit
    EOF
    };

    print $result;

    It throws an error.
    Incorrect syntax near 'sp_monitorconfig'.
    Any ideas , as to how i can run a sp commands in this script.
    Help is appreciated.

    Thanks

  2. #2
    Join Date
    Jan 2012
    Location
    Lisbon
    Posts
    115
    Provided Answers: 1
    Hi,
    Hi there,

    You are missing a go.

    set nocount on
    go
    sp_monitorconfig "all"
    go

  3. #3
    Join Date
    Dec 2013
    Posts
    14
    thanks for the reply.

    i believe that was not the problem.
    i had to use exec in front of the stored procedure.

    /* exec sp_monitorconfig "all" */

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •