Thanks Ilya and  Amarnath and all for help, now i can do my func with
DBI, but i have another problem, now i can't use the method "$ary_ref  =
$dbh->selectall_arrayref($statement);". here my test script and my
result , i'm afraid of confuse with reference of array,

###############
 : ARRAY(0x8417c70)
1 : ARRAY(0x8417c88)
2 : ARRAY(0x8417cac)
3 : ARRAY(0x8417cd0)
4 : ARRAY(0x8417cf4)
5 : ARRAY(0x8417d18)
6 : ARRAY(0x8417d3c)
7 : ARRAY(0x8417d60)
8 : ARRAY(0x8417d84)
9 : ARRAY(0x8417da8)
10 : ARRAY(0x8417dcc)
11 : ARRAY(0x843e244)
12 : ARRAY(0x843e268)
13 : ARRAY(0x843e28c)
14 : ARRAY(0x843e2b0)
15 : ARRAY(0x843e2d4)
16 : ARRAY(0x843e2f8)
17 : ARRAY(0x843e31c)
18 : ARRAY(0x843e340)
19 : ARRAY(0x843e364)
......

#######################
my $pointer = &myTest();

foreach (@$pointer) { # Access the entire array.
        print "$i : $$pointer[$i++] \n";
}

sub myTest {
        my $dbh = DBI->connect("dbi:Oracle:", $data_user, $data_pass,
        {
                RaiseError => 1,
                AutoCommit => 0
        }
        ) || die "Database connection not made: $DBI::errstr";

        my $statement = "Select IP From iptab";
        my $ary_ref  = $dbh->selectall_arrayref($statement);

        $dbh->disconnect;
        return ($ary_ref);
}
########################

"Sterin, Ilya" wrote:

> Please read perldoc DBD::Oracle before starting any development with
> this module.
>
> Ilya
>
> > -----Original Message-----
> > From: Vu Van Toan [mailto:[EMAIL PROTECTED]]
> > Sent: Friday, April 05, 2002 12:52 AM
> > To: [EMAIL PROTECTED]
> > Subject: DBI:DBD
> >
> >
> > Hi All,
> > How to execute a stored procedure in ORACLE using DBD::Oracle?
> >
> > pls help me, now i can excute some simple query but i could
> > not execute my procedure by syntax
> >     $dbh->do("EXEC myprotest('aaa',1)");
> >
> > i get the error in log:
> > DBD::Oracle::db do failed: ORA-00900: invalid SQL statement
> > (DBD ERROR:
> > OCIStmtExecute) at ... line 137
> >

Reply via email to