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.

Global Function in Filter

7 posts in DataWindow Last posting was on 2009-08-20 00:13:57.0Z
kilstromcraig Posted on 2009-08-17 20:45:39.0Z
From: kilstromcraig <kilstromcraig@yahoo.com>
Newsgroups: sybase.public.powerbuilder.datawindow
Subject: Global Function in Filter
Date: Mon, 17 Aug 2009 13:45:39 -0700 (PDT)
Organization: http://groups.google.com
Lines: 14
Message-ID: <b78c1059-bbd7-42b1-aabc-f82a33bb989a@d4g2000yqa.googlegroups.com>
NNTP-Posting-Host: 155.188.247.7
Mime-Version: 1.0
Content-Type: text/plain; charset=ISO-8859-1
Content-Transfer-Encoding: 7bit
X-Trace: posting.google.com 1250541939 16409 127.0.0.1 (17 Aug 2009 20:45:39 GMT)
X-Complaints-To: groups-abuse@google.com
NNTP-Posting-Date: Mon, 17 Aug 2009 20:45:39 +0000 (UTC)
Complaints-To: groups-abuse@google.com
Injection-Info: d4g2000yqa.googlegroups.com; posting-host=155.188.247.7; posting-account=sjOvzwoAAAAaB9weqHNa_6u33zNyoGlo
User-Agent: G2/1.0
X-HTTP-UserAgent: Mozilla/4.0 (compatible; MSIE 6.0; Windows NT 5.1; SV1; InfoPath.1; .NET CLR 1.1.4322; .NET CLR 2.0.50727; .NET CLR 3.0.04506.30; .NET CLR 3.0.04506.648),gzip(gfe),gzip(gfe)
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!d4g2000yqa.googlegroups.com!not-for-mail
Xref: forums-1-dub sybase.public.powerbuilder.datawindow:89776
Article PK: 418964

It's crunch time....

I've been forced to use a global function in a filter.

First problem -- non-string args were not accepted. Got over that one
quickly.

Next problem -- does not work when inline sql inserted in global
function. Got to have it.

Am I hosed? Remember, it's crunch time (users are coming tomorrow to
test)....

Thanks.


Jeremy Lakeman Posted on 2009-08-17 23:26:48.0Z
From: Jeremy Lakeman <jeremy.lakeman@gmail.com>
Newsgroups: sybase.public.powerbuilder.datawindow
Subject: Re: Global Function in Filter
Date: Mon, 17 Aug 2009 16:26:48 -0700 (PDT)
Organization: http://groups.google.com
Lines: 18
Message-ID: <5a3fd06c-4322-4fb4-a513-3d67f7b4a6d1@q14g2000vbi.googlegroups.com>
References: <b78c1059-bbd7-42b1-aabc-f82a33bb989a@d4g2000yqa.googlegroups.com>
NNTP-Posting-Host: 203.122.242.105
Mime-Version: 1.0
Content-Type: text/plain; charset=ISO-8859-1
Content-Transfer-Encoding: quoted-printable
X-Trace: posting.google.com 1250551608 31533 127.0.0.1 (17 Aug 2009 23:26:48 GMT)
X-Complaints-To: groups-abuse@google.com
NNTP-Posting-Date: Mon, 17 Aug 2009 23:26:48 +0000 (UTC)
Complaints-To: groups-abuse@google.com
Injection-Info: q14g2000vbi.googlegroups.com; posting-host=203.122.242.105; posting-account=euaBtgoAAAC_vDxfsxmpMKlBxHaHpmRS
User-Agent: G2/1.0
X-HTTP-Via: 1.1 fly.essential.com.au:3128 (squid/2.5.STABLE8), 1.0 asp.essential.intranet:3128 (squid/2.5.STABLE8)
X-HTTP-UserAgent: Mozilla/5.0 (Windows; U; Windows NT 5.1; en-US; rv:1.9.1.2) Gecko/20090729 Firefox/3.5.2 (.NET CLR 3.5.30729),gzip(gfe),gzip(gfe)
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!q14g2000vbi.googlegroups.com!not-for-mail
Xref: forums-1-dub sybase.public.powerbuilder.datawindow:89779
Article PK: 418966


On Aug 18, 5:45 am, kilstromcraig <kilstromcr...@yahoo.com> wrote:
> It's crunch time....
>
> I've been forced to use a global function in a filter.
>
> First problem -- non-string args were not accepted.  Got over that one
> quickly.
>
> Next problem -- does not work when inline sql inserted in global
> function.  Got to have it.
>
> Am I hosed?  Remember, it's crunch time (users are coming tomorrow to
> test)....
>
> Thanks.

