in reply to Re: Connecting to Sybase using Win32::ODBC
in thread Connecting to Sybase using Win32::ODBC

I see.....

OK, I tried this;
use DBI; $dsn = 'LNB_HHH_APP'; $user = 'db_analyst'; $password = 'db_pass'; my $data_source = "dbi::Sybase:LNB_HHH_APP"; my $dbh = DBI->connect($data_source, $user, $password)||die "Can't con +nect to $data_source: $DBI::errstr";
and got this in return
Can't connect to data source LNB_HHH_APP, no database driver specified + and DBI_DSN env var not se t at U:\scripts\sybase_test1.pl line 6
any thought? or an example code on how to connect to a sybase database and extract all rows from a query called 'LNB_Qry'?

btw: swapping $data_source with $dsn still didnot resolve my problem.

Replies are listed 'Best First'.
Re^3: Connecting to Sybase using Win32::ODBC
by blackadder (Hermit) on Jun 09, 2004 at 15:38 UTC
    OK,....I changed the following;
    use DBI; $dsn = 'dbi:MDB:LNB_HHH_App'; $user = 'DB_analyst'; $password = 'DB_Pass'; $qry = 'dbo_vfunction_applications'; $dbh = DBI->connect($dsn,$user, $passwd); $ary_ref = $dbh->selectall_arrayref($qry);
    And this what I got back in return;
    DBD::DBM::db selectall_arrayref failed: Couldn't parse! <dbo_vfunction_applications>
    Any advice on how can I extract the data from the query $qry?

    Cheers

    Blackadder
      I thought you also needed to use DBI::ODBC;.

      Also, I suspect that the reason you're getting that error is that "dbo_vfunction_applications" is not SQL. If it is a stored procedure or function, you might need to SELECT or EXEC it. If it is a command of a query analyzer of some sort, it won't work here. My guess would be that you need to EXEC it.

      --
      Spring: Forces, Coiled Again!