Oracle FAQ Your Portal to the Oracle Knowledge Grid
HOME | ASK QUESTION | ADD INFO | SEARCH | E-MAIL US
 

Home -> Community -> Usenet -> c.d.o.server -> Perl & Oracle

Perl & Oracle

From: Jack Zhu <jackzhu_at_qwestinternet.net>
Date: 08 Dec 1999 21:27:29 EST
Message-ID: <82n42h$q92@chronicle.concentric.net>


Oracle 8.0.5 on RedHat 6.0, Perl with DBD & DBI. All of them work well except Perl with DBD & DBI.

  1. My Perl test script is very simple:

#!/usr/bin/perl
use DBI;
$data_source = "dbi:Oracle:orcl"; # orcl is ORACLE_SID, and listener name.
Only one instance exists.
$user = "user";
$password = "pass";
$dbh = DBI->connect($data_source, $user, $password,{RaiseError=>1,
AutoCommit=>0}) or die "Unable to connect: $DBI::errstr";
$mth = $dbh->prepare('select one_column from one_table');
$mth->execute();
$mth=$dbh->disconnect;

The error is like "No EXECUTE function exists". What's wrong?

2. Try to use SYSTEM function
Table A ( ID number(3))

perl like:
$myID = 123;

system('sqlplus -s user/pass @sql');

In sql script, I use

Insert into tableA values($myID); commit; exit

Of course it doesn't work. What's wrong? And I change to values('$myID'), still doesn't work. Oracle complain it's invalid number. How can I deal with number in this situation?

3) Shell script is much much better than Perl, for Oracle job. And are there any Perl Oarcle interface book? Any help from web? No help at all, is my situation. almost give up.

Thanks for any reponse!!!!!!!!! Email me is better. Received on Wed Dec 08 1999 - 20:27:29 CST

Original text of this message

HOME | ASK QUESTION | ADD INFO | SEARCH | E-MAIL US