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.

% and || wild search retrieve

2 posts in DataWindow .NET Last posting was on 2004-11-16 14:35:52.0Z
Munir Ado Posted on 2004-11-16 14:17:26.0Z
Sender: 1139.419a0668.1804289383@sybase.com
From: Munir Ado
Newsgroups: sybase.public.datawindow.net
Subject: % and || wild search retrieve
X-Mailer: WebNews to Mail Gateway v1.1t
Message-ID: <419a0bf6.117b.1681692777@sybase.com>
NNTP-Posting-Host: 10.22.241.41
X-Original-NNTP-Posting-Host: 10.22.241.41
Date: 16 Nov 2004 06:17:26 -0800
X-Trace: forums-1-dub 1100614646 10.22.241.41 (16 Nov 2004 06:17:26 -0800)
X-Original-Trace: 16 Nov 2004 06:17:26 -0800, 10.22.241.41
Lines: 11
Path: forums-1-dub!not-for-mail
Xref: forums-1-dub sybase.public.datawindow.net:732
Article PK: 125158

Hi
Please help with this wid search using a passed var string
it works fine in the datawindow.net designer but gives data
error on retrieve in vb.net my code is

SELECT "tblaccount"."account_name"
FROM "tblaccount"
WHERE "tblaccount"."account_no" like '%' ||
:as_account_name || '%'

Thanks in advance


dfish Posted on 2004-11-16 14:35:52.0Z
From: dfish@_no_spam_sybase.com (Dave Fish [Team Sybase])
Newsgroups: sybase.public.datawindow.net
Subject: Re: % and || wild search retrieve
Organization: Sybase Professional Services
Reply-To: nospam_dfish@sybase.com_nospam
Message-ID: <419a0e4f.22579577@forums.sybase.com>
References: <419a0bf6.117b.1681692777@sybase.com>
X-Newsreader: Forte Free Agent 1.21/32.243
X-Original-NNTP-Posting-Host: dfishxp.sybase.com
X-Original-Trace: 16 Nov 2004 06:35:44 -0800, dfishxp.sybase.com
Lines: 41
X-Original-NNTP-Posting-Host: forums-2-dub.sybase.com
X-Original-Trace: 16 Nov 2004 06:35:47 -0800, forums-2-dub.sybase.com
NNTP-Posting-Host: forums-master.sybase.com
X-Original-NNTP-Posting-Host: forums-master.sybase.com
Date: 16 Nov 2004 06:35:52 -0800
X-Trace: forums-1-dub 1100615752 10.22.108.75 (16 Nov 2004 06:35:52 -0800)
X-Original-Trace: 16 Nov 2004 06:35:52 -0800, forums-master.sybase.com
X-Authenticated-User: ngsysop
Path: forums-1-dub!not-for-mail
Xref: forums-1-dub sybase.public.datawindow.net:733
Article PK: 125160

You are probably better off coding the % into your retrieval argument
variable instead of hard coding them in the value property in the
Designer.

Try something like this:

Dim as_accountname as String

as_accountname = '%' + ABC + '%'

dw1.Retrieve(as_accountname)

And your SQL syntax for the DataWindow would look like this:

SELECT "tblaccount"."account_name"
FROM "tblaccount"
WHERE "tblaccount"."account_no" like :as_account_name

Regards,
Dave Fish
Sybase

TeamSybase blogs: http://www.teamsybase.net/blogs

DataWindow.NET code examples available on CodeXchange:
http://datawindownet.codexchange.sybase.com

On 16 Nov 2004 06:17:26 -0800, Munir Ado wrote:

>Hi
>Please help with this wid search using a passed var string
>it works fine in the datawindow.net designer but gives data
>error on retrieve in vb.net my code is
>
> SELECT "tblaccount"."account_name"
> FROM "tblaccount"
> WHERE "tblaccount"."account_no" like '%' ||
>:as_account_name || '%'
>
>Thanks in advance