Getting value of a single column

Hello Everyone,

I am new to this group and Powerbuilder.  Therefore, any help would be
greatly appreciated.  Here is my situation:

I have a datawindow (dw_trafficmarkets) and I would like to get the
value of the "Mktname" column for all the rows in this datawindow.  Can
anyone help me?

dw_trafficmarkets
*************
*  Chicago       *
*  New York   *
*  Atlanta         *
*  Etc.              *
*************

I need to get all the values from the above data window and then use
them to select a list of products from a table where the markets equal
the markets contained within dw_trafficmarkets.
Therefore, can anyone help me learn how to get those retrieved values
and then use them to get the necessary rows from my table?

Any and all help is truly appreciated.  Thanks in Advance.


-- Rodney

P.S. Sorry if I sound redundant.  I just want to be clear as possible.




0
Rodney
7/27/1999 7:52:08 PM
sybase.powerbuilder.datawindow 28057 articles. 4 followers. Follow

6 Replies
409 Views

Similar Articles

[PageSpeed] 5

I can help as far as getting the values of the column - simply declare 
a array the size of the rowcount() of the dw, the use
array=dwcontrol.Object.columnname.primary

Rodney J. Woodruff wrote:
> 
> Hello Everyone,
> 
> I am new to this group and Powerbuilder.  Therefore, any help would be
> greatly appreciated.  Here is my situation:
> 
> I have a datawindow (dw_trafficmarkets) and I would like to get the
> value of the "Mktname" column for all the rows in this datawindow.  Can
> anyone help me?
> 
> dw_trafficmarkets
> *************
> *  Chicago       *
> *  New York   *
> *  Atlanta         *
> *  Etc.              *
> *************
> 
> I need to get all the values from the above data window and then use
> them to select a list of products from a table where the markets equal
> the markets contained within dw_trafficmarkets.
> Therefore, can anyone help me learn how to get those retrieved values
> and then use them to get the necessary rows from my table?
> 
> Any and all help is truly appreciated.  Thanks in Advance.
> 
> -- Rodney
> 
> P.S. Sorry if I sound redundant.  I just want to be clear as possible.
0
Ragni
7/27/1999 8:02:10 PM
In your other datawindow, defined a retrieval argument of type String Array.
Set the WHERE clause to something like
WHERE mktname in (:ra_argname)

Then code:

string ls_mktname[ ]

ls_mktname = dw_trafficmarkets.object.mktname.primary
dw_products.Retrieve(ls_mktname)


HTH

Simon

Rodney J. Woodruff wrote in message <379E0DE8.3429E877@cecom.com>...
>Hello Everyone,
>
>I am new to this group and Powerbuilder.  Therefore, any help would be
>greatly appreciated.  Here is my situation:
>
>I have a datawindow (dw_trafficmarkets) and I would like to get the
>value of the "Mktname" column for all the rows in this datawindow.  Can
>anyone help me?
>
>dw_trafficmarkets
>*************
>*  Chicago       *
>*  New York   *
>*  Atlanta         *
>*  Etc.              *
>*************
>
>I need to get all the values from the above data window and then use
>them to select a list of products from a table where the markets equal
>the markets contained within dw_trafficmarkets.
>Therefore, can anyone help me learn how to get those retrieved values
>and then use them to get the necessary rows from my table?
>
>Any and all help is truly appreciated.  Thanks in Advance.
>
>
>-- Rodney
>
>P.S. Sorry if I sound redundant.  I just want to be clear as possible.
>
>
>
>


0
Simon
7/28/1999 10:13:51 AM
As Ragni suggested - and for other helpful ways to pull "chunks" of data
out of a dw, go into pb help, click the 'find' tab and type: "about
datawindow data expressions" then select the first topic. - you'll get a
range of syntax for accessing selected rows, ranges of rows, columns,
entire rows, etc... Use of these methods, instead of looping in scripts,
saves valuable processing time...hth

"Rodney J. Woodruff" wrote:

