
rivo
New User
Feb 3, 2009, 9:35 AM
Post #5 of 6
(12282 views)
|
Re: [FishMonger] Problem with DBI Link
[In reply to]
|
Can't Post
|
|
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)
|