From: LAVANYA Mukundan <[EMAIL PROTECTED]>
> I am new to perl programming. I am right now involved in
> developing
> cgi pages in perl. The backend is oracle. I want to know how to trap
> SQL codes returned from oracle and redirect my error messages to the
> browser. Right now, in the following piece of code
>
>
> $sql = <<ENDOFSQL;
> INSERT INTO EMP
> (empno,empname,sal,deptno)
> VALUES (303,'ABCD',8000,20)
> ENDOFSQL
>
> my $sth = $dbh->prepare($sql) || die " Error while preparing
> statement for insertion";
> sth->execute || die "Error while executing SQL stmt";
>
> When my SQL fails to execute for some reason, i do not get any
> message. i just get a blank page in my browser. what should i do to
> get the message to display in the browser ??
Try to add
$dbh->{RaiseError} = 1;
above the prepare() call.
Jenda
P.S.: I've some problems with DNS so I am not receiving mails and
http://Jenda.Krynicky.cz is not accessible. I hope everything will be
OK by monday. You may access a mirror of my page at
http://www24.brinkster.com/Jenda/Index.html
=========== [EMAIL PROTECTED] == http://Jenda.Krynicky.cz ==========
There is a reason for living. There must be. I've seen it somewhere.
It's just that in the mess on my table ... and in my brain.
I can't find it.
--- me
--
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]