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.

Problem with a Select statement in Datawindow Designer

3 posts in DataWindow .NET Last posting was on 2004-12-08 19:10:07.0Z
DGerdner Posted on 2004-12-08 16:41:08.0Z
From: "DGerdner" <dave@ptax.org>
Newsgroups: sybase.public.datawindow.net
Subject: Problem with a Select statement in Datawindow Designer
Lines: 42
X-Priority: 3
X-MSMail-Priority: Normal
X-Newsreader: Microsoft Outlook Express 6.00.2800.1409
X-MimeOLE: Produced By Microsoft MimeOLE V6.00.2800.1409
X-Original-NNTP-Posting-Host: ool-4353a821.dyn.optonline.net
Message-ID: <41b72ea0$1@forums-2-dub>
X-Original-Trace: 8 Dec 2004 08:41:04 -0800, ool-4353a821.dyn.optonline.net
X-Original-NNTP-Posting-Host: forums-2-dub.sybase.com
X-Original-Trace: 8 Dec 2004 08:41:05 -0800, forums-2-dub.sybase.com
NNTP-Posting-Host: forums-master.sybase.com
X-Original-NNTP-Posting-Host: forums-master.sybase.com
Date: 8 Dec 2004 08:41:08 -0800
X-Trace: forums-1-dub 1102524068 10.22.108.75 (8 Dec 2004 08:41:08 -0800)
X-Original-Trace: 8 Dec 2004 08:41:08 -0800, forums-master.sybase.com
X-Authenticated-User: ngsysop
Path: forums-1-dub!not-for-mail
Xref: forums-1-dub sybase.public.datawindow.net:912
Article PK: 125338

I'm transferring some Datawindows from a PB app into datawindow.net. The
following syntax (SQL Server) is working find in PB7, but is causing an
error in datawindow.net:

SELECT a.ticket_id,
CASE
WHEN (select count(*)
from v_ticket_assignments b
where primary_user_id like :as_user_id
and a.ticket_id = b.ticket_id) > 0
THEN 'Y'
ELSE 'N'
END as MyTicket,
CASE
WHEN (select count(*)
from v_ticket_assignments c
where sub_user_id like :as_user_id
and a.ticket_id = c.ticket_id) > 0
THEN 'Y'
ELSE 'N'
END as MyGrp
FROM t_ticket a

Note that the two CASE statements are nearly identical. The first CASE
statement causes no problems, but the second one gives the following error
message:

"The column prefix "a" does not match with a table name or alias used in the
Query"

Now, here's an interesting bit. If I change the "where sub_user_id like
:as_user_id" to "where sub_user_id = 'dgerdner'" (hardcode it) the error
goes away.

Any thoughts?

--
David L Gerdner
Next Generation Software, Inc.
201-571-0425


Jim O'Neil [Sybase] Posted on 2004-12-08 17:28:44.0Z
From: "Jim O'Neil [Sybase]" <joneil_at_sybase_dot_com>
Newsgroups: sybase.public.datawindow.net
Subject: Re: Problem with a Select statement in Datawindow Designer
Message-ID: <iceer0t4c6frc6qm03fa42f0uuvrihgurb@4ax.com>
References: <41b72ea0$1@forums-2-dub>
X-Newsreader: Forte Agent 2.0/32.652
MIME-Version: 1.0
Content-Type: text/plain; charset=us-ascii
Content-Transfer-Encoding: 7bit
X-Original-NNTP-Posting-Host: joneilw2k.sybase.com
X-Original-Trace: 8 Dec 2004 09:28:39 -0800, joneilw2k.sybase.com
Lines: 43
X-Original-NNTP-Posting-Host: forums-2-dub.sybase.com
X-Original-Trace: 8 Dec 2004 09:28:40 -0800, forums-2-dub.sybase.com
NNTP-Posting-Host: forums-master.sybase.com
X-Original-NNTP-Posting-Host: forums-master.sybase.com
Date: 8 Dec 2004 09:28:44 -0800
X-Trace: forums-1-dub 1102526924 10.22.108.75 (8 Dec 2004 09:28:44 -0800)
X-Original-Trace: 8 Dec 2004 09:28:44 -0800, forums-master.sybase.com
X-Authenticated-User: ngsysop
Path: forums-1-dub!not-for-mail
Xref: forums-1-dub sybase.public.datawindow.net:914
Article PK: 125340

What interface were you using in PB7? If you were using the MSS
ntiave interface that could explain the differences. Try setting
DisableBind=1 as a workaround. In general, this isn't a DW.NET
specific problem.

On 8 Dec 2004 08:41:08 -0800, "DGerdner" <dave@ptax.org> wrote:

