Sybase NNTP forums - End Of Life (EOL)

The NNTP forums from Sybase - forums.sybase.com - are now closed.

All new questions should be directed to the appropriate forum at the SAP Community Network (SCN).

Individual products have links to the respective forums on SCN, or you can go to SCN and search for your product in the search box (upper right corner) to find your specific developer center.

Datawindow Column Name

3 posts in DataWindow Last posting was on 2009-10-14 17:56:53.0Z
Bazza Posted on 2009-10-14 16:29:18.0Z
From: Bazza <lmugnai@gmail.com>
Newsgroups: sybase.public.powerbuilder.datawindow
Subject: Datawindow Column Name
Date: Wed, 14 Oct 2009 09:29:18 -0700 (PDT)
Organization: http://groups.google.com
Lines: 8
Message-ID: <2c94ec9b-5ea7-44a2-9bac-f771e6ddd46c@o41g2000yqb.googlegroups.com>
NNTP-Posting-Host: 82.152.73.234
Mime-Version: 1.0
Content-Type: text/plain; charset=ISO-8859-1
X-Trace: posting.google.com 1255537758 8497 127.0.0.1 (14 Oct 2009 16:29:18 GMT)
X-Complaints-To: groups-abuse@google.com
NNTP-Posting-Date: Wed, 14 Oct 2009 16:29:18 +0000 (UTC)
Complaints-To: groups-abuse@google.com
Injection-Info: o41g2000yqb.googlegroups.com; posting-host=82.152.73.234; posting-account=LXBxRgoAAAB8RY7zdGY8Jb_Z9dzqYdWv
User-Agent: G2/1.0
X-HTTP-Via: 1.1 CINTRA-ISA
X-HTTP-UserAgent: Mozilla/5.0 (Windows; U; Windows NT 5.0; en-GB; rv:1.9.0.10) Gecko/2009042822 Firefox/3.0.10 GTB5,gzip(gfe),gzip(gfe)
Path: forums-1-dub!forums-master!newssvr.sybase.com!news-sj-1.sprintlink.net!news-peer1.sprintlink.net!nntp1.phx1.gblx.net!nntp.gblx.net!nntp.gblx.net!newsfeed.news2me.com!news.glorb.com!news2.glorb.com!postnews.google.com!o41g2000yqb.googlegroups.com!not-for-mail
Xref: forums-1-dub sybase.public.powerbuilder.datawindow:90081
Article PK: 409687

Hi,

Is it possible to get a datawindow's column name from it's dbname. I
need do a find on the datawindow using the column name but since our
column names are created dynamically i.e col1, col2 etc i need to find
the corresponding column name to it's dbname.

Thanks


Ivaylo Ivanov Posted on 2009-10-14 17:53:43.0Z
From: "Ivaylo Ivanov" <n0_S_p_a_m_i.ivanov@isy-dc.com>
Newsgroups: sybase.public.powerbuilder.datawindow
References: <2c94ec9b-5ea7-44a2-9bac-f771e6ddd46c@o41g2000yqb.googlegroups.com>
Subject: Re: Datawindow Column Name
Lines: 48
X-Priority: 3
X-MSMail-Priority: Normal
X-Newsreader: Microsoft Outlook Express 6.00.2900.5843
X-MimeOLE: Produced By Microsoft MimeOLE V6.00.2900.5579
X-RFC2646: Format=Flowed; Original
NNTP-Posting-Host: vip152.sybase.com
X-Original-NNTP-Posting-Host: vip152.sybase.com
Message-ID: <4ad61027$1@forums-1-dub>
Date: 14 Oct 2009 10:53:43 -0700
X-Trace: forums-1-dub 1255542823 10.22.241.152 (14 Oct 2009 10:53:43 -0700)
X-Original-Trace: 14 Oct 2009 10:53:43 -0700, vip152.sybase.com
Path: forums-1-dub!not-for-mail
Xref: forums-1-dub sybase.public.powerbuilder.datawindow:90083
Article PK: 409688

I'm not getting entirely what you're trying to achieve, but here are some
hints.

When you create a datawindow from a SQL Select statement for each of the db
columns from your statement PB generates corresponding DW column (control).
If you observe the Column Specification pane in the Datawindow Painter,
you'll notice that each DW column has unique index (starting from 1) which
shows the position of this column in the SQL Select statement. It is
possible to call:

long ll_col_cnt, i

// total number of columns in your query
ll_col_cnt = dw_control.Describe("Datawindow.Column.Count")

