Home > Archive > SQL Anywhere database > October 2005 > What the hell is wrong....









You are viewing an archived Text-only version of the thread. To view this thread in it's original format and/or if you want to reply to this thread please [click here]

 

Author What the hell is wrong....
Tom

2005-10-27, 7:40 am

.... with the following statement:

if exists (select * from syswebservice where service_name =
'StoreSubscriber')
DROP SERVICE StoreSubscriber


This gives me a syntax error near 'SERVICE' !!

But I can successfully execute the statements separately:

- select * from syswebservice where service_name = 'StoreSubscriber'
- DROP SERVICE StoreSubscriber

I am using ASA 9.0.2.3124

Any help would be greatly appreciated

Thomas
krisztian pinter

2005-10-27, 7:40 am

On 21 Oct 2005 08:07:45 -0700, Tom <tom@nospam.org> wrote:

> if exists (select * from syswebservice where service_name =3D =


> 'StoreSubscriber')
> DROP SERVICE StoreSubscriber


someone stole your THEN keyword. get it back or type in a new one.
also, the end if seems to be missing.
anderson.rf

2005-10-27, 7:40 am

Alter your statment to:

if exists (select * from syswebservice where service_name =
'StoreSubscriber')

THEN

DROP SERVICE StoreSubscriber

Tom

2005-10-27, 7:40 am

krisztian pinter wrote:
> On 21 Oct 2005 08:07:45 -0700, Tom <tom@nospam.org> wrote:
>
>
>
> someone stole your THEN keyword. get it back or type in a new one.
> also, the end if seems to be missin



This is T-SQL syntax and NOT ANSI SQL!

Tom
Bruce Hay

2005-10-27, 7:40 am

DROP SERVICE is not permitted within TSQL procedures (or TSQL IF
statements). You should do as Krisztian suggested.

Whitepapers, TechDocs, bug fixes are all available through the iAnywhere
Developer Community at http://www.ianywhere.com/developer

"Tom" <tom@nospam.org> wrote in message news:435913c3$1@foru
ms-1-dub...
> krisztian pinter wrote:
>
>
> This is T-SQL syntax and NOT ANSI SQL!
>
> Tom



Tom

2005-10-27, 7:40 am

Bruce Hay wrote:
> DROP SERVICE is not permitted within TSQL procedures (or TSQL IF
> statements). You should do as Krisztian suggested.
>
> Whitepapers, TechDocs, bug fixes are all available through the iAnywhere
> Developer Community at http://www.ianywhere.com/developer
>
> "Tom" <tom@nospam.org> wrote in message news:435913c3$1@foru
ms-1-dub...
>
>
>
>


Ahh, I could not find any doc on that. I use this kind of statements for
tablew, views and procedures for many years now! Special behaviour for
services sounds a little bit 'special' but very good to know.

Many thanks for the hints.
Thomas
Sponsored Links





Also available: Server administration forum archive | Web Design forum archive | Software forum archive | Hardware reviews archive | Programming forum archive

Copyright 2008 droptable.com