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.

How do I dynamically change the where clause?

2 posts in PB Infomaker Report Writer Last posting was on 1997-07-21 18:17:41.0Z
Rosemary Miller Posted on 1997-07-17 21:30:48.0Z
Newsgroups: sybase.public.infomaker.general
Date: Thu, 17 Jul 1997 14:30:48 -0700
From: Rosemary Miller <millerr@fairfax-emh1.army.mil>
Organization: SDCW
X-Mailer: Mozilla 3.0 (Win95; U; 16bit)
MIME-Version: 1.0
Subject: How do I dynamically change the where clause?
Content-Type: text/plain; charset=us-ascii
Content-Transfer-Encoding: 7bit
Lines: 18
Message-ID: <348_33CE8F08.6B3@fairfax-emh1.army.mil>
Path: forums-1-dub!forums-1-dub!forums-master.sybase.com!forums.powersoft.com
Xref: forums-1-dub sybase.public.infomaker.general:7497
Article PK: 244553

I have a report that is run from a PB application. The user wants to be
able to pick and choose how much information they see, for example, they
want to be able to span dates, or search on part of a specific field
instead of always seeing all the information. Right now, they have 5
different options and I have 5 versions of the same report, and
depending on what option they select, I prompt for the information
needed and run the appropriate report. I want to store one version of
the report and swap the where clause depending on user selection. How
is the best way to do this?

Thanks in advance,
Rosemary Miller
Software Development Center - Washington
Fairfax, VA


Terry Dykstra Posted on 1997-07-21 18:17:41.0Z
Newsgroups: sybase.public.infomaker.general
From: "Terry Dykstra" <tdykstra@cfol.ab.ca>
Subject: Re: How do I dynamically change the where clause?
X-Newsreader: Microsoft Internet News 4.70.1161
Date: Mon, 21 Jul 1997 14:17:41 -0400
Lines: 44
Message-ID: <348_01bc960a$cc4effe0$8366e4cf@terrywork.cfol.ab.ca>
References: <348_33CE8F08.6B3@fairfax-emh1.army.mil>
Path: forums-1-dub!forums-1-dub!forums-master.sybase.com!forums.powersoft.com
Xref: forums-1-dub sybase.public.infomaker.general:7495
Article PK: 244550

The easiest way is to use the 'Prompt for Criteria' option on the
datawindow. That gives the user a lot of freedom.
You can also use retrieval arguments, but then you need to use LIKE
statements and have the user enter a % (percent sign) so you get a select
. where .. like '%' if the field is not required.

Alternatively, take a look at the describe and modify functions. I've just
listed a section of a program where I add to an existing where clause.

// Modify WHERE clause
ls_sql = dw_popup.Describe("DataWindow.Table.Select")
ls_sql = ls_sql + " and ( v$open_cursor.user_name = ~~'" +
str_report.user_id + "~~' ) "
ls_sql = "Datawindow.Table.Select=' " + ls_sql + " ' "
ls_rc = dw_popup.Modify(ls_sql)
ls_sql = dw_popup.Describe ( "DataWindow.Syntax")
dw_popup.Create ( ls_sql, ls_rc )
dw_popup.SetTransObject ( SQLCA )
dw_popup.Retrieve()

Terry Dykstra (TeamPS)

Rosemary Miller <millerr@fairfax-emh1.army.mil> wrote in article
<33CE8F08.6B3@fairfax-emh1.army.mil>...
> I have a report that is run from a PB application. The user wants to be
> able to pick and choose how much information they see, for example, they
> want to be able to span dates, or search on part of a specific field
> instead of always seeing all the information. Right now, they have 5
> different options and I have 5 versions of the same report, and
> depending on what option they select, I prompt for the information
> needed and run the appropriate report. I want to store one version of
> the report and swap the where clause depending on user selection. How
> is the best way to do this?
>
> Thanks in advance,
> Rosemary Miller
> Software Development Center - Washington
> Fairfax, VA
>