how to dynamic get the columns list from any sql?

when we use "select * from sometab;" in database administration, PB will
show us all the columns in the "sometab" with data. I just wonder how PB can
get the columns list? if we can write a same program to do so? Dynamic
Cusor? No, its only get the column data. Or, it is just a function provided
by the Database environment? if then, with oracle, how can we get the
columns list when whatever SQL statement given?


0
incats
4/19/2004 3:11:16 AM
sybase.powerbuilder.datawindow 28057 articles. 4 followers. Follow

6 Replies
960 Views

Similar Articles

[PageSpeed] 41

Every RDBMS I have seen keeps the table definitions in tables. For Oracle,
the view SYS.ALL_TAB_COLUMNS should have what you need, and SELECT is
usually granted to PUBLC.

"incats" <wany@163.net> wrote in message news:4083434f@forums-2-dub...
> when we use "select * from sometab;" in database administration, PB will
> show us all the columns in the "sometab" with data. I just wonder how PB
can
> get the columns list? if we can write a same program to do so? Dynamic
> Cusor? No, its only get the column data. Or, it is just a function
provided
> by the Database environment? if then, with oracle, how can we get the
> columns list when whatever SQL statement given?
>
>


0
Jerry
4/19/2004 2:47:14 PM
Actually, it sounds like the OP is asking about parsing dynamic SQL.  I
haven't done this myself, but for Oracle I think you'd need to use the
DBMS_SQL package, specifically the PARSE and DESCRIBE_COLUMNS functions.

Ken


"Jerry Siegel" <jerrys@data-sci.com.nospam> wrote in message
news:4083e672$1@forums-1-dub...
> Every RDBMS I have seen keeps the table definitions in tables. For Oracle,
> the view SYS.ALL_TAB_COLUMNS should have what you need, and SELECT is
> usually granted to PUBLC.
>
> "incats" <wany@163.net> wrote in message news:4083434f@forums-2-dub...
> > when we use "select * from sometab;" in database administration, PB will
> > show us all the columns in the "sometab" with data. I just wonder how PB
> can
> > get the columns list? if we can write a same program to do so? Dynamic
> > Cusor? No, its only get the column data. Or, it is just a function
> provided
> > by the Database environment? if then, with oracle, how can we get the
> > columns list when whatever SQL statement given?
> >
> >
>
>


0
Ken
4/19/2004 3:01:28 PM
If you are looking for the column list from the database look at Jerry's reply,
if you are asking how to create a dynamic cursor or something like it in
Powerbuilder look under help for Dynamic SQL Format X or under help for Create
(datawindow) to create a dynamic datawindow/datastore (then you can loop through
the columns to see all the avail.)  What exactly are you tring to do?

Ken Drendel

On 18 Apr 2004 20:11:16 -0700,
 in sybase.public.powerbuilder.datawindow
incats <wany@163.net> wrote: 
>when we use "select * from sometab;" in database administration, PB will
>show us all the columns in the "sometab" with data. I just wonder how PB can
>get the columns list? if we can write a same program to do so? Dynamic
>Cusor? No, its only get the column data. Or, it is just a function provided
>by the Database environment? if then, with oracle, how can we get the
>columns list when whatever SQL statement given?
>
>
0
Ken
4/19/2004 3:22:06 PM
Actually, if you want a DW/DS given an SQL statement, SyntaxFromSQL followed
by Create does the job.

"Ken Drendel" <NOSPAM_Kend998@yahoo.com> wrote in message
news:4083ee9e$1@forums-1-dub...
> If you are looking for the column list from the database look at Jerry's
reply,
> if you are asking how to create a dynamic cursor or something like it in
> Powerbuilder look under help for Dynamic SQL Format X or under help for
Create
> (datawindow) to create a dynamic datawindow/datastore (then you can loop
through
> the columns to see all the avail.)  What exactly are you tring to do?
>
> Ken Drendel
>
> On 18 Apr 2004 20:11:16 -0700,
>  in sybase.public.powerbuilder.datawindow
> incats <wany@163.net> wrote:
> >when we use "select * from sometab;" in database administration, PB will
> >show us all the columns in the "sometab" with data. I just wonder how PB
can
> >get the columns list? if we can write a same program to do so? Dynamic
> >Cusor? No, its only get the column data. Or, it is just a function
provided
> >by the Database environment? if then, with oracle, how can we get the
> >columns list when whatever SQL statement given?
> >
> >


0
Jerry
4/19/2004 3:39:48 PM
Where have I heard that before...



On 19 Apr 2004 08:39:48 -0700,
 in sybase.public.powerbuilder.datawindow
