Parsing complex datawindow SQL statements

Hello,

I need to modify the where clause of a datawindow SQL expression at runtime.
This cannot be done by using the using retrieval arguments, so I need to
modify the TABLE.SELECT of the datawindow.
In PFC there is a user object that does this, but it doens't handle the
nested queries in the SELECT or WHERE clause.
I have been looking around on the internet for hints that point me in the
right direction, but I haven't found anything yet. Dipesh Panchal has posted
a reply back in december 98 stating that he has done this, but there is no
sample code nor details about the way to handle this.

Has anybody done this before ? Is there any sample code available that I can
use to get started ?

Thanks,
Frederic


0
Frederic
8/6/2003 12:06:19 AM
sybase.powerscript 7704 articles. 0 followers. Follow

3 Replies
305 Views

Similar Articles

[PageSpeed] 3

Frederic,

I haven't seen anyone post code that provides the additional functionality.
Most people change their SQL manually, meaning they build it in their own
code then just switch it out rather than use the PFC service for doing so.
In your case this limitation may lead you to do the same.

Regards,
John
Team Sybase

2 hot new PB9 books: http://www.pb9books.com
code sharing headquarters: http://powerbuilder.codeXchange.sybase.com/
Sybase product enhancement requests:
http://www.isug.com/cgi-bin/ISUG2/submit_enhancement
Searching news group history before posting a new question:
http://groups.google.com/


"Frederic Hoornaert" <fhoornaert@belgacom.net.NOSPAM> wrote in message
news:3f30467b$1@forums-1-dub...
> Hello,
>
> I need to modify the where clause of a datawindow SQL expression at
runtime.
> This cannot be done by using the using retrieval arguments, so I need to
> modify the TABLE.SELECT of the datawindow.
> In PFC there is a user object that does this, but it doens't handle the
> nested queries in the SELECT or WHERE clause.
> I have been looking around on the internet for hints that point me in the
> right direction, but I haven't found anything yet. Dipesh Panchal has
posted
> a reply back in december 98 stating that he has done this, but there is no
> sample code nor details about the way to handle this.
>
> Has anybody done this before ? Is there any sample code available that I
can
> use to get started ?
>
> Thanks,
> Frederic
>
>


0
John
8/13/2003 10:19:02 PM
Hi,
    I didn't catch your meaning. If you just want to modify the
table.select, didn't the modify("datawindow.table.select = '" + ls_select +
"'") syntax to complete it?

-- 

Regard from Wayne
Guangzhou
China

"Frederic Hoornaert" <fhoornaert@belgacom.net.NOSPAM> д���ʼ�
news:3f30467b$1@forums-1-dub...
> Hello,
>
> I need to modify the where clause of a datawindow SQL expression at
runtime.
> This cannot be done by using the using retrieval arguments, so I need to
> modify the TABLE.SELECT of the datawindow.
> In PFC there is a user object that does this, but it doens't handle the
> nested queries in the SELECT or WHERE clause.
> I have been looking around on the internet for hints that point me in the
> right direction, but I haven't found anything yet. Dipesh Panchal has
posted
> a reply back in december 98 stating that he has done this, but there is no
> sample code nor details about the way to handle this.
>
> Has anybody done this before ? Is there any sample code available that I
can
> use to get started ?
>
> Thanks,
> Frederic
>
>


0
Wayne
8/18/2003 2:00:09 AM
I guess Frederics point is that finding the "select", "from", "where",
"group by" etc. parts of a sql statment is difficult, as there can be
several levels of nested select statements within the statment itself.

But, I've made a function that takes this into account, but I won't post it
on the newsgroup, so, Frederic, if you are still interested, send me an
e-mail: a06t03ATbblDOTno.


-- 
2.-)


"Wayne Zhao" <ZhaoWE@cs-air.com> wrote in message
news:3f403329@forums-1-dub...
> Hi,
>     I didn't catch your meaning. If you just want to modify the
> table.select, didn't the modify("datawindow.table.select = '" + ls_select
+
> "'") syntax to complete it?
>
> -- 
>
> Regard from Wayne
> Guangzhou
> China
>
> "Frederic Hoornaert" <fhoornaert@belgacom.net.NOSPAM> д���ʼ�
> news:3f30467b$1@forums-1-dub...
> > Hello,
> >
> > I need to modify the where clause of a datawindow SQL expression at
> runtime.
> > This cannot be done by using the using retrieval arguments, so I need to
> > modify the TABLE.SELECT of the datawindow.
> > In PFC there is a user object that does this, but it doens't handle the
> > nested queries in the SELECT or WHERE clause.
> > I have been looking around on the internet for hints that point me in
the
> > right direction, but I haven't found anything yet. Dipesh Panchal has
> posted
> > a reply back in december 98 stating that he has done this, but there is
no
> > sample code nor details about the way to handle this.
> >
> > Has anybody done this before ? Is there any sample code available that I
> can
> > use to get started ?
> >
> > Thanks,
> > Frederic
> >
> >
>
>