I'm guessing that the sql wasn't working while the main dw was
retrieved. You could set the filter after the retrieve...


"Paul Horan[Sybase]" <phoran_remove Posted on 2009-08-18 03:19:08.0Z
From: "Paul Horan[Sybase]" <phoran_remove@remove_sybase.com>
Newsgroups: sybase.public.powerbuilder.datawindow
References: <b78c1059-bbd7-42b1-aabc-f82a33bb989a@d4g2000yqa.googlegroups.com>
Subject: Re: Global Function in Filter
Lines: 28
Organization: Sybase
X-Priority: 3
X-MSMail-Priority: Normal
X-Newsreader: Microsoft Outlook Express 6.00.2900.5843
X-MimeOLE: Produced By Microsoft MimeOLE V6.00.2900.5579
X-RFC2646: Format=Flowed; Original
NNTP-Posting-Host: vip152.sybase.com
X-Original-NNTP-Posting-Host: vip152.sybase.com
Message-ID: <4a8a1dac$2@forums-1-dub>
Date: 17 Aug 2009 20:19:08 -0700
X-Trace: forums-1-dub 1250565548 10.22.241.152 (17 Aug 2009 20:19:08 -0700)
X-Original-Trace: 17 Aug 2009 20:19:08 -0700, vip152.sybase.com
X-Authenticated-User: teamsybase
Path: forums-1-dub!not-for-mail
Xref: forums-1-dub sybase.public.powerbuilder.datawindow:89782
Article PK: 418970

Remember, the filter is applied AFTER the SQL has already been processed by
the database and the result set is in the primary buffer.
So, why would you need to do anything with SQL in the filter?

Post your function code and let's see how we can refactor it.

--
Paul Horan[Sybase]
http://blogs.sybase.com/phoran/

"kilstromcraig" <kilstromcraig@yahoo.com> wrote in message
news:b78c1059-bbd7-42b1-aabc-f82a33bb989a@d4g2000yqa.googlegroups.com...
> It's crunch time....
>
> I've been forced to use a global function in a filter.
>
> First problem -- non-string args were not accepted. Got over that one
> quickly.
>
> Next problem -- does not work when inline sql inserted in global
> function. Got to have it.
>
> Am I hosed? Remember, it's crunch time (users are coming tomorrow to
> test)....
>
> Thanks.


kilstromcraig Posted on 2009-08-18 20:40:18.0Z
From: kilstromcraig <kilstromcraig@yahoo.com>
Newsgroups: sybase.public.powerbuilder.datawindow
Subject: Re: Global Function in Filter
Date: Tue, 18 Aug 2009 13:40:18 -0700 (PDT)
Organization: http://groups.google.com
Lines: 19
Message-ID: <00a622de-9f28-4e12-8eec-e778c40164c9@s15g2000yqs.googlegroups.com>
References: <b78c1059-bbd7-42b1-aabc-f82a33bb989a@d4g2000yqa.googlegroups.com> <4a8a1dac$2@forums-1-dub>
NNTP-Posting-Host: 155.188.247.5
Mime-Version: 1.0
Content-Type: text/plain; charset=ISO-8859-1
Content-Transfer-Encoding: 7bit
X-Trace: posting.google.com 1250628020 31124 127.0.0.1 (18 Aug 2009 20:40:20 GMT)
X-Complaints-To: groups-abuse@google.com
NNTP-Posting-Date: Tue, 18 Aug 2009 20:40:20 +0000 (UTC)
Complaints-To: groups-abuse@google.com
Injection-Info: s15g2000yqs.googlegroups.com; posting-host=155.188.247.5; posting-account=sjOvzwoAAAAaB9weqHNa_6u33zNyoGlo
User-Agent: G2/1.0
X-HTTP-UserAgent: Mozilla/4.0 (compatible; MSIE 6.0; Windows NT 5.1; SV1; InfoPath.1; .NET CLR 1.1.4322; .NET CLR 2.0.50727; .NET CLR 3.0.04506.30; .NET CLR 3.0.04506.648),gzip(gfe),gzip(gfe)
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!s15g2000yqs.googlegroups.com!not-for-mail
Xref: forums-1-dub sybase.public.powerbuilder.datawindow:89790
Article PK: 418978

Yes, the filter is explicitly set after the retrieve and the existing
gf we wanted to use has embedded sql.