Jerry Siegel <jerrys@data-sci.com.nospam> wrote: 
>Actually, if you want a DW/DS given an SQL statement, SyntaxFromSQL followed
>by Create does the job.
>
>"Ken Drendel" <NOSPAM_Kend998@yahoo.com> wrote in message
>news:4083ee9e$1@forums-1-dub...
>> If you are looking for the column list from the database look at Jerry's
>reply,
>> if you are asking how to create a dynamic cursor or something like it in
>> Powerbuilder look under help for Dynamic SQL Format X or under help for
>Create
>> (datawindow) to create a dynamic datawindow/datastore (then you can loop
>through
>> the columns to see all the avail.)  What exactly are you tring to do?
>>
>> Ken Drendel
>>
>> On 18 Apr 2004 20:11:16 -0700,
>>  in sybase.public.powerbuilder.datawindow
>> incats <wany@163.net> wrote:
>> >when we use "select * from sometab;" in database administration, PB will
>> >show us all the columns in the "sometab" with data. I just wonder how PB
>can
>> >get the columns list? if we can write a same program to do so? Dynamic
>> >Cusor? No, its only get the column data. Or, it is just a function
>provided
>> >by the Database environment? if then, with oracle, how can we get the
>> >columns list when whatever SQL statement given?
>> >
>> >
>
>
0
Ken
4/19/2004 3:50:53 PM
thank you to everybody! :)


0
incats
4/21/2004 1:14:42 AM
Reply:

Similar Artilces:

How to get a list of columns in a datawindow.
Dear all, At development time, I can get a list of columns by select the "column specifications" in the datawindow painter. But how can I get a list of columns in a datawindow at run-time. Thanks, Hi Thomas ! Try this: STRING ls_test ls_test = dw_object.Describe("Datawindow.Objects") This command retrieve a List of Objects in your DataWindow, and not only columns. After test the result with this another command: ls_test = dw_object.Describe(ObjectName + ".Type") This command test if the object name you pass by reference is...

How to get Column names from dynamic Datawindow?
Attached is a piece of code that opens a datastore based on a datawindow which is itself based on a stored procedure that takes two parameters. There are two records in the dataset. The problem is thus: this code will be customized in each application but the "linked" list it will be stored in is part of a PFC service that will not know the number/names of fields until run time. That code is generic and creates the initial linked list from records stored in a table that "defines" the number/names of fields. Since the code must not make any assumptions about the ...

