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

  Main Index MAIN
Search Posts SEARCH
Who's Online WHO'S
Log in LOG

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

New User

Feb 3, 2009, 9:35 AM

Views: 7234
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=', # 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 );

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";



-- end of script

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

SELECT dbi_link.make_accessor_functions(
AutoCommit: 1
RaiseError: 1

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