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.

Delete Top 1

4 posts in ,  General Discussion General Discussion Last posting was on 2006-09-21 19:46:22.0Z
abcd Posted on 2006-09-21 15:27:46.0Z
From: "abcd" <abcd@xyz.com>
Newsgroups: sybase.public.sqlanywhere.general,ianywhere.public.general
Subject: Delete Top 1
Lines: 18
X-Priority: 3
X-MSMail-Priority: Normal
X-Newsreader: Microsoft Outlook Express 6.00.2900.2869
X-RFC2646: Format=Flowed; Original
X-MimeOLE: Produced By Microsoft MimeOLE V6.00.2900.2962
NNTP-Posting-Host: c-24-22-49-139.hsd1.or.comcast.net
X-Original-NNTP-Posting-Host: c-24-22-49-139.hsd1.or.comcast.net
Message-ID: <4512af72$1@forums-1-dub>
Date: 21 Sep 2006 08:27:46 -0700
X-Trace: forums-1-dub 1158852466 24.22.49.139 (21 Sep 2006 08:27:46 -0700)
X-Original-Trace: 21 Sep 2006 08:27:46 -0700, c-24-22-49-139.hsd1.or.comcast.net
Path: forums-1-dub!not-for-mail
Xref: forums-1-dub sybase.public.sqlanywhere.general:110429 ianywhere.public.general:5632
Article PK: 1654

I have below SQL statement

DELETE TOP 1 from TABLE where id=123 ORDER BY CHANGETIME

the above statement works fine with the iAnywhere version 9.00.02.2451

But fails for iAnywhere 9.00.01.1751. (gives error Syntax error near
'ORDER')

Is there any iAnywhere version issue for the above statement to run or can
somebody tell if this SQL statement is correct.

any thoughts...


Breck Carter [Team iAnywhere] Posted on 2006-09-21 15:40:11.0Z
From: "Breck Carter [Team iAnywhere]" <NOSPAM__bcarter@risingroad.com>
Newsgroups: ianywhere.public.general
Subject: Re: Delete Top 1
Organization: RisingRoad Professional Services
Reply-To: NOSPAM__bcarter@risingroad.com
Message-ID: <fec5h2d070q9uv57hk8tsln9425qeqhvlc@4ax.com>
References: <4512af72$1@forums-1-dub>
X-Newsreader: Forte Agent 2.0/32.640
MIME-Version: 1.0
Content-Type: text/plain; charset=us-ascii
Content-Transfer-Encoding: 7bit
X-Original-NNTP-Posting-Host: bcarter.sentex.ca
X-Original-Trace: 21 Sep 2006 08:38:50 -0700, bcarter.sentex.ca
Lines: 34
X-Original-NNTP-Posting-Host: forums-2-dub.sybase.com
X-Original-Trace: 21 Sep 2006 08:38:52 -0700, forums-2-dub.sybase.com
NNTP-Posting-Host: forums-master.sybase.com
X-Original-NNTP-Posting-Host: forums-master.sybase.com
Date: 21 Sep 2006 08:40:11 -0700
X-Trace: forums-1-dub 1158853211 10.22.108.75 (21 Sep 2006 08:40:11 -0700)
X-Original-Trace: 21 Sep 2006 08:40:11 -0700, forums-master.sybase.com
X-Authenticated-User: ngsysop
Path: forums-1-dub!not-for-mail
Xref: forums-1-dub ianywhere.public.general:5633
Article PK: 1656

AFAIK the DELETE - ORDER BY clause was silently introduced some time
during the lifetime of Version 9... note that the V9 Help still does
not show it.

Anyway, TOP doesn't make much sense without ORDER BY.

Breck

On 21 Sep 2006 08:27:46 -0700, "abcd" <abcd@xyz.com> wrote:

>I have below SQL statement
>
>DELETE TOP 1 from TABLE where id=123 ORDER BY CHANGETIME
>
>the above statement works fine with the iAnywhere version 9.00.02.2451
>
>But fails for iAnywhere 9.00.01.1751. (gives error Syntax error near
>'ORDER')
>
>Is there any iAnywhere version issue for the above statement to run or can
>somebody tell if this SQL statement is correct.
>
>any thoughts...
>
>
>
>

--
Breck Carter [Team iAnywhere]
RisingRoad SQL Anywhere and MobiLink Professional Services
www.risingroad.com
The book: http://www.risingroad.com/SQL_Anywhere_Studio_9_Developers_Guide.html
breck.carter@risingroad.com


abcd Posted on 2006-09-21 16:59:59.0Z
From: "abcd" <abcd@xyz.com>
Newsgroups: ianywhere.public.general
References: <4512af72$1@forums-1-dub> <fec5h2d070q9uv57hk8tsln9425qeqhvlc@4ax.com>
Subject: Re: Delete Top 1
Lines: 42
X-Priority: 3
X-MSMail-Priority: Normal
X-Newsreader: Microsoft Outlook Express 6.00.2900.2869
X-RFC2646: Format=Flowed; Original
X-MimeOLE: Produced By Microsoft MimeOLE V6.00.2900.2962
X-Original-NNTP-Posting-Host: 67.42.198.185
Message-ID: <4512c4bf$1@forums-2-dub>
X-Original-Trace: 21 Sep 2006 09:58:39 -0700, 67.42.198.185
X-Original-NNTP-Posting-Host: forums-2-dub.sybase.com
X-Original-Trace: 21 Sep 2006 09:58:40 -0700, forums-2-dub.sybase.com
NNTP-Posting-Host: forums-master.sybase.com
X-Original-NNTP-Posting-Host: forums-master.sybase.com
Date: 21 Sep 2006 09:59:59 -0700
X-Trace: forums-1-dub 1158857999 10.22.108.75 (21 Sep 2006 09:59:59 -0700)
X-Original-Trace: 21 Sep 2006 09:59:59 -0700, forums-master.sybase.com
X-Authenticated-User: ngsysop
Path: forums-1-dub!not-for-mail
Xref: forums-1-dub ianywhere.public.general:5634
Article PK: 1655