How do I get a list of columns that exist in a datawindow?
When running my application, how can I get a list of columns that exist in a give datawindow object? nbennett@rsilink.com wrote... > When running my application, how can I get a list of columns that exist in > a give datawindow object? > You should have posted in the powersoft.public.powerbuilder.general newsgroup. Something like this should work: Integer li_counter String ls_columns[] For li_counter = 1 to dw_1.object.datawindow.column.count ls_columns[li_counter] = dw_1.Describe('#' + String(li_counter) + '.name') Next -- Jim Egan [TeamSybas...

How to create dynamic columns in the Datawindow Using powerbuilder
Hi, Can any one let me know How to create dynamic columns in the data window using modified method. Thanks in Advance Rami Hi, Please refer "Datawindow Syntax" tool provided by sybase for generating the syntax to create dynamic columns. /*************Dynamic column Syntax <DW Control Name>.Modify(& "create column( id=<an integer> tabsequence=<an integer> accelerator='<a single letter>' moveable=<0 - False, 1 - True> resizeable=<0 - False, 1 - True> pointer='<Arrow!, Cross!, HourGlass!, IBeam!, Icon!,...

Get Value of column dynamic of datawindow crosstab
Hello to all. I have datawindow crosstab and I need to obtain the value of the generated columns . Thanks! Hola a todos. Tengo un datawindow crosstab y necesito obtener el valor de las columnas generadas dinamicamente Read the thread started by Davy De Permentier with the subject "CrossTab" on friday. "Raul Gil" <gl_ra@hotmail.com> wrote in message news:414f86f2$1@forums-1-dub... > Hello to all. > > I have datawindow crosstab and I need to obtain the value of the > generated columns . > > Thanks! > &...

How can I get the column name of a datawindow column?
I want to get the column name in tablename.columnname format. I have tried to get it using dbname property. However, I found that it work only if the tables in the datawindow are inner join. If the tables in the datawindow are outer join, the dbname only return the columnname and the tablename is missed. Do you have any idea? Charles You could add the name to the select clause or to the tag property. Or you caould check to see if it is a join or not (by seeing if there is a '.' in the column name) if not then get the sql select statment and parse to find the table...

How to get a column property in a datawindow column object expression?
Hi, I have a free style datawindow, I want such expression: columnA.x = IF(columnB.visible, columnB.x + 100, 200) Yes, you can get it in script, but I just want set it in datawindow. Anyone can help? Bo Song soong@188.net Hi Bo, AFAIK, you cannot reference object properties in the expression. That would be nice... -- - Eric Aling [TeamPS], Cypres Informatisering bv, The Netherlands Eric's Home & PB Site @ http://utopia.knoware.nl/users/cypr115 Bo Song <soong@188.net> wrote in message 36D52106.433CE9B2@188.net... >Hi, >I have a free style data...

Get SQL From datawindow
How Get Perfect SQL statement from datawindow? I don't need "PBSELECT( VERSION(700) TABLE(NAME=~"Table~" ) COLUMN(NAME=~"col1~")" I need "SELECT col1, col2 From table Where col1 = arg;" I need your help, please! Try: dw_1.Describe( "table.SQLSelect" ) -- pbm_hopethishelps, Roy Kiesler [TeamSybase] Sybase Developer Network (SDN) - http://www.sybase.com/sdn "minkyu kim" <kim0329@netian.com> wrote in message news:pVhALaIj$GA.285@forums.sybase.com... > How Get Perfect SQL statement fro...

Dynamic Column for datawindows
Hello folks: Is there a standard technique for dynamically (programatically) creating a new column in a datawindow? David A Adding a visible object for a column that is already in the SQL is easy - look up the CREATE keyword for Modify. If you also need to add the column to the SQL, you will have to modify the Table property as well to define the column in the buffers. Look at an export so see all the keywords you will need. "David Ashton" <ashtond@meridianhi.com> wrote in message news:eJpBa8U$CHA.326@forums-1-dub... > Hello folks: > > Is there ...

get list of columns
I use this script to read the columns SELECT list(c.column_name) INTO :ls_columncons FROM sys.syscolumn c, sys.systable t WHERE t.table_id = c.table_id AND t.table_name = :ls_table[li_aantal] But, the columns are not in the order as they are in the table (looking with powerbuilder). If I include sys.syscolumns and order on col_no is the column order then allways the order as I see in powerbuilder? Thanks Eric Try this... SELECT list(c.column_name ORDER BY c.column_id) INTO :ls_columncons FROM sys.syscolumn c, sys.systable t WHERE t.table_id = c.table_id ...

Dynamic SQL and datawindow
I come from a VB/Delphi background(if you don't count the 5 years programming in RPG) and I'm quite comfortable and used to building dynamic SQL from user input. I've learned that if you want to do this with a datawindow then the SQL for that datawindow can't have a 'where' clause. I'm working on a really big(can we say overblown) application that uses PFC and relies heavily on inheritance and one of the projects that I've been working on has to do with fixing a problem where the designers of this application only expected to return one record from a data...

How Get sql in datawindow
I need get the command sql that go to DataBase when I do update at the datawindows. The SQLPreview event in the DW is your friend here. Use sqltype = PreviewUpdate! to get the SQL only for updates. Argenis Castro <argeniscastro@hotmail.com> wrote in message news:obGzKcxTAHA.269@forums.sybase.com... > I need get the command sql that go to DataBase when I do update at the > datawindows. > > ...

Dynamic SQL In a Datawindow
Is it possible to create a datawindow where the SQL can be generated dynamically without the use of a stored procedure? I need to build a WHERE clause depending on the arguments passed from a window. For example I need to query on last name, first name, and middle name if all are provided. Or, I need to query only on last name and first name when middle name is not provided. Thanks in advance. R._Glass There are actually several different ways that you could accomplish this... You could create your datawindow with no where clause, but define all of the retrieval arguments...

All my task list entries were gone!, powerbuilder is getting closed when i click on the Task list icon
Hi all I am using PB 10.2.0 Build 7516. I have created a list of Tasks using the Task List for my current workspace. But suddenly when I click on the Task List icon the PB is getting closed, Application error occurs. How to recover my Task List!!, How to solve this issue, Any body have idea, pls share it with me TIA Rammurali Krishnan B ...

Web resources about - how to dynamic get the columns list from any sql? - sybase.powerbuilder.datawindow

Dynamics - Wikipedia, the free encyclopedia
Brownian dynamics , the occurrence of Langevin dynamics in the motion of particles in solution (e.g. a grain in water, as was first seen by Brown); ...

Datacenter Dynamics
Datacenterdynamics for data center information, conferences, news, videos, whitepapers and reports globally

Dynamic Chiropractic - chiropractic, news, articles, research & information for chiropractors - Find ...
Dynamic Chiropractic - chiropractic, news, articles, research & information for chiropractors - Find a Chiropractor

The colorful, dark, dynamic art of life: 2015 BioArt winners
In an embryonic mouse torso, researches closely track how the parallel paths of blood vessels (gray) and nerve cells (red) develop. Understanding ...

Playing ‘GTA V’ in a Force Dynamics motion simulator looks like a ton of fun
It's been a few weeks since I last sat down and played Grand Theft Auto V . Although it's still one of my favorite games of both this generation ...

General Dynamics Corporation Delivers The Future of American Shipping
American Petroleum Tankers receives delivery of first ECO class tanker from General Dynamics\' NASSCO.

Microsoft Dynamics AX delivers the power of the cloud to businesses
Microsoft has announced that the next release of its flagship ERP solution, Microsoft Dynamics AX, will be generally available in the first quarter ...

Yolanda Foster Says Lyme Disease 'Changed the Dynamic' of Her Marriage to David Foster
Yolanda Foster Says Lyme Disease 'Changed the Dynamic' of Her Marriage to David Foster

Microsoft Releases Dynamics CRM 2016 With New Analytics Features
DAILY VIDEO: Microsoft launches Dynamics CRM 2016; Encryption ban wouldn't have affected Paris attackers' plans; VTech hacker obtains kids' photos, ...

Three Ways To Create a Dynamic And Engaging Office Environment
VideoPhoto Credit: Stan Phelps How you design your office matters. It sets the stage for how your employees work and interact. The physical environment ...

Resources last updated: 12/9/2015 2:44:21 PM