> Hello Everyone,
>
> I am new to this group and Powerbuilder.  Therefore, any help would be
> greatly appreciated.  Here is my situation:
>
> I have a datawindow (dw_trafficmarkets) and I would like to get the
> value of the "Mktname" column for all the rows in this datawindow.  Can
> anyone help me?
>
> dw_trafficmarkets
> *************
> *  Chicago       *
> *  New York   *
> *  Atlanta         *
> *  Etc.              *
> *************
>
> I need to get all the values from the above data window and then use
> them to select a list of products from a table where the markets equal
> the markets contained within dw_trafficmarkets.
> Therefore, can anyone help me learn how to get those retrieved values
> and then use them to get the necessary rows from my table?
>
> Any and all help is truly appreciated.  Thanks in Advance.
>
> -- Rodney
>
> P.S. Sorry if I sound redundant.  I just want to be clear as possible.

0
J
7/28/1999 12:10:14 PM
The suggestions with the dot notation are nice, but won't work if you
have more than 32768 rows in your datawindow. Keep that in mind (Another
thing: the dot notation used to be VERY buggy in PB 5.0, I think it's
better in 6.5, but I still avoid it where possible)

Regards
thomas


"Rodney J. Woodruff" wrote:
> 
> Hello Everyone,
> 
> I am new to this group and Powerbuilder.  Therefore, any help would be
> greatly appreciated.  Here is my situation:
> 
> I have a datawindow (dw_trafficmarkets) and I would like to get the
> value of the "Mktname" column for all the rows in this datawindow.  Can
> anyone help me?
> 
> dw_trafficmarkets
> *************
> *  Chicago       *
> *  New York   *
> *  Atlanta         *
> *  Etc.              *
> *************
> 
> I need to get all the values from the above data window and then use
> them to select a list of products from a table where the markets equal
> the markets contained within dw_trafficmarkets.
> Therefore, can anyone help me learn how to get those retrieved values
> and then use them to get the necessary rows from my table?
> 
> Any and all help is truly appreciated.  Thanks in Advance.
> 
> -- Rodney
> 
> P.S. Sorry if I sound redundant.  I just want to be clear as possible.
0
Thomas
7/28/1999 5:52:38 PM
Thom is right, You are probably safer to just use a loop and use
dw_1.GetItemString() to store the value in an array. I have had crashes
with the dot method and since never want to use it any more. The loop
actually goes very fast. Here is what you do if you want the loop:
ll_rowcount = dw_1.RowCount()
FOR ll_count = 1 TO ll_rowcount
    array[ll_count] = dw_1.GetItemString(ll_count, "your colname")
NEXT

"Rodney J. Woodruff" wrote:

> Hello Everyone,
>
> I am new to this group and Powerbuilder.  Therefore, any help would be
> greatly appreciated.  Here is my situation:
>
> I have a datawindow (dw_trafficmarkets) and I would like to get the
> value of the "Mktname" column for all the rows in this datawindow.  Can
> anyone help me?
>
> dw_trafficmarkets
> *************
> *  Chicago       *
> *  New York   *
> *  Atlanta         *
> *  Etc.              *
> *************
>
> I need to get all the values from the above data window and then use
> them to select a list of products from a table where the markets equal
> the markets contained within dw_trafficmarkets.
> Therefore, can anyone help me learn how to get those retrieved values
> and then use them to get the necessary rows from my table?
>
> Any and all help is truly appreciated.  Thanks in Advance.
>
> -- Rodney
>
> P.S. Sorry if I sound redundant.  I just want to be clear as possible.

0
Ben
7/30/1999 8:02:17 PM
As long as you are OK with the number of the rows (i.e. you are not
overflowing the integer) and use PB6. and up, you will be absolutely fine
with dot notation for accesing column data. I use it all the time without
ANY problems whatsoever...

Ben Gong <dazhig@yahoo.com> wrote in message
news:37A204C9.DD6DB0E9@yahoo.com...
> Thom is right, You are probably safer to just use a loop and use
> dw_1.GetItemString() to store the value in an array. I have had crashes
> with the dot method and since never want to use it any more. The loop
> actually goes very fast. Here is what you do if you want the loop:
> ll_rowcount = dw_1.RowCount()
> FOR ll_count = 1 TO ll_rowcount
>     array[ll_count] = dw_1.GetItemString(ll_count, "your colname")
> NEXT

