HELP: Need a little help on using PerlV5.003 with a Sybase stored procedure 
Author Message
 HELP: Need a little help on using PerlV5.003 with a Sybase stored procedure


Quote:
>Hi,
>    i'm trying to call a Sybase stored procedure which
>    makes a select and returns a value in the output
>    argument.

>    Here is what i have:

>    Stored procedure:

>    Perl script:
>            -- I'm using CTlib --


>            $dbh->ct_sql($sql_cmd);

>            -- cur_bus_day appears to be null --
>            -- next_row loop also got me nothing --

What I do is the following:

use Sybase::DBlib;
...
my $db = new Sybase::DBlib($user, $passphrase, $server);
$db->dbuse($database) if $db;

    # Do a select.
    my $cmd = <<"go";
select row1, row2 from table1
go


        print("Database returned nothing\n");

Quote:
}

foreach $i (0..$#rows) {
        print("$rows[$i][0]\n",               # print row1
              "$rows[$i][1]\n");      # print row2

Quote:
}

Good luck!

Jim
--

HighWire Press -- Stanford University



Sun, 26 Sep 1999 03:00:00 GMT  
 HELP: Need a little help on using PerlV5.003 with a Sybase stored procedure

Quote:


> >Hi,
> >       i'm trying to call a Sybase stored procedure which
> >       makes a select and returns a value in the output
> >       argument.

> >       Here is what i have:

> >       Stored procedure:

> >       Perl script:
> >               -- I'm using CTlib --



                                                ^^^
Unfortunately for Perl users, the Sybase Transact-SQL syntax for local


into the SQL command string to execute the stored procedure. Try single

Quote:
> >               $dbh->ct_sql($sql_cmd);

                        ^^^^^^
I have not looked closely at ct_sql() in CT-Lib module. But, in the
DB-Lib module, there were separate specific methods to handle stored
procedures, e.g. methods for output parameters, result sets, and return
status.  You may need to re-code the above with the CT-Lib methods to
handle stored procedures.

Quote:

> >               -- cur_bus_day appears to be null --
> >               -- next_row loop also got me nothing --

> What I do is the following:

[SNIP]

> HighWire Press -- Stanford University

-- Bill
-----------------------------------------------------------------------

Tiburon, Inc./3333 Durham-Chapel Hill Blvd Suite E-100/Durham, NC 27707


Mon, 27 Sep 1999 03:00:00 GMT  
 
 [ 2 post ] 

 Relevant Pages 

1. HELP: Need a little help on using PerlV5.003 with a Sybase stored procedure

2. HELP: Need a little help on using PerlV5.003 with a Sybase stored procedure

3. LONG: Req: Help in retrieving values from SQL Server stored procedure using Win32::ODBC

4. DBD::Sybase and stored procedures

5. DBD::Oracle through DBD::Proxy .. stored procedures help

6. DBD::Oracle through DBD::Proxy .. stored procedures help

7. HELP:Oraperl and Stored Procedure

8. Need Help Building Tk402.003 in Linux

9. Executing Stored Procedures using Win32::ODBC

10. Using Embedded SQL vs Stored procedures in Perl DBI?DBD for Oracle

11. stored procedure without using Win32::OLE

12. Sybperl documentation / using stored procedures

 

 
Powered by phpBB® Forum Software