Get Column Number Using Column Name

This ones burning me because, I am sure i've done it before and It's simply 
slipping my mind. 

I need to be able to get a column number using the column name.

i.e. Column name = 'effective_date'.

Using effective date - get the column number that belongs to effective 
date.

Any help is appreciated!!

Thanks!!
0
William_Shiers
11/13/2002 9:47:10 PM
sybase.powerbuilder.general 62418 articles. 14 followers. Follow

3 Replies
788 Views

Similar Articles

[PageSpeed] 18

William

dw.Describe("effective_date.ID")

Good Luck

Michael Walker
Cascadia Software

William_Shiers wrote:

> This ones burning me because, I am sure i've done it before and It's simply 
> slipping my mind. 
> 
> I need to be able to get a column number using the column name.
> 
> i.e. Column name = 'effective_date'.
> 
> Using effective date - get the column number that belongs to effective 
> date.
> 
> Any help is appreciated!!
> 
> Thanks!!
> 

0
Michael
11/13/2002 9:48:23 PM
Assuming you example of Column_Name = "effective_date"

Try...

Integer          li_ID

li_ID            = Integer(dw.Describe(Column_Name + ".ID"))
0
cjharris
11/13/2002 10:37:16 PM
Great!! Thanks!
0
William_Shiers
11/13/2002 10:40:32 PM
Reply:

Similar Artilces:

How to use a full column name (table name and column name) with a DataReader
Hi, I have a problem retrieving the data with a DataReader from a stored proc that performs a join of two table with the same column's names but different data. Let me explain with an example: I have two tables: Table1: Id, Name Table2: Id, Name, IdTable1 The sproc is something like this: CREATE PROCEDURE [dbo].[SearchByName] (@Name nvarchar(40)) AS BEGIN SELECT * FROM dbo.Table1, dbo.Table2 WHERE Table1.Id = Table2.IdTable1 AND Table1.Name LIKE '%' + @Name + '%' END And my c# code is something like this: Database db = Databas...

Get a columns column number
Hi All. How do I get the number of a column in a datawindow (PB9.0). The best I can come up with is as follows (there must be a simpler way!). n_cst_string lnv_cst_string String ls_columns Long ll_pos2, ll_columnNo ls_columns = idw_dw.Describe( 'datawindow.table.columns' ) ll_columnNo = 0 ll_pos2 = Pos(ls_columns, ls_columnName) If ll_pos2 > 0 Then ll_columnNo = inv_cst_string.of_CountOccurrences(Left(ls_columns, ll_pos2 - 1) , '~t', TRUE) + 1 dw_1.setItem(ll_newRow, 'intcolumnno', ll_columnNo) Thanks MB. You want the "ID" property,...

Get highest number from a Column by Passing Table/ Column Name as Parametre: Stored Procedure
Hi experts, I want to fetch the Maximum ID + 1, of a Column( say Max ID = 7 currently so query should return 8)  , & I want to do it for many table  I m using set ANSI_NULLS ON set QUOTED_IDENTIFIER ON go     ALTER PROCEDURE [dbo].[SP_GENERATEID] ( @TableName VarChar(50),@ColumnName numeric(10, 0) ) ASset nocount on set ansi_warnings off DECLARE @sql nvarchar(2000) SET @sql = 'select isNull(MAX('+ @ColumnName+'),'+ 0 + ')'+ 1 + 'from'+ @TableName EXEC (@sql)   My store procedure is ready but when I...

Need query to get distinct column name and details based on that column using sql server 2000
hi, iam having three tables as shown below table 1                                                      table 2                                     &...

Get Name of DW Identity Column (column.identity property requires looping thru all columns)
I need to locate the identity column for a DW. Only method i see is use of the columnName.Idenity property - which requires you to traverse all the DW columns and then look up the identity property for each until one is yes. Is there a way just to get the identity column directly - or the Primary Key. thanks, Dave As one can see in he syntax, sorry no. I played around with it this week also as I am using DW.Net2.0 with DataSets and a DataSet can not create update commands from a SQL statements where one has 2 tables. But, now, with the help of DW.Net it can do it ...

DW Designer Column Name vs. Database Column name use in expressions
Can you access the DW Designer column name in expressions (I have used the database column name, but have had no luck figuring out how to access the Designer column name). thanks, David I'm not sure you can. What are you trying to accomplish? There might be another way of doing it. Regards, Dave Fish Sybase TechWave 2005! www.sybase.com/techwave Download an evaluation version of DataWindow .NET 1.5 Today!: www.sybase.com/datawindow.net DataWindow.NET code examples available on CodeXchange: http://datawindownet.codexchange.sybase.com PowerBuilder 10.5 Bet...

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

