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:
perl- DBI Oracle connexion trouble

 



fadoua
Novice

Apr 29, 2009, 8:46 AM

Post #1 of 2 (1900 views)
perl- DBI Oracle connexion trouble Can't Post

Hi all,
I try to create a table in Oracle 10g XE R2 through this perl script(i use DBI1.607):

#!/usr/bin/perl -w
use DBI;
use strict;

my $dbh = DBI->connect( "dbi:oracle:XE", system/pwd, {RaiseError => 1, AutoCommit => 0});
or die "database connection not made:", $DBI::errstr, "\n";


print "Creation de la table Regions";
my $SQLCreationTablesRegions = <<"SQL";
CREATE TABLE Regions (
id_region INT NOT NULL ,
cheflieu INT NOT NULL ,
tncc INT NOT NULL ,
ncc VARCHAR( 250 ) NOT NULL ,
nccenr VARCHAR( 250 ) NOT NULL ,
PRIMARY KEY ( id_region )
) COMMENT = 'Les régions 2008 en France';
SQL


$dbh->do($SQLCreationTablesRegions)
or die " Impossible de creer la table Regions\n\n ";

$dbh->disconnect;

but when i execute it i have this error:

Search pattern not terminated at test1.pl line 5.

Can someone help me please i am really stuck here and i don't now how to solve this error


FishMonger
Veteran / Moderator

Apr 29, 2009, 9:20 AM

Post #2 of 2 (1899 views)
Re: [fadoua] perl- DBI Oracle connexion trouble [In reply to] Can't Post

Take the ; semi-colon off of the connect statement; the or die statement is part of that connect statement.

 
 


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

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