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!!




0
Lou
5/5/1999 8:55:51 AM
sybase.powerscript 7704 articles. 0 followers. Follow

5 Replies
361 Views

Similar Articles

[PageSpeed] 58

Take a look at SyntaxFromSQL function. Look at example 2 specifically

Hope this helps
Anil


Lou wrote:

> 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!!

0
Anil
5/7/1999 4:36:57 AM
This is a multi-part message in MIME format.
--------------97D25FB69FB73EB214BE9F90
Content-Type: text/plain; charset=us-ascii
Content-Transfer-Encoding: 7bit

Hi,

hope this one will help.
Use:
<DW Control Name>.Modify("DataWindow.Table.Select='<string containing the SQL
select source of the DW>'")

M.F.

Lou wrote:

> 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!!

--------------97D25FB69FB73EB214BE9F90
Content-Type: text/x-vcard; charset=us-ascii;
 name="marcus.fehlberg.vcf"
Content-Transfer-Encoding: 7bit
Content-Description: Card for Marcus Fehlberg
Content-Disposition: attachment;
 filename="marcus.fehlberg.vcf"

begin:vcard 
n:Fehlberg;Marcus
tel;fax:+49 30 4303 2355
tel;work:+49 30 4303 2350
x-mozilla-html:FALSE
url:www.powerpeople.de
org:Power People
adr:;;Am Borsigturm 48;Berlin;Germany;13507;
version:2.1
email;internet:marcus.fehlberg@powerpeople.de
title:Herr
fn:Marcus Fehlberg
end:vcard

--------------97D25FB69FB73EB214BE9F90--

0
Marcus
5/11/1999 3:16:26 PM
Hi

see the SetSQLSelect() datawindow function.


regards
Fred


Lou a �crit dans le message ...
>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!!
>
>
>
>

0
fred
5/12/1999 1:42:17 PM
You can dynamically create the datawindow since you've already
determined its syntax.  Use code similar to the following:


/* uf_create_datawindow
   This function uses the following parameters:
	l_dw - datawindow to be CREATEd
	select_statement - SQL SELECT statement used to generate the 
datawindow

   It returns the created datawindow, or a NULL datawindow variable if
it fails

*/

string ls_syntax, ls_err, ls_style
integer li_ret

ls_style = 'Style(Type=Form) Datawindow(Color=79741120) ' + &
	'Column(Border=5 font.face="Arial" font.height=-10
Edit.AutoHScroll=Yes) ' + &
	'Text(font.face="Arial" font.height=-10 ' + &
	' font.weight=400 font.family=2 font.pitch=2 font.charset=0 ' + &
	'background.mode=1 background.color=536870912)'

ls_syntax = sqlca.syntaxfromsql(select_statement, ls_style, ls_err)

li_ret = l_dw.create(ls_syntax, ls_err)
if len(ls_err) > 0 then setnull(l_dw)

return l_dw
0
Brian
5/13/1999 3:55:41 AM
Thanks for everyone's help.  It helped out allot.



Lou <I@AmHere.com> wrote in message
news:MUKDQLDm#GA.326@forums.sybase.com...
> 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!!
>
>
>
>


0
Lou
5/18/1999 11:37:07 PM
Reply:

Similar Artilces:

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 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 + '%&#...

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...

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...

passing variable to sql statement
could anyone please help me to resolve this issue? here's my sql query which retrieve last 3 month data t.execute(SELECT * tbl1 where nmonth >= datepart(mm,DATEADD(month, -3, getdate())) or nmonth <=datepart(mm,getdate()) and empno='"+emppip+"'") now instead of passing 3 in this query(datepart(mm,DATEADD(month, -3, getdate())) ) i need to pass a variable to retrieve data based on user requirements. i tried this way, dim mno as n mno=4 t.execute(SELECT * tbl1 where nmonth >= datepart(mm,DATEADD(month, -'"+mno+"'...

add sql statement on datawindow
a datawindow is very close to a database table. so i think it's useful to use sql statement to get data from a datawindow, instead of select data to a datawindow then save data to a database temp table and then use sql to get data from it. especially for n tie program,it will be more usefull hobby I don't really understand this request. I can't think of any reason to retrieve into a datawindow, then save the retrieved data back into a database temp table, and then use embedded SQL to re-retrieve the data back into the application. That's three trips across the ...

Passing an array to a SQL statement
I hope someone can help me. I'm using SQL Server 2000 and PB 9.0.3. I have an application where a user selects one or more reports listed in a datawindow. I need to run a separate query based upon the selection. Here's a simplistic example: SELECT report_no, report_type FROM reports WHERE report_no IN (selected list) ORDER BY report_type, report_no If I declare a string array report_no[] how can I pass it to the SQL statement? -- RAYMOND MAJEWSKI You SQL should have a variable of type string array SELECT report_no, report_...

nested SQL statements in datawindows
We are developing a N-Tier application for the internet using EA Studio 3.0 and are having a SQL conflict. I am curious if there is a problem with using a nested sql statement, like th following, as data source SQL for a datawindow. Now the reason why this is distressing, is due to the fact that as a sql query I get the desired results, as well as during a HTML datawindow preview. What seems to happen is when the SQL statement is nested the retrieval arguments are no longer picked up and read properly. SELECT table1.name, table1.fname, ...

Passing URL with SQL WHERE statement
Please can someone help with the following? I get this compilation error when trying to pass a specific id from a table in order to see details.  When I simply type in the vcid number the code works properly.Description: An error occurred during the compilation of a resource required to service this request. Please review the following specific error details and modify your source code appropriately. Compiler Error Message: CS1026: ) expectedSource errorOdbcCommand objCommand = new OdbcCommand("SELECT * FROM firms WHERE vcid=<%=Request.QueryString("vcid")%>", o...

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...

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 ...

Passing variable to SQL select statement
I am Using VB .NET: I need to know how to pass a variable to my SQL Select statement. I generate a Datagrid and in that datagrid there is a hyperlink. I want to beable to click that Hyperlink and pass that value to the select statement. For instance I have a Hyperlink in the datagrid that show "7023". When I click that It takes me to a new ASP page with the following SQL statement: "SELECT [tRCableDetails].[EquipmentID] AS 'EID', [tRCableDetails].[SpecificationLength] AS 'Spec', [tRCableDetails].[PhysicalLength] AS 'Physical' FROM [tRCableDetails] WHERE ([tRCable...

Web resources about - How do I pass an SQL statement to a datawindow? - 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/16/2015 7:16:07 PM