On 28 Nov 2003 01:44:26 GMT
(Sam Holden) wrote:
> On Thu, 27 Nov 2003 20:21:00 -0500, Steve <>
> wrote:
> > Well I thought Memory allocation was by perl.
> > anyway here is the code, it fails on line 2 and dies on line 6
> >
> > $SqlString ="Select viewcontent from NewProfile where ID='Prof2'
> > and CUSTID='sandy' ";
> > if(($dbh->Sql( $SqlString )))
> > {
> > $ErrMsg = 'SQL-Err:'.$dbh->Error();
> > print "SQL ERR on: $SqlString $ErrMsg <BR>";
> > die
You have a 'die' statment by itself. Every time you enter this part
of the 'if' loop, the script will die. It's better to do something
like:
die "An error occured\nSQL: $SqlString\nError: ",$dbh->Error(),"\n"
unless ($dbh->Sql($SqlString));
I'll leave it up to you to find a good place to put this line. I can
tell you that this should remove the need for an if loop.
Go back and read the docs more closely
HTH
--
Jim
Copyright notice: all code written by the author in this post is
released under the GPL.
http://www.gnu.org/licenses/gpl.txt
for more information.
a fortune quote ...
The typewriting machine, when played with expression, is no more
annoying than the piano when played by a sister or near relation.
-- Oscar Wilde