From: "Ryoji Watahiki" <[EMAIL PROTECTED]>
To: <[EMAIL PROTECTED]>
Sent: Thursday, April 18, 2002 21:59
Subject: How to Control of Triiger on Web


> My name is Ryoji Watahiki .
> I  work for Japanease company.
> I have been developed  Intranet Web system by 
>Perl+DBD:DBI 
Oracle.
> I  want to control  of enable or disable of Trigger on Web.
> I  tried  below  this ,but it could not work well.
>
> ==================================
> $enb_trg ="alter trigger test_trg enable";
> $dbh->do("enb_trg");
> ==================================

You are trying to execute the literal string "enb_trg" which is not legal
SQL.  What you want in this case is:

$dbh -> do( $enb_trg ); # Note: No quotes (").

> In case of another DDL sentence, does it well.
>
> ==================================
> $crt_seq ="create sequence testseq";
> dbh->do("$crt_seq") ;
> ==================================

In this case you are executing the SQL in $crt_seq.  Note that the "" around
$crt_seq are not necessary.

Make sure you have $dbh->{RaiseErrors} = 1.
--
Mac :})
** I normally forward private questions to the appropriate mail list. **
Ask Smarter: http://www.tuxedo.org/~esr/faqs/smart-questions.html
Give a hobbit a fish and he eats fish for a day.
Give a hobbit a ring and he eats fish for an age.

Reply via email to