Searching all columns without using column name
Hi, I am developing a search engine for my application and I need to grab the entire row from the table if I found the search field in any of the columns and the search is not defined to one table. Please let me know how to search all columns in table without using column names indivdually. If the data is in a DataSet, you can access rows and columns using indexes: myDS.Tables[0].Rows[0][0] will get the first row, first column. .Rows and .Columns have a .Count property that can allow you to get all columns and rows: if ( myDS.Tables.Count>0 ) { for ( int loop...

Getting the column number when clicking on a column header
How can I get the column number when I click on a column header in a grid/tabular datawindow? I need the column number because I want to sort the column Ascending/Descending when clicking on the header. (I cannot presume that the column header has the name xxx_t!) -- Tone Hansen ADB systermer ASA e-mail: th@adbsys.no Tone Hansen wrote in message <01bcda30$3f804eb0$a75d13c2@ws_pro_th>... >How can I get the column number when I click on a column header in a >grid/tabular datawindow? > >I need the column number because I want to sort the column >Ascending/...

Get name of column by number
HI, We try to determine the name of the column in the RButtonClicked Event handler of our dataWindow control. The GetColumnClicked() funktion provides the number of the column at which the right mouse button has been clicked. We havn't yet found a possibility to get the name of the column by this number( we need the columns name since we want to sort our data by this column). Does anyone has an idea of how to do this? Thanks a lot, regards, Stefan The name of the object clicked upon can be reached by using dwo.name which is an argument of the rbuttondown event. ...

How to get column number from name
How can I get column number , I know the column name. dot notation requires hard coding of columname like dw_1.Object.columnname {.buffer } {.datasource } { [ rownum ] } But I want to pass this column name as input. ? use getitem function (getitemdate(),getitemstring()...) or int li_columncount,li_i sring ls_colname li_columncount = long(this.Object.DataWindow.Column.Count) for li_i=1 to li_columncount ls_colname = this.describe("#"+string(li_i)+".name) next <PK> wrote in message news:43b24e28.2fa.1681692777@sybase.com... &g...

how do i get the column i want if result has two columns with the same name?
 let's say my select command returns two columns with the same name "Id".(those two columns are from different tables) so would it be possible to get the data from the second column if i don't use the index? thanks in advance   Try to use alias: SELECT table1.id as id1, table2.id as id2, othercolumn from......Limno...

validation message using column label, not column name
win2k / pb8.01 When I forget to enter a required value on a dw, I get a MessageBox like this Required value missing for COLUMN NAME on row N Please enter a value For legacy reasons my column name is called lineval and can't be changed I have set a column label in the datawindow painter to "Line Value" which would look a lot nicer in an error message. Is there anyway to specify in the dw to use the column label instead of the column name in the error message ? thanks Alex Well that's not a PB-generated error, so it must be in your code somewhere...

IM 9.0
Hi, I am using InfoMaker 9.0 Build 5507. In my PBL file, I create a new Freeform object. Then I choose SQL Select to select the table and the columns. In the Reports view, in the Column Specifictions tab, there is a "DB Name" column which shows the column name in "table_name.column_name" format. When a column name ends with a number (i.e. street1), the table name does not get prefixed in the Column Specification tab. For example, it displays "street1" instead of "mytable.street1". Has anyone else encountered this problem before? Please h...

Web resources about - Get Column Number Using Column Name - sybase.powerbuilder.general

Politics, Political News - The Capitol Column
Covering the politics of science, technology, business, entertainment, Capitol Hill, and health.

Column vector - Wikipedia, the free encyclopedia
... unclear because it lacks inline citations . Please improve this article by introducing more precise citations. In linear algebra , a column ...

Column 8
Are you the sort of person who collects board riders in your pantry for possible future consumption? If so, Margaret Combley, of Maclean, has ...

Column 8
Ah, Boxing Day &ndash; when the ruins of Yuletide feasts and ransacked cellars are flensed&#8203; and gargled, cricketers and sailors bake in ...

Becoming The Perfect Faculty Member: An Advice Column
What is tenure all about? Selfish preservation of yourself without regard to the institution, of course.

An NYT ‘Weddings’ Column for the Ages
About the only thing missing from Jamie Diamond ’s epic backgrounder on the Dec. 5 Los Angeles wedding of comedienne Carol Leifer and real estate ...

This Column Nails It
“ How Racists Talk About Tamir Rice “: For as long as I’ve been a newspaper columnist — 13 years and counting — I’ve been on the receiving end ...

Patt Rall Column: The arts and Bemidji go hand in hand
Bemidji Pioneer Patt Rall Column: The arts and Bemidji go hand in hand Bemidji Pioneer Watching Bridget O' Sullivan fulfilling her ambition ...


Tim O'Sullivan column:
Concord Monitor Tim O' Sullivan column: Concord Monitor Danny Ainge needs to acquire more talent. Young players like Smart and Olynyk need ...

Resources last updated: 1/1/2016 8:04:39 PM