The datawindow is (by edict) used in both a user display window and in
a nightly auto process. The filter only applies to the nightly
process. It serves to constrain the results to only those that
"breached the SLA" the previous business day (hence the gf call). The
filter works great when no sql in the global function, but the one we
wanted to use checks the db for corporate holidays....

I created a computed column on the dataobject and and populated it
with a db function call that provided the same data (business day
calc) that the global function does. It worked.

Still not sure, though, why the global function returns a null value
when sql is embedded.

There's too much code involved to send for refactoring, but it fails
with "select 0 into :li_cnt from dual using sqlca;"....


Jeremy Lakeman Posted on 2009-08-19 06:17:55.0Z
From: Jeremy Lakeman <jeremy.lakeman@gmail.com>
Newsgroups: sybase.public.powerbuilder.datawindow
Subject: Re: Global Function in Filter
Date: Tue, 18 Aug 2009 23:17:55 -0700 (PDT)
Organization: http://groups.google.com
Lines: 22
Message-ID: <aca8059e-b1d6-4ab8-9d79-39f6616d4a42@h31g2000yqd.googlegroups.com>
References: <b78c1059-bbd7-42b1-aabc-f82a33bb989a@d4g2000yqa.googlegroups.com> <4a8a1dac$2@forums-1-dub> <00a622de-9f28-4e12-8eec-e778c40164c9@s15g2000yqs.googlegroups.com>
NNTP-Posting-Host: 203.122.242.105
Mime-Version: 1.0
Content-Type: text/plain; charset=ISO-8859-1
Content-Transfer-Encoding: quoted-printable
X-Trace: posting.google.com 1250662675 10677 127.0.0.1 (19 Aug 2009 06:17:55 GMT)
X-Complaints-To: groups-abuse@google.com
NNTP-Posting-Date: Wed, 19 Aug 2009 06:17:55 +0000 (UTC)
Complaints-To: groups-abuse@google.com
Injection-Info: h31g2000yqd.googlegroups.com; posting-host=203.122.242.105; posting-account=euaBtgoAAAC_vDxfsxmpMKlBxHaHpmRS
User-Agent: G2/1.0
X-HTTP-Via: 1.1 fly.essential.com.au:3128 (squid/2.5.STABLE8), 1.0 asp.essential.intranet:3128 (squid/2.5.STABLE8)
X-HTTP-UserAgent: Mozilla/5.0 (Windows; U; Windows NT 5.1; en-US; rv:1.9.1.2) Gecko/20090729 Firefox/3.5.2 (.NET CLR 3.5.30729),gzip(gfe),gzip(gfe)
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!h31g2000yqd.googlegroups.com!not-for-mail
Xref: forums-1-dub sybase.public.powerbuilder.datawindow:89793
Article PK: 418981


On Aug 19, 5:40 am, kilstromcraig <kilstromcr...@yahoo.com> wrote:
> Yes, the filter is explicitly set after the retrieve and the existing
> gf we wanted to use has embedded sql.
>
> The datawindow is (by edict) used in both a user display window and in
> a nightly auto process.  The filter only applies to the nightly
> process.  It serves to constrain the results to only those that
> "breached the SLA" the previous business day (hence the gf call).  The
> filter works great when no sql in the global function, but the one we
> wanted to use checks the db for corporate holidays....
>
> I created a computed column on the dataobject and and populated it
> with a db function call that provided the same data (business day
> calc) that the global function does.  It worked.
>
> Still not sure, though, why the global function returns a null value
> when sql is embedded.
>
> There's too much code involved to send for refactoring, but it fails
> with "select 0 into :li_cnt from dual using sqlca;"....

null value? The function may have thrown a runtime error..