0
Andre
8/18/2003 9:09:46 AM
Reply:

Similar Artilces:

RE: SQL::Statement cannot parse valid Postgresql statement
> From: Terrence Brannon [mailto:metaperl@mac.com] > > On Monday, December 10, 2001, at 09:16 AM, Jeff Zucker wrote: > > > Terrence Brannon wrote: > >> > >> The following SQL is not parseable by SQL::Statement: > >> > >> INSERT > >> INTO thot_log (thot_fk,thot_type_fk,thot_temporality_fk,date) > >> VALUES (?,?,?,CURRENT_TIMESTAMP) > > What I have is a program which reads a SQL statement from a file. > It parses it with SQL::Statement, then it prepares this > statement, then does an ...

Top Statement and INDEX= Statement in Datawindow SQL Painter
Hi, Is there any way to put TOP and INDEX statement into Sql definition in Datawindow painter in graphical view. I know that I can go to "Convert to Sytax" but I want to learn if there is an option like "DISTINCT" in painter. SQL Example: Select TOP 100 Name,Surname FROM Names (INDEX = INX_name) Thanks for all Ali 'Top 100' you can do by making the first item in the select list a computed column TOP 100 Name I can't think of a way of doing Index. I never use graphical mode for anything other than very simple queries (and usually no...

sql statement parsing
hi guys, how can i parse the where clause in an SQL::Statement object instance? $statement = SQL::Statement->new("select 1,2,3 from table where x=y"); now when i do this: $where = $stmt->where(); it gives me error: Can't locate object method "where" via package "SQL::Statement" (perhaps you for got to load "SQL::Statement"?) at blah line 34. any idea? thanks -- Hytham Shehab At 07:34 PM 8/10/02 +0300, Hytham Shehab wrote: > how can i parse the where clause in an SQL::Statement object instance? >$statement = S...

Parsing SQL Statements
Has anyone run across any code or utilities for getting information from complex SQL statements? I want to be able to collect the table names and column names from SQL statements with complex sub-queries. Any help or pointers would be appreciated. joe white joe@lemma.net Joe -- Check out n_cst_sql in the PFC. It has a function that will break up a sql command into individual components (select,from,where,order,...) and another that will recombine the components into a single command. One caveat about this. When I used the 5.0.3 version, it had problems where nested sele...

parsing SQL statement
Anyone having suggestion parsing SQL statement? It should able to parse: BLA BALA BALA... VALUES( 'abcd efg',,999, 'some \"STRING\" and \'STR2\' STR3',,,, 'abcd, def, fghi' ) I'm using tr and then split by "," but it will fall when seeing comma inside the single quote. Thanks. --budhi On Fri, 2008-05-30 at 19:24 +0700, beast wrote: > Anyone having suggestion parsing SQL statement? > > It should able to parse: > > BLA BALA BALA... > > VALUES( > 'abcd efg',,999, 'so...

Help! How to modify the sql select statement for a nested datawindow inside a composite datawindow?
Help! How to modify the sql select statement for a nested datawindow inside a composite datawindow? Would the following work? dw_nest.Object.DataWindow.Table.Select="select employee_id from ..." Please help. jungan@aboex.com GetChild () ??? "Jun Gan" <jungan@aboex.com> wrote in message news:40e48313$1@forums-2-dub... > Help! > > How to modify the sql select statement for a nested datawindow inside a > composite datawindow? > > Would the following work? > > dw_nest.Object.DataWindow.Table.Select="select e...