0
Philip
7/30/1999 8:10:28 PM
Reply:

Similar Artilces:

Choosing between two column values to return as single column value
I'm working on a social network where I store my friend GUIDs in a table with the following structure:user1_guid       user2_guidI am trying to write a query to return a single list of all a users' friends in a single column.  Depending on who initiates the friendship, a users' guid value can be in either of the two columns.  Here is the crazy sql I have come up with to give what I want, but I'm sure there's a better way...  Any ideas?SELECT DISTINCT UserIdFROM espace_ProfilePropertyWHERE (UserId IN ...

Datawindow column getting previous value
Hi, Is anyone know how to set the original value after inputting different value? My code is pd_amt = This.Object.amount.original[row] but still it gets the value that I just typed/input. What I need to get is the previous one. Let say the previous value of dw column amount is 50 then I change it into 100 I need to validate the value that I input to another value . This is my code for validating the values. if the inputted value is greater than the value that I am comparing with the dw amount column should be back to its previous value. IF Dec(data) > ld_cur T...

How to get the column header value in the datawindow
Hi All I had problem regarding the column header number in datawindow . I mean that i want to get the column header value whenever i click on the column header, i was able to get the column header name with ("dwo.name"). Is there any chance of getting the column header value with dwo or other event plz help me thanks Assuming the header is a static text object, dwo.Text "venu" <pkkrao1@rediffmail.com> wrote in message news:YBc1M7n2CHA.263@forums.sybase.com... > Hi All > > I had problem regarding the column header number in datawindow . ...

How to get a single value(column) from a dataset
HI guysPlease help me, i have a page with a datagrid(gets the values from a dataset). And i have another  dataset from which i want to only display the value of one column from it.How do i do that in the code behind? Thank you :chomp: Thank you,i got itdatatable = dataset.Tables(0)datarow = datatable.Rows(0)lblLabel1.Text = CStr(datarow("column you want")) 'this is if you want it on a label...

How to get crosstab datawindow column value
my problem How to get crosstab datawindow column value Hi Wisdom, Try dot notation. There is a good possibility to show data as well: MessageBox( "Data", dw_Crosstab.Describe( "DataWindow.Data" ) ) Alexander Wisdom Pan schrieb: > my problem > > How to get crosstab datawindow column value don't forget to set the statis property to TRUE, before trying to access the dynamically generated columns. "Wisdom Pan" <pan_steve@hotmail.com> wrote in message news:jB9UYNty$GA.110@forums.sybase.com... my problem How to g...