kilstromcraig Posted on 2009-08-19 20:45:45.0Z
From: kilstromcraig <kilstromcraig@yahoo.com>
Newsgroups: sybase.public.powerbuilder.datawindow
Subject: Re: Global Function in Filter
Date: Wed, 19 Aug 2009 13:45:45 -0700 (PDT)
Organization: http://groups.google.com
Lines: 5
Message-ID: <0c52e50a-12dc-461b-a014-9b32de31b22d@m20g2000vbp.googlegroups.com>
References: <b78c1059-bbd7-42b1-aabc-f82a33bb989a@d4g2000yqa.googlegroups.com> <4a8a1dac$2@forums-1-dub> <00a622de-9f28-4e12-8eec-e778c40164c9@s15g2000yqs.googlegroups.com> <aca8059e-b1d6-4ab8-9d79-39f6616d4a42@h31g2000yqd.googlegroups.com>
NNTP-Posting-Host: 155.188.183.7
Mime-Version: 1.0
Content-Type: text/plain; charset=ISO-8859-1
Content-Transfer-Encoding: 7bit
X-Trace: posting.google.com 1250714745 29946 127.0.0.1 (19 Aug 2009 20:45:45 GMT)
X-Complaints-To: groups-abuse@google.com
NNTP-Posting-Date: Wed, 19 Aug 2009 20:45:45 +0000 (UTC)
Complaints-To: groups-abuse@google.com
Injection-Info: m20g2000vbp.googlegroups.com; posting-host=155.188.183.7; posting-account=sjOvzwoAAAAaB9weqHNa_6u33zNyoGlo
User-Agent: G2/1.0
X-HTTP-UserAgent: Mozilla/4.0 (compatible; MSIE 6.0; Windows NT 5.1; SV1; InfoPath.1; .NET CLR 1.1.4322; .NET CLR 2.0.50727; .NET CLR 3.0.04506.30; .NET CLR 3.0.04506.648),gzip(gfe),gzip(gfe)
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!m20g2000vbp.googlegroups.com!not-for-mail
Xref: forums-1-dub sybase.public.powerbuilder.datawindow:89801
Article PK: 418987

Yes, an error trying to access sqlca. We tried establishing a local
transaction object (wouldn't that be fun for each row in a 20,000 row
result set!), but still had trouble accessing the database.
As a wise one said, "Avoid using global functions in filters if they
contain sql"....


Jeremy Lakeman Posted on 2009-08-20 00:13:57.0Z
From: Jeremy Lakeman <jeremy.lakeman@gmail.com>
Newsgroups: sybase.public.powerbuilder.datawindow
Subject: Re: Global Function in Filter
Date: Wed, 19 Aug 2009 17:13:57 -0700 (PDT)
Organization: http://groups.google.com
Lines: 9
Message-ID: <c975e078-0442-4bf0-a923-4d42897130da@d23g2000vbm.googlegroups.com>
References: <b78c1059-bbd7-42b1-aabc-f82a33bb989a@d4g2000yqa.googlegroups.com> <4a8a1dac$2@forums-1-dub> <00a622de-9f28-4e12-8eec-e778c40164c9@s15g2000yqs.googlegroups.com> <aca8059e-b1d6-4ab8-9d79-39f6616d4a42@h31g2000yqd.googlegroups.com> <0c52e50a-12dc-461b-a014-9b32de31b22d@m20g2000vbp.googlegroups.com>
NNTP-Posting-Host: 203.122.242.105
Mime-Version: 1.0
Content-Type: text/plain; charset=ISO-8859-1
Content-Transfer-Encoding: quoted-printable
X-Trace: posting.google.com 1250727238 8049 127.0.0.1 (20 Aug 2009 00:13:58 GMT)
X-Complaints-To: groups-abuse@google.com
NNTP-Posting-Date: Thu, 20 Aug 2009 00:13:58 +0000 (UTC)
Complaints-To: groups-abuse@google.com
Injection-Info: d23g2000vbm.googlegroups.com; posting-host=203.122.242.105; posting-account=euaBtgoAAAC_vDxfsxmpMKlBxHaHpmRS
User-Agent: G2/1.0
X-HTTP-Via: 1.1 fly.essential.com.au:3128 (squid/2.5.STABLE8), 1.0 asp.essential.intranet:3128 (squid/2.5.STABLE8)
X-HTTP-UserAgent: Mozilla/5.0 (Windows; U; Windows NT 5.1; en-US; rv:1.9.1.2) Gecko/20090729 Firefox/3.5.2 (.NET CLR 3.5.30729),gzip(gfe),gzip(gfe)
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!d23g2000vbm.googlegroups.com!not-for-mail
Xref: forums-1-dub sybase.public.powerbuilder.datawindow:89804
Article PK: 418992


On Aug 20, 5:45 am, kilstromcraig <kilstromcr...@yahoo.com> wrote:
> Yes, an error trying to access sqlca.  We tried establishing a local
> transaction object (wouldn't that be fun for each row in a 20,000 row
> result set!), but still had trouble accessing the database.
> As a wise one said, "Avoid using global functions in filters if they
> contain sql"....

Yeah, call the function in code, and assign the result to a dummy
column in your result set....