ooops...How can I work on this query in 9.01 then. Any clues....

"Breck Carter [Team iAnywhere]" <NOSPAM__bcarter@risingroad.com> wrote in
message news:fec5h2d070q9uv57hk8tsln9425qeqhvlc@4ax.com...
> AFAIK the DELETE - ORDER BY clause was silently introduced some time
> during the lifetime of Version 9... note that the V9 Help still does
> not show it.
>
> Anyway, TOP doesn't make much sense without ORDER BY.
>
> Breck
>
> On 21 Sep 2006 08:27:46 -0700, "abcd" <abcd@xyz.com> wrote:
>
>>I have below SQL statement
>>
>>DELETE TOP 1 from TABLE where id=123 ORDER BY CHANGETIME
>>
>>the above statement works fine with the iAnywhere version 9.00.02.2451
>>
>>But fails for iAnywhere 9.00.01.1751. (gives error Syntax error near
>>'ORDER')
>>
>>Is there any iAnywhere version issue for the above statement to run or can
>>somebody tell if this SQL statement is correct.
>>
>>any thoughts...
>>
>>
>>
>>
>
> --
> Breck Carter [Team iAnywhere]
> RisingRoad SQL Anywhere and MobiLink Professional Services
> www.risingroad.com
> The book:
> http://www.risingroad.com/SQL_Anywhere_Studio_9_Developers_Guide.html
> breck.carter@risingroad.com


Breck Carter [Team iAnywhere] Posted on 2006-09-21 19:46:22.0Z
From: "Breck Carter [Team iAnywhere]" <NOSPAM__bcarter@risingroad.com>
Newsgroups: ianywhere.public.general
Subject: Re: Delete Top 1
Organization: RisingRoad Professional Services
Reply-To: NOSPAM__bcarter@risingroad.com
Message-ID: <ssq5h21icvr70797prnulbav2i4tp3mo2v@4ax.com>
References: <4512af72$1@forums-1-dub> <fec5h2d070q9uv57hk8tsln9425qeqhvlc@4ax.com> <4512c4bf$1@forums-2-dub>
X-Newsreader: Forte Agent 2.0/32.640
MIME-Version: 1.0
Content-Type: text/plain; charset=us-ascii
Content-Transfer-Encoding: 7bit
NNTP-Posting-Host: bcarter.sentex.ca
X-Original-NNTP-Posting-Host: bcarter.sentex.ca
Date: 21 Sep 2006 12:46:22 -0700
X-Trace: forums-1-dub 1158867982 64.7.134.118 (21 Sep 2006 12:46:22 -0700)
X-Original-Trace: 21 Sep 2006 12:46:22 -0700, bcarter.sentex.ca
Lines: 55
X-Authenticated-User: TeamSybase
Path: forums-1-dub!not-for-mail
Xref: forums-1-dub ianywhere.public.general:5635
Article PK: 1657

You could try this...

SELECT TOP 1 pkey INTO @pkey FROM t ORDER BY whatever, then DELETE
WHERE pkey = @pkey.

On 21 Sep 2006 09:59:59 -0700, "abcd" <abcd@xyz.com> wrote:

>ooops...How can I work on this query in 9.01 then. Any clues....
>
>
>"Breck Carter [Team iAnywhere]" <NOSPAM__bcarter@risingroad.com> wrote in
>message news:fec5h2d070q9uv57hk8tsln9425qeqhvlc@4ax.com...
>> AFAIK the DELETE - ORDER BY clause was silently introduced some time
>> during the lifetime of Version 9... note that the V9 Help still does
>> not show it.
>>
>> Anyway, TOP doesn't make much sense without ORDER BY.
>>
>> Breck
>>
>> On 21 Sep 2006 08:27:46 -0700, "abcd" <abcd@xyz.com> wrote:
>>
>>>I have below SQL statement
>>>
>>>DELETE TOP 1 from TABLE where id=123 ORDER BY CHANGETIME
>>>
>>>the above statement works fine with the iAnywhere version 9.00.02.2451
>>>
>>>But fails for iAnywhere 9.00.01.1751. (gives error Syntax error near
>>>'ORDER')
>>>
>>>Is there any iAnywhere version issue for the above statement to run or can
>>>somebody tell if this SQL statement is correct.
>>>
>>>any thoughts...
>>>
>>>
>>>
>>>
>>
>> --
>> Breck Carter [Team iAnywhere]
>> RisingRoad SQL Anywhere and MobiLink Professional Services
>> www.risingroad.com
>> The book:
>> http://www.risingroad.com/SQL_Anywhere_Studio_9_Developers_Guide.html
>> breck.carter@risingroad.com
>

--
Breck Carter [Team iAnywhere]
RisingRoad SQL Anywhere and MobiLink Professional Services
www.risingroad.com
The book: http://www.risingroad.com/SQL_Anywhere_Studio_9_Developers_Guide.html
breck.carter@risingroad.com