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.

Dynamically create DW column

3 posts in DataWindow Last posting was on 2009-09-30 20:57:35.0Z
Phil Hall Posted on 2009-09-30 18:16:45.0Z
Sender: 24a0.4ac37e26.1804289383@sybase.com
From: Phil Hall
Newsgroups: sybase.public.powerbuilder.datawindow
Subject: Dynamically create DW column
X-Mailer: WebNews to Mail Gateway v1.1t
Message-ID: <4ac3a08d.2bf7.1681692777@sybase.com>
NNTP-Posting-Host: 10.22.241.41
X-Original-NNTP-Posting-Host: 10.22.241.41
Date: 30 Sep 2009 11:16:45 -0700
X-Trace: forums-1-dub 1254334605 10.22.241.41 (30 Sep 2009 11:16:45 -0700)
X-Original-Trace: 30 Sep 2009 11:16:45 -0700, 10.22.241.41
Lines: 22
Path: forums-1-dub!not-for-mail
Xref: forums-1-dub sybase.public.powerbuilder.datawindow:90022
Article PK: 409628

In PB 10.5, is it possible to dynamically create a column
within a datawindow that has already been connected to the
DB?

I've tried the modify function with text such as:

dw_1.modify(ls_modify)

where:

ls_modify = "create column(id=X name=new_column_x
band=detail alignment="0"..."

When X is less than or equal to the number of columns in the
datawindow then the modify processes without error (the
created column is a duplicate of the column with id=X).

When X is greater than the number of columns in the
datawindow (code objective) an error is returned.

Similar modify code works without error to create other DW
objects such as text.


"Jerry Siegel [TeamSybase]" <jNOsSPAMsiegel Posted on 2009-09-30 19:49:56.0Z
From: "Jerry Siegel [TeamSybase]" <jNOsSPAMsiegel@yahoo!.com>
Newsgroups: sybase.public.powerbuilder.datawindow
References: <4ac3a08d.2bf7.1681692777@sybase.com>
Subject: Re: Dynamically create DW column
Lines: 54
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: <4ac3b664$1@forums-1-dub>
Date: 30 Sep 2009 12:49:56 -0700
X-Trace: forums-1-dub 1254340196 10.22.241.152 (30 Sep 2009 12:49:56 -0700)
X-Original-Trace: 30 Sep 2009 12:49:56 -0700, vip152.sybase.com
X-Authenticated-User: TeamSybase
Path: forums-1-dub!not-for-mail
Xref: forums-1-dub sybase.public.powerbuilder.datawindow:90025
Article PK: 409636

It isn't a question of connected, it's about how you do the modify. <donning
cap and gown and standing at whiteboard>
There are actually three places in the DW syntax where a column may be
referred to. You can see them in the Edit Source view or in an export of the
DW syntax:
(1) the visual column object, which is what you are creating with the the
modify below. There does not have to be a visual object for a column in the
buffer definition.
(2) the buffer definition, which is part of the table( part of the syntax
(you see this in the Column Specification tab); and
(3) the SQL, also in the table( syntax , the retrieve= keyword. This
definition is optional, omitting it results in an External DW.

The ID= keyword in the visual object phrase points to a column( in the
buffer definition, sequentially. So, if you try to point to an ID that is
greater than the number of buffer columns, of course you get an error.

The good news is that you can replace the table( part of the syntax in order
to add a column to the buffers. The bad news is that Modify does not handle
that explicitly as it does with the SQL select. You would need to parse,
massage, and replace the entire table=. I have done that - it's a PITA but
it does work.

--
Report Bugs to Sybase: http://case-express.sybase.com/cx/welcome.do
Product Enhancement Requests:
http://my.isug.com/cgi-bin/1/c/submit_enhancement

<Phil Hall> wrote in message news:4ac3a08d.2bf7.1681692777@sybase.com...
> In PB 10.5, is it possible to dynamically create a column
> within a datawindow that has already been connected to the
> DB?
>
> I've tried the modify function with text such as:
>
> dw_1.modify(ls_modify)
>
> where:
>
> ls_modify = "create column(id=X name=new_column_x
> band=detail alignment="0"..."
>
> When X is less than or equal to the number of columns in the
> datawindow then the modify processes without error (the
> created column is a duplicate of the column with id=X).
>
> When X is greater than the number of columns in the
> datawindow (code objective) an error is returned.
>
> Similar modify code works without error to create other DW
> objects such as text.