complex sql statement
I need to get multiple values for each row in a database, then do a calculation and insert the calculation and the accountnumber related to the calculation the data, into a different column.  I get an error trying it this way...there is no real identifier, it is jsut something that needs to get done per row...any ideas on how I can accomplish this?  Declare @NetCommission decimal Declare @AccountNumber varchar(50) Set @NetCommission = (select (CommissionRebate * Quantity) from Account A Join Trades T on A.AccountNumber = T.AccountNumber) Set @AccountNumber = (select A.Ac...

SQL statement in datawindow
In my Datawindow painter, I would like to use "LIKE" in the where clause of my SQL SELECT STATEMENT, but it doesn't seem to show the correct results. I want to show the results from the database where the input (a retireval argument) matches anything that's entered close to that entry. I tried something like this: ie. SELECT name, address, city, province, postal_code WHERE name like '%(:name)%'; How can I use LIKE in the WHERE clause where string I am trying to match is an input retrieval argument? where name like '%' + :name + '%&#...

SQL statement and If statement
I've problem, it's in sqlcommand it's in "where" condition, which if it's exist in sql the "ELSE" not work, and if the condition not in sqlcommand the "ELSE" appear, could someone help  it's in selectcommand.CommandText = "SELECT Weekno FROM Weeks where Weekno='" + Weekno.Text + "'" if i delete the condition the " ELSE " appear. otherwise it's not appear whole code Dim myconnection As New SqlConnection("Data Source=.\SQLEXPRESS;AttachDbFilename=|DataDirectory|\football.mdf;Integrated S...

wrong parsing SQL statements
This is a multi-part message in MIME format. ------=_NextPart_000_000A_01C2A5ED.5D254130 Content-Type: text/plain; charset="big5" Content-Transfer-Encoding: quoted-printable I have a complex SQL Statements like this: SELECT pms_list_temp.lot_no, pms_list_temp.wo_no, =20 pms_list_temp.seq, =20 pms_list_temp.ord_seq2, pms_list_temp.m_itemno, pms_list_temp.delivery_name,=20 pms_list_temp.dep_no, pms_list_temp.wo_qty, pms_list_temp.dship, pms_list_temp.work_center, =20 pms_list_temp.work_group, pms_list_temp.catch_date, pms_l...

Parsing columns from a sql statement
Hi, How I could get the name of the columns from a string variable that has a sql statement? "select this, that, (to_date('02-02-04','mm-dd-yy')) from table" I want to obtain the column names "this", "that" and (to_date('02-02-04','mm-dd-yy')) Thank you I would suggest to use the POS and MID functions. Joseph wrote: > Hi, How I could get the name of the columns from a string > variable that has a sql statement? > > "select this, that, (to_date('02-02-04','mm-dd-yy')) from >...

Datawindow from arbitrary SQL statement
Hi - I have an SQL statement which executes fine on my host, the results of which I would like displayed (read-only) in a datawindow. I can't seem to define a datawindow that has as its syntax arbitrary SQL, since the DW painter seems to want to be able to "understand" it ... that is, my statement uses "WITH" clauses, and UNIONs, etc to the extent that is not graphically representable. Can I just tell the dw painter "never mind, just run the statement as is and help me layout the results " ? Thanks Choose Convert to Syntax, then try to ...

How do I pass an SQL statement to a datawindow?
Hello, I am creating a custom query module for my application. In that module I build the SQL statement (SELECT column1 FROM table1...), in my application, based on the criteria the user selects. I now need to display the records and I figured I could do that by passing the SQL to the datawindow and have the datawindow do the retrieval and formatting of the columns but I couldn't find any way to do that. Anyone have any ideas or suggestions? Thanks!! Take a look at SyntaxFromSQL function. Look at example 2 specifically Hope this helps Anil Lou wrote: >...

Getting SQL statement from Datawindow
Hi! Is there a way to get the exact SQL statement that will be generated when calling dw.Update()? dw.GetSQLSelect() returns the statment in this form ... SELECT xx, yy FROM ... I am trying to get the statement in this form. UPDATE xx SET .... INSERT INTO XXX(xxx) VALUES(xx).... Thanks, Geoff Have a look at sqlPreview event. On Wed, 16 Jul 2003 15:52:54 +0900, in powersoft.public.powerbuilder.datawindow Geoffrey Sy <gsy@alliance.com.ph> wrote: >Hi! > >Is there a way to get the exact SQL statement that will be generated when >calling d...

Web resources about - Parsing complex datawindow SQL statements - sybase.powerscript

PowerBuilder - Wikipedia, the free encyclopedia
PowerBuilder is an integrated development environment owned by Sybase , a division of SAP . It has been in use since 1991, peaking around 1998 ...

Intelligent Versus Surrogate Keys
Should I use business columns as primary key fields for tables in thedatabase, or generate artificial primary key values? When business-related ...

chevy volt
ProEXR File Description =Attributes= channels (chlist) compression (compression): Zip dataWindow (box2i): [0, 0, 5119, 2475] displayWindow (box2i): ...

Enable - A comprehensive solution for the localization of PowerBuilder applications Untitled Document ...
Enable is localization/ translation tool used by PowerBuilder developers to make their applications multilingual.Enable is a powerful tool that ...

comp.lang.clipper.visual-objects - Google Groups
comp.lang.clipper.visual-objects 1-20 von 33006 Themen werden angezeigt Integrity of a file marcosm...@gmail.com 09:35 Combobox value Lu 08:12 ...

Sybase PowerBuilder tool readied for Microsoft's .Net
Developers can choose Win32 or newer style .Net development

PowerToTheBuilder - PowerBuilder UI Controls
HOME - COMPONENTS - PB UI DESIGNER - DOWNLOAD\PURCHASE - SUPPORT - FAQ - ABOUT Take Control of your UI with PB Ultimate Suite PowerToTheBuilder.com ...

Beautiful iPad Mini 3 Concept Reimagines Apple’s Tablet With iPhone 6 Design, Gold Color [Images]
The iPhone 6 may be grabbing all of the recent headlines due to its impending announcement, but spare a thought for those who prefer to stay ...

Java Networking - Real's HowTo
Real's HowTo Custom Search Java Language String and Number Applet AWT Swing Environment IO Javascript interaction JDBC Thread Networking JSP ...

Business Intelligence Products - Database Management, Data Warehousing & Mobility Software - Sybase Inc ...
Sybase offers a variety of Business Intelligence (BI) software like products for database management, data warehousing and mining, data integration ...

Resources last updated: 12/26/2015 4:26:18 AM