Sybase NNTP forums - End Of Life (EOL)

The NNTP forums from Sybase - forums.sybase.com - are now closed.

All new questions should be directed to the appropriate forum at the SAP Community Network (SCN).

Individual products have links to the respective forums on SCN, or you can go to SCN and search for your product in the search box (upper right corner) to find your specific developer center.

Reset ads_error()?

6 posts in PHP Last posting was on 2011-08-08 18:12:37.0Z
Christian Schröder Posted on 2011-07-22 12:32:47.0Z
From: =?iso-8859-1?Q?Christian_Schr=F6der?= <schroeder@advantex.de>
Newsgroups: Advantage.PHP
Subject: Reset ads_error()?
Date: Fri, 22 Jul 2011 14:32:47 +0200
Lines: 1
MIME-Version: 1.0
Content-Type: text/plain; format=flowed; charset="iso-8859-1"; reply-type=original
Content-Transfer-Encoding: 7bit
X-Priority: 3
X-MSMail-Priority: Normal
Importance: Normal
X-Newsreader: Microsoft Windows Live Mail 15.4.3508.1109
X-MimeOLE: Produced By Microsoft MimeOLE V15.4.3508.1109
NNTP-Posting-Host: 2.202.107.185
Message-ID: <4e296de9@solutions.advantagedatabase.com>
X-Trace: 22 Jul 2011 05:32:41 -0700, 2.202.107.185
Path: solutions.advantagedatabase.com
Xref: solutions.advantagedatabase.com Advantage.PHP:1133
Article PK: 1135617

Hi,

after executing a script via ads_do() I want to check if everything is ok by
checking if ads_error() is empty. This works perfectly until the first error
appears. From that time always the last error is displayed, it does not
reset when a script was executed without an error.

Does anyone have a solution for that? Or did I just misunderstand the
ads_error() function?

Regards,
Christian


Edgar Sherman Posted on 2011-07-22 17:19:04.0Z
Date: Fri, 22 Jul 2011 11:19:04 -0600
From: Edgar Sherman <no@email.com>
User-Agent: Mozilla/5.0 (Windows; U; Windows NT 6.1; en-US; rv:1.9.2.18) Gecko/20110616 Thunderbird/3.1.11
MIME-Version: 1.0
Newsgroups: Advantage.PHP
Subject: Re: Reset ads_error()?
References: <4e296de9@solutions.advantagedatabase.com>
In-Reply-To: <4e296de9@solutions.advantagedatabase.com>
Content-Type: text/plain; charset=ISO-8859-1; format=flowed
Content-Transfer-Encoding: 8bit
NNTP-Posting-Host: 10.6.193.121
Message-ID: <4e29b100$1@solutions.advantagedatabase.com>
X-Trace: 22 Jul 2011 10:18:56 -0700, 10.6.193.121
Lines: 18
Path: solutions.advantagedatabase.com
Xref: solutions.advantagedatabase.com Advantage.PHP:1134
Article PK: 1135618

I would guess this is a bug based on the documentation. I was able to
reproduce the behavior and I can give to the R&D team.

Edgar

On 7/22/2011 6:32 AM, Christian Schr?der wrote:
> Hi,
>
> after executing a script via ads_do() I want to check if everything is
> ok by checking if ads_error() is empty. This works perfectly until the
> first error appears. From that time always the last error is displayed,
> it does not reset when a script was executed without an error.
>
> Does anyone have a solution for that? Or did I just misunderstand the
> ads_error() function?
>
> Regards,
> Christian


Christian Schröder Posted on 2011-07-26 14:07:13.0Z
From: =?iso-8859-1?Q?Christian_Schr=F6der?= <schroeder@advantex.de>
Newsgroups: Advantage.PHP
References: <4e296de9@solutions.advantagedatabase.com> <4e29b100$1@solutions.advantagedatabase.com>
In-Reply-To: <4e29b100$1@solutions.advantagedatabase.com>
Subject: Re: Reset ads_error()?
Date: Tue, 26 Jul 2011 16:07:13 +0200
Lines: 2
MIME-Version: 1.0
Content-Type: text/plain; format=flowed; charset="iso-8859-1"; reply-type=response
Content-Transfer-Encoding: 8bit
X-Priority: 3
X-MSMail-Priority: Normal
Importance: Normal
X-Newsreader: Microsoft Windows Live Mail 15.4.3508.1109
X-MimeOLE: Produced By Microsoft MimeOLE V15.4.3508.1109
NNTP-Posting-Host: 212.125.97.122
Message-ID: <4e2ec9ff$1@solutions.advantagedatabase.com>
X-Trace: 26 Jul 2011 07:06:55 -0700, 212.125.97.122
Path: solutions.advantagedatabase.com
Xref: solutions.advantagedatabase.com Advantage.PHP:1135
Article PK: 1135619

