Up Prev Next
From: "Raja Sambamurty" <rajags at hotmail dot com>
Subject: Re: Error when checking
Date: May 26 1998 6:57PM
I don't think the sql line you have with (if exists...) is the problem.
I use this all the time and often end the sub with a $dbh->sql ($sqlcmd)
where sqlcmd actually has the whole "if .." logic in it. I think you
might have some pending results with any of your prior sql commands.
This is another reason I like to use the ->sql command as opposed to
dbexec+dbresults+nextrow combo. my $0.2 worth
>From email@example.com Tue May 26 10:16:21 1998
>Received: from localhost (localhost [127.0.0.1])
> by list.cren.net (8.8.7/8.8.7) with SMTP id MAA28184;
> Tue, 26 May 1998 12:59:32 -0400 (EDT)
>Received: from send1b.yahoomail.com (send1b.yahoomail.com
> by list.cren.net (8.8.7/8.8.7) with SMTP id MAA28110
> for ; Tue, 26 May 1998 12:57:54 -0400 (EDT)
>Received: from [18.104.22.168] by send1b; Tue, 26 May 1998 09:57:24 PDT
>Date: Tue, 26 May 1998 09:57:24 -0700 (PDT)
>From: Rashmi Anand
>Subject: Error when checking "if exists"
>To: SybPerl Discussion List
>Content-Type: text/plain; charset=us-ascii
>X-Listprocessor-Version: 8.2.06 -- ListProc(tm) by CREN
>I am trying to check for the existance of a row and if it exists, send
>an update otherwise, send an Insert statement:
>if exists (select * from ... where ...)
> Update ... where ...
> Insert ...
>and I get the following error:
>DB-Library error: Attempt to initiate a new SQL Server operation with
>I don't think the above SQL is returning any results, and I am not
>expecting any, then why is dblib throwing the above error?
>Any help will be appreciated.
>Thanks in advance
>DO YOU YAHOO!?
>Get your free @yahoo.com address at http://mail.yahoo.com
Get Your Private, Free Email at http://www.hotmail.com