CGI/Perl Guide | Learning Center | Forums | Advertise | Login
Site Search: in

  Main Index MAIN
INDEX
Search Posts SEARCH
POSTS
Who's Online WHO'S
ONLINE
Log in LOG
IN

Home: Perl Programming Help: DBI: Re: [FishMonger] Problem with DBI Link: Edit Log



rivo
New User

Feb 3, 2009, 9:35 AM


Views: 6889
Re: [FishMonger] Problem with DBI Link

I have a perl script, used to test if DBI Link works on perl, and yes, it works, see the script below:

#!/usr/bin/env perl
use strict;
use warnings;

use DBI;

my $dbh = DBI->connect(
'dbi:Oracle:sid=veides2;host=172.25.136.85', # Connection info
'abc', # User
'def', # Password
{
AutoCommit => 1,
RaiseError => 1,

}
) or die "Could not connect to Oracle: $DBI::errstr";

my $sql = qq{ SELECT * FROM emilio.locadora WHERE ano_fab = 2005 };
my $sth = $dbh->prepare( $sql );
$sth->execute();

my( $cod_placa, $num_cnpj, $dsc_marca, $dsc_tipo, $ano_fab, $dat_alter );
$sth->bind_columns( undef, \$cod_placa, \$num_cnpj, \$dsc_marca, \$dsc_tipo, \$ano_fab, \$dat_alter );

while( $sth->fetch() ) {
print "$cod_placa, $dsc_marca, $ano_fab\n";
}

$sth->finish();

$dbh->disconnect();

-- end of script

but the sql file that I want to run in postgres not works

SELECT dbi_link.make_accessor_functions(
'dbi:Oracle:sid=veides2;host=172.25.136.85'::dbi_link.data_source,
'abc'::text,
'def'::text,
'---
AutoCommit: 1
RaiseError: 1
'::dbi_link.yaml,
NULL::dbi_link.yaml,
NULL::text,
NULL::text,
'veides2'::text
);

and excuse my english, but I dont speak english very well


(This post was edited by rivo on Feb 3, 2009, 9:36 AM)


Edit Log:
Post edited by rivo (New User) on Feb 3, 2009, 9:36 AM


Search for (options) Powered by Gossamer Forum v.1.2.0

Web Applications & Managed Hosting Powered by Gossamer Threads
Visit our Mailing List Archives