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.

Copy dw2 to dw1 AND save dw1 to the database

4 posts in DataWindow Last posting was on 2010-01-04 15:32:01.0Z
Marco Meoni Posted on 2010-01-02 09:17:30.0Z
Sender: 3a6e.4b39aea4.1804289383@sybase.com
From: Marco Meoni
Newsgroups: sybase.public.powerbuilder.datawindow
Subject: Copy dw2 to dw1 AND save dw1 to the database
X-Mailer: WebNews to Mail Gateway v1.1t
Message-ID: <4b3f0f29.68a2.1681692777@sybase.com>
NNTP-Posting-Host: 10.22.241.41
X-Original-NNTP-Posting-Host: 10.22.241.41
Date: 2 Jan 2010 01:17:30 -0800
X-Trace: forums-1-dub 1262423850 10.22.241.41 (2 Jan 2010 01:17:30 -0800)
X-Original-Trace: 2 Jan 2010 01:17:30 -0800, 10.22.241.41
Lines: 25
Path: forums-1-dub!not-for-mail
Xref: forums-1-dub sybase.public.powerbuilder.datawindow:90512
Article PK: 410117

Hi,&#8232;
is there any way to copy dw2 to dw1 AND commit data in dw1?
(Let's assume a single (unique) line in the dws)
I have many fields, hence I'd like to avoid dw1.InsertRow()
+ the tons of Get/SetItem(s).

Get/SetFullState seems a good starting point but I get stuck
at the time of saving dw1 to the database, i.e.
dw1.Update().

Essentially here below my idea. When dw_1.Update() is
called, PB spots
"Row changed between retrieve and update. No changes made to
database"

dw2.GetFullState(lb_blob)
dw1.SetFullState(lb_blob)
dw1.SetItem(1, 'mykey', newkey) // newkey is Max(mykey) + 1
dw1.Update()

I have also tried to pre-create an empty record in dw1, no
luck.

Thanks for your help.&#8232;
M.


Arthur Hefti Posted on 2010-01-02 10:42:27.0Z
From: "Arthur Hefti" <arthur@catsoft.ch>
Subject: Re: Copy dw2 to dw1 AND save dw1 to the database
Newsgroups: sybase.public.powerbuilder.datawindow
References: <4b3f0f29.68a2.1681692777@sybase.com>
User-Agent: XanaNews/1.18.1.6
NNTP-Posting-Host: vip152.sybase.com
X-Original-NNTP-Posting-Host: vip152.sybase.com
Message-ID: <4b3f2313@forums-1-dub>
Date: 2 Jan 2010 02:42:27 -0800
X-Trace: forums-1-dub 1262428947 10.22.241.152 (2 Jan 2010 02:42:27 -0800)
X-Original-Trace: 2 Jan 2010 02:42:27 -0800, vip152.sybase.com
Lines: 35
Path: forums-1-dub!not-for-mail
Xref: forums-1-dub sybase.public.powerbuilder.datawindow:90513
Article PK: 410118

The DataWindow assumes that your data is modified, through SetItem, and
tries to update the record in the database. You have to set the row
status to NewModified!. Check out the help about SetItemStatus.
Arthur
--

Marco Meoni wrote:

> Hi,&#8232;
> is there any way to copy dw2 to dw1 AND commit data in dw1?
> (Let's assume a single (unique) line in the dws)
> I have many fields, hence I'd like to avoid dw1.InsertRow()
> + the tons of Get/SetItem(s).
>
> Get/SetFullState seems a good starting point but I get stuck
> at the time of saving dw1 to the database, i.e.
> dw1.Update().
>
> Essentially here below my idea. When dw_1.Update() is
> called, PB spots
> "Row changed between retrieve and update. No changes made to
> database"
>
> dw2.GetFullState(lb_blob)
> dw1.SetFullState(lb_blob)
> dw1.SetItem(1, 'mykey', newkey) // newkey is Max(mykey) + 1
> dw1.Update()
>
> I have also tried to pre-create an empty record in dw1, no
> luck.
>
> Thanks for your help.&#8232;
> M.


Jason 'Bug' Fenter [TeamSybase] Posted on 2010-01-04 15:19:32.0Z
From: "Jason 'Bug' Fenter [TeamSybase]" <jason.fenter@teamsybase.com>
User-Agent: Mozilla/5.0 (Windows; U; Windows NT 5.1; en-US; rv:1.9.1.5) Gecko/20091204 Lightning/1.0b1pre Thunderbird/3.0
MIME-Version: 1.0
Newsgroups: sybase.public.powerbuilder.datawindow
Subject: Re: Copy dw2 to dw1 AND save dw1 to the database
References: <4b3f0f29.68a2.1681692777@sybase.com>
In-Reply-To: <4b3f0f29.68a2.1681692777@sybase.com>
Content-Type: text/plain; charset=ISO-8859-1; format=flowed
Content-Transfer-Encoding: 7bit
NNTP-Posting-Host: vip152.sybase.com
X-Original-NNTP-Posting-Host: vip152.sybase.com
Message-ID: <4b420704$1@forums-1-dub>
Date: 4 Jan 2010 07:19:32 -0800
X-Trace: forums-1-dub 1262618372 10.22.241.152 (4 Jan 2010 07:19:32 -0800)
X-Original-Trace: 4 Jan 2010 07:19:32 -0800, vip152.sybase.com
Lines: 32
X-Authenticated-User: TeamSybase
Path: forums-1-dub!not-for-mail
Xref: forums-1-dub sybase.public.powerbuilder.datawindow:90517
Article PK: 410122

As long as the column definitions are the same (including the order of
the columns within the definition), the RowsMove() command will give you
exactly what you want. RowsMove() automatically marks the rows as
NewModified!.

On 1/2/2010 3:17 AM, Marco Meoni wrote:
> Hi,&#8232;
> is there any way to copy dw2 to dw1 AND commit data in dw1?
> (Let's assume a single (unique) line in the dws)
> I have many fields, hence I'd like to avoid dw1.InsertRow()
> + the tons of Get/SetItem(s).
>
> Get/SetFullState seems a good starting point but I get stuck
> at the time of saving dw1 to the database, i.e.
> dw1.Update().
>
> Essentially here below my idea. When dw_1.Update() is
> called, PB spots
> "Row changed between retrieve and update. No changes made to
> database"
>
> dw2.GetFullState(lb_blob)
> dw1.SetFullState(lb_blob)
> dw1.SetItem(1, 'mykey', newkey) // newkey is Max(mykey) + 1
> dw1.Update()
>
> I have also tried to pre-create an empty record in dw1, no
> luck.
>
> Thanks for your help.&#8232;
> M.


Scott Morris Posted on 2010-01-04 15:32:01.0Z
From: "Scott Morris" <bogus@bogus.com>
Newsgroups: sybase.public.powerbuilder.datawindow
References: <4b3f0f29.68a2.1681692777@sybase.com>
Subject: Re: Copy dw2 to dw1 AND save dw1 to the database
Lines: 19
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: <4b4209f1$1@forums-1-dub>
Date: 4 Jan 2010 07:32:01 -0800
X-Trace: forums-1-dub 1262619121 10.22.241.152 (4 Jan 2010 07:32:01 -0800)
X-Original-Trace: 4 Jan 2010 07:32:01 -0800, vip152.sybase.com
Path: forums-1-dub!not-for-mail
Xref: forums-1-dub sybase.public.powerbuilder.datawindow:90519
Article PK: 410124


> Essentially here below my idea. When dw_1.Update() is
> called, PB spots
> "Row changed between retrieve and update. No changes made to
> database"
>
> dw2.GetFullState(lb_blob)
> dw1.SetFullState(lb_blob)
> dw1.SetItem(1, 'mykey', newkey) // newkey is Max(mykey) + 1
> dw1.Update()
>
> I have also tried to pre-create an empty record in dw1, no
> luck.

Maybe you need a pipeline? Alternatively, you can do what you want within a
single datawindow - you can manipulate the flags as Arthur described within
a single datawindow to force it to issue insert statements rather than
update statements.