Thank you Edgar. Do you (or someone else) have an idea for a workaround?

Christian


"Edgar Sherman" schrieb im Newsbeitrag
news:4e29b100$1@solutions.advantagedatabase.com...

I would guess this is a bug based on the documentation. I was able to
reproduce the behavior and I can give to the R&D team.

Edgar

On 7/22/2011 6:32 AM, Christian Schr?der wrote:
> Hi,
>
> after executing a script via ads_do() I want to check if everything is
> ok by checking if ads_error() is empty. This works perfectly until the
> first error appears. From that time always the last error is displayed,
> it does not reset when a script was executed without an error.
>
> Does anyone have a solution for that? Or did I just misunderstand the
> ads_error() function?
>
> Regards,
> Christian


Edgar Sherman Posted on 2011-08-03 16:11:50.0Z
Date: Wed, 03 Aug 2011 10:11:50 -0600
From: Edgar Sherman <no@email.com>
User-Agent: Mozilla/5.0 (Windows NT 6.1; WOW64; rv:5.0) Gecko/20110624 Thunderbird/5.0
MIME-Version: 1.0
Newsgroups: Advantage.PHP
Subject: Re: Reset ads_error()?
References: <4e296de9@solutions.advantagedatabase.com> <4e29b100$1@solutions.advantagedatabase.com> <4e2ec9ff$1@solutions.advantagedatabase.com>
In-Reply-To: <4e2ec9ff$1@solutions.advantagedatabase.com>
Content-Type: text/plain; charset=ISO-8859-1; format=flowed
Content-Transfer-Encoding: 8bit
NNTP-Posting-Host: 10.6.193.121
Message-ID: <4e397318$1@solutions.advantagedatabase.com>
X-Trace: 3 Aug 2011 09:11:04 -0700, 10.6.193.121
Lines: 37
Path: solutions.advantagedatabase.com
Xref: solutions.advantagedatabase.com Advantage.PHP:1136
Article PK: 1135620

I have been thinking on this and so far have not come up with a workaround.

Possibly using "OR DIE", but I don't think that will necessarily work if
you want to continue.
Another possibility is checking that a resource was returned, but this
will only work for "select" type statements and not "insert/update/delete".

Edgar

On 7/26/2011 8:07 AM, Christian Schr?der wrote:
> Thank you Edgar. Do you (or someone else) have an idea for a workaround?
>
> Christian
>
>
> "Edgar Sherman" schrieb im Newsbeitrag
> news:4e29b100$1@solutions.advantagedatabase.com...
>
> I would guess this is a bug based on the documentation. I was able to
> reproduce the behavior and I can give to the R&D team.
>
> Edgar
>
> On 7/22/2011 6:32 AM, Christian Schr?der wrote:
>> Hi,
>>
>> after executing a script via ads_do() I want to check if everything is
>> ok by checking if ads_error() is empty. This works perfectly until the
>> first error appears. From that time always the last error is displayed,
>> it does not reset when a script was executed without an error.
>>
>> Does anyone have a solution for that? Or did I just misunderstand the
>> ads_error() function?
>>
>> Regards,
>> Christian
>


Lance Schmidt Posted on 2011-08-03 16:42:50.0Z
Date: Wed, 3 Aug 2011 16:42:50 +0000 (UTC)
Message-ID: <a1f1226141338ce1fe1399a544c@devzone.advantagedatabase.com>
From: Lance Schmidt <NoThanks@spam.com>
Subject: Re: Reset ads_error()?
Newsgroups: Advantage.PHP
References: <4e397318$1@solutions.advantagedatabase.com>
MIME-Version: 1.0
Content-Transfer-Encoding: 8bit
Content-Type: text/plain; charset=iso-8859-1; format=flowed
X-Newsreader: JetBrains Omea Reader 1098.1
NNTP-Posting-Host: 10.6.199.207
X-Trace: 3 Aug 2011 09:42:05 -0700, 10.6.199.207
Lines: 53
Path: solutions.advantagedatabase.com
Xref: solutions.advantagedatabase.com Advantage.PHP:1137
Article PK: 1135621

Hello Edgar,

In the event of an error ads_do always returns FALSE, no matter what type
of SQL statement it is. The only time you need to call ads_error is if the
return value of ads_do is FALSE.

