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.

why generating rows using connect by doesn't work?

2 posts in DataWindow Last posting was on 2009-04-24 14:57:42.0Z
gramizi Posted on 2009-04-24 14:06:05.0Z
From: gramizi@gmail.com
Newsgroups: sybase.public.powerbuilder.datawindow
Subject: why generating rows using connect by doesn't work?
Date: Fri, 24 Apr 2009 07:06:05 -0700 (PDT)
Organization: http://groups.google.com
Lines: 23
Message-ID: <15f19470-10dc-4a91-b1ec-5a7d88ada056@k38g2000yqh.googlegroups.com>
NNTP-Posting-Host: 194.147.254.37
Mime-Version: 1.0
Content-Type: text/plain; charset=ISO-8859-1
Content-Transfer-Encoding: 7bit
X-Trace: posting.google.com 1240581965 11336 127.0.0.1 (24 Apr 2009 14:06:05 GMT)
X-Complaints-To: groups-abuse@google.com
NNTP-Posting-Date: Fri, 24 Apr 2009 14:06:05 +0000 (UTC)
Complaints-To: groups-abuse@google.com
Injection-Info: k38g2000yqh.googlegroups.com; posting-host=194.147.254.37; posting-account=SRqv3AoAAAD-Yma2NwSzUclk6TKJR8Hp
User-Agent: G2/1.0
X-HTTP-UserAgent: Mozilla/4.0 (compatible; MSIE 6.0; Windows NT 5.0; .NET CLR 1.1.4322; .NET CLR 2.0.50727),gzip(gfe),gzip(gfe)
X-HTTP-Via: 1.1 proxy1.generali.ch:3128 (squid/2.6.STABLE5)
Path: forums-1-dub!forums-master!newssvr.sybase.com!news-sj-1.sprintlink.net!news-peer1.sprintlink.net!newsfeed.yul.equant.net!nntp1.roc.gblx.net!nntp.gblx.net!nntp.gblx.net!nlpi057.nbdc.sbc.com!prodigy.net!border1.nntp.dca.giganews.com!nntp.giganews.com!postnews.google.com!k38g2000yqh.googlegroups.com!not-for-mail
Xref: forums-1-dub sybase.public.powerbuilder.datawindow:89195
Article PK: 418446

hi all,

I want to generate rows with this statement in a DataWindow, but it
generates just one row (and not 30 rows):
select
to_date('01.04.2009','dd.mm.yyyy')-1 + level as Datum, level
Tag
from dual
where to_date('01.04.2009', 'dd.mm.yyyy') <= to_date
('30.04.2009', 'dd.mm.yyyy')
connect by level <= 1+(to_date('30.04.2009','dd.mm.yyyy') -
to_date('01.04.2009', 'dd.mm.yyyy'))


... it works like expected when I execute the statement in sqlplus
(?). Do you know why it doesn't behave like in sqlplus?


I'm using PB 7(!).


TIA,
gzim


gramizi Posted on 2009-04-24 14:57:42.0Z
From: gramizi@gmail.com
Newsgroups: sybase.public.powerbuilder.datawindow
Subject: Re: why generating rows using connect by doesn't work?
Date: Fri, 24 Apr 2009 07:57:42 -0700 (PDT)
Organization: http://groups.google.com
Lines: 44
Message-ID: <20d60fdb-262a-4b1a-9e72-0cd9ba845138@w40g2000yqd.googlegroups.com>
References: <15f19470-10dc-4a91-b1ec-5a7d88ada056@k38g2000yqh.googlegroups.com>
NNTP-Posting-Host: 194.147.254.37
Mime-Version: 1.0
Content-Type: text/plain; charset=ISO-8859-1
Content-Transfer-Encoding: quoted-printable
X-Trace: posting.google.com 1240585062 20469 127.0.0.1 (24 Apr 2009 14:57:42 GMT)
X-Complaints-To: groups-abuse@google.com
NNTP-Posting-Date: Fri, 24 Apr 2009 14:57:42 +0000 (UTC)
Complaints-To: groups-abuse@google.com
Injection-Info: w40g2000yqd.googlegroups.com; posting-host=194.147.254.37; posting-account=SRqv3AoAAAD-Yma2NwSzUclk6TKJR8Hp
User-Agent: G2/1.0
X-HTTP-UserAgent: Mozilla/4.0 (compatible; MSIE 6.0; Windows NT 5.0; .NET CLR 1.1.4322; .NET CLR 2.0.50727),gzip(gfe),gzip(gfe)
X-HTTP-Via: 1.1 proxy1.generali.ch:3128 (squid/2.6.STABLE5)
Path: forums-1-dub!forums-master!newssvr.sybase.com!news-sj-1.sprintlink.net!news-peer1.sprintlink.net!nntp1.phx1.gblx.net!nntp.gblx.net!nntp.gblx.net!border2.nntp.dca.giganews.com!nntp.giganews.com!postnews.google.com!w40g2000yqd.googlegroups.com!not-for-mail
Xref: forums-1-dub sybase.public.powerbuilder.datawindow:89196
Article PK: 418447

It was a copy/paste (friday) mistake, I used in my DW not exactly the
same query:

it should be:

Select Datum, Tag
From
( select
to_date('01.04.2009','dd.mm.yyyy')-1 + level as Datum, level
Tag
from dual
where to_date('01.04.2009', 'dd.mm.yyyy') <= to_date
('30.04.2009', 'dd.mm.yyyy')
connect by level <= 1+(to_date('30.04.2009','dd.mm.yyyy') -
to_date('01.04.2009', 'dd.mm.yyyy'))
)
;

...now, it works.

On 24 Apr., 16:06, gram...@gmail.com wrote:
> hi all,
>
> I want to generate rows with this statement in a DataWindow, but it
> generates just one row (and not 30 rows):
> select
>       to_date('01.04.2009','dd.mm.yyyy')-1 + level as Datum, level
> Tag
>       from dual
>       where to_date('01.04.2009', 'dd.mm.yyyy') <= to_date
> ('30.04.2009', 'dd.mm.yyyy')
>       connect by level <= 1+(to_date('30.04.2009','dd.mm.yyyy') -
> to_date('01.04.2009', 'dd.mm.yyyy'))
>
> ... it works like expected when I execute the statement in sqlplus
> (?). Do you know why it doesn't behave like in sqlplus?
>
> I'm using PB 7(!).
>
> TIA,
> gzim