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:
Execute Procedure in Perl

 



sreedhargudur
New User

Mar 15, 2003, 3:20 PM

Post #1 of 2 (2619 views)
Execute Procedure in Perl Can't Post

Hi,

I am very new to this perl script and I need to solve this problem with in 2 days.

So Can any one let me know the syntax's of perl to execute a procedure.

The procedure does updating the values into table.

proedure name: update_lang_iso_char_set.sql

In perl I have written the code to initialize the database connection.

use DBI;

$dbh = undef;
$dbh = DBI->connect(
"dbi:Sybase" .
":interfaces=" . $ENV{'SYBASE'} . '/interfaces' .
";server=" . $ENV{'BV_DB_SERVER'} .
";database=" . $ENV{'BV_DB_DATABASE'} .
";hostname=" . $ENV{'HOSTNAME'} .
";scriptName=convTrans.pl" ,
$ENV{'BV_DB_USER'},
$ENV{'BV_DB_PASSWD'},
{ PrintError => 1, AutoCommit => 1 } );

if (!$dbh) {
die "Connection to DBMS could not be established";
exit 1;
}


@sql = update_lang_iso_char_set.sql;

dbh->do(@sql);

It is giving error and the sql file is stored under same path.

Thanks in advance,

Sreedhar


Jasmine
Administrator / Moderator

Mar 26, 2003, 7:57 AM

Post #2 of 2 (2610 views)
Re: [sreedhargudur] Execute Procedure in Perl [In reply to] Can't Post

Looks like the problem's here:

@sql = update_lang_iso_char_set.sql;

You need to open the update_lang_iso_char_set.sql file , put its contents into a variable and then execute it.

 
 


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

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