Best Regards,

Lance Schmidt
Advantage R&D

> I have been thinking on this and so far have not come up with a
> workaround.
>
> Possibly using "OR DIE", but I don't think that will necessarily work
> if
> you want to continue.
> Another possibility is checking that a resource was returned, but this
> will only work for "select" type statements and not
> "insert/update/delete".
> Edgar
>
> On 7/26/2011 8:07 AM, Christian Schr?der wrote:
>
>> Thank you Edgar. Do you (or someone else) have an idea for a
>> workaround?
>>
>> Christian
>>
>> "Edgar Sherman" schrieb im Newsbeitrag
>> news:4e29b100$1@solutions.advantagedatabase.com...
>> I would guess this is a bug based on the documentation. I was able to
>> reproduce the behavior and I can give to the R&D team.
>>
>> Edgar
>>
>> On 7/22/2011 6:32 AM, Christian Schr?der wrote:
>>
>>> Hi,
>>>
>>> after executing a script via ads_do() I want to check if everything
>>> is ok by checking if ads_error() is empty. This works perfectly
>>> until the first error appears. From that time always the last error
>>> is displayed, it does not reset when a script was executed without
>>> an error.
>>>
>>> Does anyone have a solution for that? Or did I just misunderstand
>>> the ads_error() function?
>>>
>>> Regards,
>>> Christian


Christian Schröder Posted on 2011-08-08 18:12:37.0Z
From: =?iso-8859-1?Q?Christian_Schr=F6der?= <schroeder@advantex.de>
Newsgroups: Advantage.PHP
References: <4e397318$1@solutions.advantagedatabase.com> <a1f1226141338ce1fe1399a544c@devzone.advantagedatabase.com>
In-Reply-To: <a1f1226141338ce1fe1399a544c@devzone.advantagedatabase.com>
Subject: Re: Reset ads_error()?
Date: Mon, 8 Aug 2011 20:12:37 +0200
Lines: 1
MIME-Version: 1.0
Content-Type: text/plain; format=flowed; charset="iso-8859-1"; reply-type=response
Content-Transfer-Encoding: 8bit
X-Priority: 3
X-MSMail-Priority: Normal
Importance: Normal
X-Newsreader: Microsoft Windows Live Mail 15.4.3508.1109
X-MimeOLE: Produced By Microsoft MimeOLE V15.4.3508.1109
NNTP-Posting-Host: 85.8.92.125
Message-ID: <4e402718$1@solutions.advantagedatabase.com>
X-Trace: 8 Aug 2011 11:12:40 -0700, 85.8.92.125
Path: solutions.advantagedatabase.com
Xref: solutions.advantagedatabase.com Advantage.PHP:1138
Article PK: 1135622

Mmh, that sounds good. I will try that immediately, thanks for your help...

Christian


"Lance Schmidt" schrieb im Newsbeitrag
news:a1f1226141338ce1fe1399a544c@devzone.advantagedatabase.com...

Hello Edgar,

In the event of an error ads_do always returns FALSE, no matter what type
of SQL statement it is. The only time you need to call ads_error is if the
return value of ads_do is FALSE.

Best Regards,

Lance Schmidt
Advantage R&D

> I have been thinking on this and so far have not come up with a
> workaround.
>
> Possibly using "OR DIE", but I don't think that will necessarily work
> if
> you want to continue.
> Another possibility is checking that a resource was returned, but this
> will only work for "select" type statements and not
> "insert/update/delete".
> Edgar
>
> On 7/26/2011 8:07 AM, Christian Schr?der wrote:
>
>> Thank you Edgar. Do you (or someone else) have an idea for a
>> workaround?
>>
>> Christian
>>
>> "Edgar Sherman" schrieb im Newsbeitrag
>> news:4e29b100$1@solutions.advantagedatabase.com...
>> I would guess this is a bug based on the documentation. I was able to
>> reproduce the behavior and I can give to the R&D team.
>>
>> Edgar
>>
>> On 7/22/2011 6:32 AM, Christian Schr?der wrote:
>>
>>> Hi,
>>>
>>> after executing a script via ads_do() I want to check if everything
>>> is ok by checking if ads_error() is empty. This works perfectly
>>> until the first error appears. From that time always the last error
>>> is displayed, it does not reset when a script was executed without
>>> an error.
>>>
>>> Does anyone have a solution for that? Or did I just misunderstand
>>> the ads_error() function?
>>>
>>> Regards,
>>> Christian