// show the name corresponding to each column index:
for i = 1 to ll_col_cnt
MessageBox("Column " + string(i), dw_control.Describe("#" + string(i) +
".Name"))
next

You also have dbName and dbAlias properties for each column which would
probably be of some help in your case:

for i = 1 to ll_col_cnt
MessageBox("dbName for Column " + string(i),
dw_control.Describe(dw_control.Describe("#" + string(i) + ".Name") +
".dbName"))
MessageBox("dbAlias for Column " + string(i),
dw_control.Describe(dw_control.Describe("#" + string(i) + ".Name") +
".dbAlias"))
next

Good luck!
Ivaylo

"Bazza" <lmugnai@gmail.com> wrote in message
news:2c94ec9b-5ea7-44a2-9bac-f771e6ddd46c@o41g2000yqb.googlegroups.com...
> Hi,
>
> Is it possible to get a datawindow's column name from it's dbname. I
> need do a find on the datawindow using the column name but since our
> column names are created dynamically i.e col1, col2 etc i need to find
> the corresponding column name to it's dbname.
>
> Thanks


Ivaylo Ivanov Posted on 2009-10-14 17:56:53.0Z
From: "Ivaylo Ivanov" <n0_S_p_a_m_i.ivanov@isy-dc.com>
Newsgroups: sybase.public.powerbuilder.datawindow
References: <2c94ec9b-5ea7-44a2-9bac-f771e6ddd46c@o41g2000yqb.googlegroups.com> <4ad61027$1@forums-1-dub>
Subject: Re: Datawindow Column Name
Lines: 59
X-Priority: 3
X-MSMail-Priority: Normal
X-Newsreader: Microsoft Outlook Express 6.00.2900.5843
X-MimeOLE: Produced By Microsoft MimeOLE V6.00.2900.5579
X-RFC2646: Format=Flowed; Response
NNTP-Posting-Host: vip152.sybase.com
X-Original-NNTP-Posting-Host: vip152.sybase.com
Message-ID: <4ad610e5@forums-1-dub>
Date: 14 Oct 2009 10:56:53 -0700
X-Trace: forums-1-dub 1255543013 10.22.241.152 (14 Oct 2009 10:56:53 -0700)
X-Original-Trace: 14 Oct 2009 10:56:53 -0700, vip152.sybase.com
Path: forums-1-dub!not-for-mail
Xref: forums-1-dub sybase.public.powerbuilder.datawindow:90084
Article PK: 409690

Correction of my example:

// total number of columns in your query
ll_col_cnt = LONG(dw_control.Describe("Datawindow.Column.Count"))

Sorry :-)

"Ivaylo Ivanov" <n0_S_p_a_m_i.ivanov@isy-dc.com> wrote in message
news:4ad61027$1@forums-1-dub...
> I'm not getting entirely what you're trying to achieve, but here are some
> hints.
>
> When you create a datawindow from a SQL Select statement for each of the
> db columns from your statement PB generates corresponding DW column
> (control). If you observe the Column Specification pane in the Datawindow
> Painter, you'll notice that each DW column has unique index (starting from
> 1) which shows the position of this column in the SQL Select statement. It
> is possible to call:
>
> long ll_col_cnt, i
>
> // total number of columns in your query
> ll_col_cnt = dw_control.Describe("Datawindow.Column.Count")
>
> // show the name corresponding to each column index:
> for i = 1 to ll_col_cnt
> MessageBox("Column " + string(i), dw_control.Describe("#" + string(i) +
> ".Name"))
> next
>
> You also have dbName and dbAlias properties for each column which would
> probably be of some help in your case:
>
> for i = 1 to ll_col_cnt
> MessageBox("dbName for Column " + string(i),
> dw_control.Describe(dw_control.Describe("#" + string(i) + ".Name") +
> ".dbName"))
> MessageBox("dbAlias for Column " + string(i),
> dw_control.Describe(dw_control.Describe("#" + string(i) + ".Name") +
> ".dbAlias"))
> next
>
> Good luck!
> Ivaylo
>
> "Bazza" <lmugnai@gmail.com> wrote in message
> news:2c94ec9b-5ea7-44a2-9bac-f771e6ddd46c@o41g2000yqb.googlegroups.com...
>> Hi,
>>
>> Is it possible to get a datawindow's column name from it's dbname. I
>> need do a find on the datawindow using the column name but since our
>> column names are created dynamically i.e col1, col2 etc i need to find
>> the corresponding column name to it's dbname.
>>
>> Thanks
>
>