>I'm transferring some Datawindows from a PB app into datawindow.net. The
>following syntax (SQL Server) is working find in PB7, but is causing an
>error in datawindow.net:
>
> SELECT a.ticket_id,
> CASE
> WHEN (select count(*)
> from v_ticket_assignments b
> where primary_user_id like :as_user_id
> and a.ticket_id = b.ticket_id) > 0
> THEN 'Y'
> ELSE 'N'
> END as MyTicket,
> CASE
> WHEN (select count(*)
> from v_ticket_assignments c
> where sub_user_id like :as_user_id
> and a.ticket_id = c.ticket_id) > 0
> THEN 'Y'
> ELSE 'N'
> END as MyGrp
>FROM t_ticket a
>
>Note that the two CASE statements are nearly identical. The first CASE
>statement causes no problems, but the second one gives the following error
>message:
>
>"The column prefix "a" does not match with a table name or alias used in the
>Query"
>
>Now, here's an interesting bit. If I change the "where sub_user_id like
>:as_user_id" to "where sub_user_id = 'dgerdner'" (hardcode it) the error
>goes away.
>
>Any thoughts?


DGerdner Posted on 2004-12-08 19:10:07.0Z
From: "DGerdner" <dave@ptax.org>
Newsgroups: sybase.public.datawindow.net
References: <41b72ea0$1@forums-2-dub> <iceer0t4c6frc6qm03fa42f0uuvrihgurb@4ax.com>
Subject: Re: Problem with a Select statement in Datawindow Designer
Lines: 54
X-Priority: 3
X-MSMail-Priority: Normal
X-Newsreader: Microsoft Outlook Express 6.00.2800.1409
X-MimeOLE: Produced By Microsoft MimeOLE V6.00.2800.1409
X-Original-NNTP-Posting-Host: ool-4353a821.dyn.optonline.net
Message-ID: <41b7518b@forums-2-dub>
X-Original-Trace: 8 Dec 2004 11:10:03 -0800, ool-4353a821.dyn.optonline.net
X-Original-NNTP-Posting-Host: forums-2-dub.sybase.com
X-Original-Trace: 8 Dec 2004 11:10:04 -0800, forums-2-dub.sybase.com
NNTP-Posting-Host: forums-master.sybase.com
X-Original-NNTP-Posting-Host: forums-master.sybase.com
Date: 8 Dec 2004 11:10:07 -0800
X-Trace: forums-1-dub 1102533007 10.22.108.75 (8 Dec 2004 11:10:07 -0800)
X-Original-Trace: 8 Dec 2004 11:10:07 -0800, forums-master.sybase.com
X-Authenticated-User: ngsysop
Path: forums-1-dub!not-for-mail
Xref: forums-1-dub sybase.public.datawindow.net:916
Article PK: 125341

Thanks, that was the problem. You guys are really on top of the
datawindow.net forum - I appreciate the assistance.

-Dave

"Jim O'Neil [Sybase]" <joneil_at_sybase_dot_com> wrote in message
news:iceer0t4c6frc6qm03fa42f0uuvrihgurb@4ax.com...
> What interface were you using in PB7? If you were using the MSS
> ntiave interface that could explain the differences. Try setting
> DisableBind=1 as a workaround. In general, this isn't a DW.NET
> specific problem.
>
> On 8 Dec 2004 08:41:08 -0800, "DGerdner" <dave@ptax.org> wrote:
>
> >I'm transferring some Datawindows from a PB app into datawindow.net. The
> >following syntax (SQL Server) is working find in PB7, but is causing an
> >error in datawindow.net:
> >
> > SELECT a.ticket_id,
> > CASE
> > WHEN (select count(*)
> > from v_ticket_assignments b
> > where primary_user_id like :as_user_id
> > and a.ticket_id = b.ticket_id) > 0
> > THEN 'Y'
> > ELSE 'N'
> > END as MyTicket,
> > CASE
> > WHEN (select count(*)
> > from v_ticket_assignments c
> > where sub_user_id like :as_user_id
> > and a.ticket_id = c.ticket_id) > 0
> > THEN 'Y'
> > ELSE 'N'
> > END as MyGrp
> >FROM t_ticket a
> >
> >Note that the two CASE statements are nearly identical. The first CASE
> >statement causes no problems, but the second one gives the following
error
> >message:
> >
> >"The column prefix "a" does not match with a table name or alias used in
the
> >Query"
> >
> >Now, here's an interesting bit. If I change the "where sub_user_id like
> >:as_user_id" to "where sub_user_id = 'dgerdner'" (hardcode it) the error
> >goes away.
> >
> >Any thoughts?
>