Home: Perl Programming Help: DBI:
trouble whith execute(): ORA-00900



fadoua
Novice

Jun 4, 2009, 11:25 AM


Views: 6911
trouble whith execute(): ORA-00900

Hi all,

I try to execute a select query with this script:

#!/usr/bin/perl -w
use DBI;
use strict;
use warnings;
my $Bdd = "DBI:Oracle:XE";
my $User = "system";
my $Pass = "espoirvolonte";
my $SEL = "SELECTE * FROM mouvement";


my %attr = ( PrintError => 0, RaiseError => 1 );


my $dbh = DBI->connect($Bdd, $User, $Pass, \%attr)
or die "database connection not made:", $DBI::errstr, "\n";

my $sth = $dbh->prepare($SEL);
$sth->execute();
while(my $ref = $sth->fetchrow_hashref())
{
print "ID_Environnement: $ref->{'ID_MOUVEMENT'}\nLibelle_oper: $ref->{'LIBELLE_OPER'}\nDate_oper: $ref->{'DATE_OPER'}\n\n";
}

$dbh->disconnect;


but i get this error:
DBD::Oracle::st execute failed: ORA-00900: invalid SQL statement (DBD ERROR: OCIStmtExecute) [for Statement "SELECTE * FROM mouvement"] at test1.pl line 18.

if someone have an idea please, i really need it.

thank you in advance


FishMonger
Veteran / Moderator

Jun 4, 2009, 11:51 AM


Views: 6909
Re: [fadoua] trouble whith execute(): ORA-00900

You have a typo

change
my $SEL = "SELECTE * FROM mouvement";

to
my $SEL = "SELECT * FROM mouvement";


fadoua
Novice

Jun 4, 2009, 4:08 PM


Views: 6903
Re: [FishMonger] trouble whith execute(): ORA-00900

Thank you, I really didn't pay attention

my script work well now

Best regards