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

  Main Index MAIN
INDEX
Search Posts SEARCH
POSTS
Who's Online WHO'S
ONLINE
Log in LOG
IN

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

 



fadoua
Novice

Jun 4, 2009, 11:25 AM

Post #1 of 3 (3460 views)
trouble whith execute(): ORA-00900 Can't Post

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

Post #2 of 3 (3458 views)
Re: [fadoua] trouble whith execute(): ORA-00900 [In reply to] Can't Post

You have a typo

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

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


fadoua
Novice

Jun 4, 2009, 4:08 PM

Post #3 of 3 (3452 views)
Re: [FishMonger] trouble whith execute(): ORA-00900 [In reply to] Can't Post

Thank you, I really didn't pay attention

my script work well now

Best regards

 
 


Search for (options) Powered by Gossamer Forum v.1.2.0

Web Applications & Managed Hosting Powered by Gossamer Threads
Visit our Mailing List Archives