Matching each value out of multiple values to single column value
 Hi,  @whoposted in stored procedure holds value "agent  builder owner"  ( please note the space in between) My column  POSTED_BY  always holds one and only one value out of above 3.Example:       POSTED_BY  owneragent          etc... If  All / any of the value hold by  @whoposted matches with value of POSTED_BY column, i want to show that row in gridview.( Also, please note, str may hold different values depending on user selection. For example, it may ...

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

To get decimal value from assigned column in datawindow
I given the following sql for a datawindow SELECT sales.id, sales.amt, sales.rate, 0.00 as totalsales from sales totalsales is the column which is not a database column and the value will be stored as talsales = amt*rate. I already given column format 0.00 using editmask propery of the datawindow column. Still it is ignoring the decimal part from the value. For example if the total sales value is 300.50 , it would give 300.00. I know that computed column will work. Can anyone please let me know to use dummy decimal column to store the value including decim...

How do I extract a single value from a single column in a single row in a dataset?
First of all, thank you to everyone who takes time to answer basic questions in this forum. Your patience is deeply appreciated. For the past day, I've been trying to figure out how to access a single value in a row of a data set. The data layer tutorials by Scott Mitchell are helpful, but I still can't figure out how to extract a single value without looping through the data set. By passing a Client_ID to an instance of my data adapter, I am able to return a unique row that contains a column labeled Family_ID. However, I can't figure out how to access the value of that column on...

How do you get a column value from a gridview column
How do you get a column value from a gridview column in asp.net 3.5? I tried this but it does not work.Dim myRow As GridViewRowFor Each myRow In GridView1.Rows    Dim strTest As String = DataBinder.Eval(myRow.DataItem, "EmailSubject")Nextif I change the column to a Template field then EmailSubject = myRow.FindControl("EmailSubject") works but I was hoping for a more direct way of getting a column value EmailSubject = myRow.Cells(4).Text also works but is not flexible if I change the column orderThanks Craig Try: Dim strTest As String = CType(...

How can I get the value of one single column from a DataSet/DataView?
I have a DataSet or DataView that contains a bunch of info. I can filter down to one row using .RowFilter on the DataView. I want to simply populate a label with the string value of column "A" for example. This should be easy, but I am struggling with it. Any suggestions?--[_]-[_]--AGENT_SMITH Well a dataview is going to give a Row of data.... It's up to you to just bind or fetch the single column that you are looking for.... Here is an example of some code that I use to fetch from the ASP.Cache object a readonly dataview.... and use it as the datasource for ...

How to get an array of a single column value from oracle table using visual web developer.
I want to get an array of values stored of a single column from oracle table using visual web developer. I want to use these values one by one to make a marker on map. Or is there any way to use values of a drop down list one by one for assigning marker to them? any help ..?.. thanks   you can use for each, like:  for each LItem as ListItem in dropdown1.Items' here you can access the value of the item, Litem.value Next ...

How to get GridView column values while looping through the columns?
Hi everybody, I'm trying to figure out how can I get values from DataFields while  looping through the Grid rows. Here is what I'm trying to do:GridViewRow row = null; for (int i = 0; i < this.ProfilesGrid.Rows.Count; i++ ) {row = this.ProfilesGrid.Rows[i];   CheckBox chkbtnApproved = row.FindControl("chkApproved") as CheckBox ;if (chkbtnApproved != null) {if (chkbtnApproved.Checked == true) {int RegID = (int)this.ProfilesGrid.DataKeys[i].Value ;   //PersonName = row.DataItem["FirstName"] + " " + row.DataItem["LastNam...

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

Web resources about - Getting value of a single column - sybase.powerbuilder.datawindow

US celebrities back 'Dump Trump' campaign
Prominent actors, writers and thinkers joined a "Stop Hate Dump Trump" campaign to denounce the billionaire Republican presidential frontrunner, ...

Remains of the Day: Apple Revamps GarageBand for iOS
Chrome has a new compression algorithm that should soon add some pep to your browsing, Apple caters to musicians with some new apps today, Yik ...

Hearst’s Digital Media Maven on Dr. Oz, Lena Dunham and Trusting Your Gut
It was a bustling scene at Michael’s today with the media mob out in full force. Among the sea of usual suspects, I spotted the late arriving ...

Cue Darth Vader scream! 'Star Wars: Episode VIII' delayed to late 2017
Fans eager for the next Star Wars film will have to wait a bit longer. Disney confirms that "Episode VIII" won't open in theaters until December ...

Obama anger at Michigan water crisis
President Barack Obama expressed anger Wednesday at a high-profile health scare in Flint, Michigan, where lead-tainted water is believed to have ...

Pakistan attack: 25 killed as Taliban militants storm Bacha Khan University
Taliban militants attacked Pakistan's Bacha Khan University in Charsadda, northwestern Khyber Pakhtunkhwa province, early today. At least 25 ...

US stocks pare steep losses: Dow -1.6%
New York (AFP) - Wall Street stocks tumbled Wednesday as US oil prices sank to fresh 12-year lows, but an afternoon rally significantly cut the ...

Scientists may have just found a ninth planet and it’s massive
Scientists believe they may have found a giant planet in our distant solar system, possibly the long-sought after Planet X. It is believed to ...

Global Warming Effects Caused By Farmers 7,000 Years Ago, While Climate Change Scientists Claim 2015 ...
Global warming may have been started thousands of years ago by early humans. A new study blames the world’s first farmers for setting the effects ...

Nielsen will monitor Facebook to measure buzz about TV programs
Anyone who's logged onto social media during a presidential debate, big football game or TV premier knows the flurry of posts can be just as ...

Resources last updated: 1/21/2016 12:41:02 AM