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.

Condition for if statement must be a boolean

2 posts in General Discussion Last posting was on 2009-06-30 01:37:14.0Z
MzTronsgard Posted on 2009-06-29 19:48:34.0Z
Sender: 56eb.4a49185c.1804289383@sybase.com
From: MzTronsgard
Newsgroups: sybase.public.workspace.general
Subject: Condition for if statement must be a boolean
X-Mailer: WebNews to Mail Gateway v1.1t
Message-ID: <4a491a92.5893.1681692777@sybase.com>
NNTP-Posting-Host: forums-3-dub.sybase.com
X-Original-NNTP-Posting-Host: forums-3-dub.sybase.com
Date: 29 Jun 2009 12:48:34 -0700
X-Trace: forums-3-dub.sybase.com 1246304914 10.22.241.188 (29 Jun 2009 12:48:34 -0700)
X-Original-Trace: 29 Jun 2009 12:48:34 -0700, forums-3-dub.sybase.com
Lines: 10
Path: forums-1-dub!forums-master!forums-3-dub.sybase.com!not-for-mail
Xref: forums-1-dub sybase.public.workspace.general:862
Article PK: 1088513

My app runs beautifully until I add this line of code:
IF dw_1.GetItemString(1, "event_name") like "%turnback%"
then
.
.
.
end if

It results in a "syntax error" and a "Condition for if
statement must be a boolean error.


Li huang [Sybase] Posted on 2009-06-30 01:37:14.0Z
From: "Li huang [Sybase]" <lihuang@sybase.com>
Reply-To: lihuang@sybase.com
Organization: Sybase Software Co., Ltd
User-Agent: Thunderbird 2.0.0.21 (Windows/20090302)
MIME-Version: 1.0
Newsgroups: sybase.public.workspace.general
Subject: Re: Condition for if statement must be a boolean
References: <4a491a92.5893.1681692777@sybase.com>
In-Reply-To: <4a491a92.5893.1681692777@sybase.com>
Content-Type: text/plain; charset=ISO-8859-1; format=flowed
Content-Transfer-Encoding: 7bit
NNTP-Posting-Host: vip152.sybase.com
X-Original-NNTP-Posting-Host: vip152.sybase.com
Message-ID: <4a496c4a$1@forums-3-dub.sybase.com>
Date: 29 Jun 2009 18:37:14 -0700
X-Trace: forums-3-dub.sybase.com 1246325834 10.22.241.152 (29 Jun 2009 18:37:14 -0700)
X-Original-Trace: 29 Jun 2009 18:37:14 -0700, vip152.sybase.com
Lines: 41
Path: forums-1-dub!forums-master!forums-3-dub.sybase.com!not-for-mail
Xref: forums-1-dub sybase.public.workspace.general:863
Article PK: 1088511

HI,
I created a stored procedure in IQ12.7, and it works fine and has not syntax error.

CREATE PROCEDURE cust01()
BEGIN
IF dw_1.GetItemString(1, "event_name") LIKE "%turnback%"
THEN
PRINT "SOMETHING";
END IF
END
Can you provide more detailed information for us, such as server infos, the whole stored procedure codes.

MzTronsgard wrote:
> My app runs beautifully until I add this line of code:
> IF dw_1.GetItemString(1, "event_name") like "%turnback%"
> then
> ..
> ..
> ..
> end if
>
> It results in a "syntax error" and a "Condition for if
> statement must be a boolean error.

--
Thanks and regards,

Daniel(Li) Huang [Sybase]
WorkSpace Database Development Tooling Dev Manager

Sybase
Sybase Software (China) Co., Ltd
Room 1202-1203, Building One,
Zhangjiang Semiconductor Industry Park
3000 Longdong Avenue
Pudong, Shanghai 201203
Tel 8621-38657420
Email: lihuang@sybase.com