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.

datastore won't update

2 posts in DataWindow Last posting was on 2009-03-17 13:18:46.0Z
norb Posted on 2009-03-17 11:42:09.0Z
From: "norb" <no@email.com>
Newsgroups: sybase.public.powerbuilder.datawindow
Subject: datastore won't update
Lines: 18
MIME-Version: 1.0
Content-Type: text/plain; format=flowed; charset="iso-8859-1"; reply-type=original
Content-Transfer-Encoding: 7bit
X-Priority: 3
X-MSMail-Priority: Normal
X-Newsreader: Microsoft Windows Mail 6.0.6001.18000
X-MimeOLE: Produced By Microsoft MimeOLE V6.0.6001.18049
NNTP-Posting-Host: vip152.sybase.com
X-Original-NNTP-Posting-Host: vip152.sybase.com
Message-ID: <49bf8c91$1@forums-1-dub>
Date: 17 Mar 2009 03:42:09 -0800
X-Trace: forums-1-dub 1237290129 10.22.241.152 (17 Mar 2009 03:42:09 -0800)
X-Original-Trace: 17 Mar 2009 03:42:09 -0800, vip152.sybase.com
Path: forums-1-dub!not-for-mail
Xref: forums-1-dub sybase.public.powerbuilder.datawindow:88974
Article PK: 418224

Hi,

I use a datastore to fill it from an XML file. After importfile is done, I
issue a ds_data.update() command which results in -1.

sqlerrortext shows SQLSTATE = 23000, primary key for table is not unique,
which is correct since there are only changes in the other fields, not in
the primary key field.

I though that an update would do an update not an insert, as the
sqlerrortext shows. Should it be done differently? Deleting the contents of
the table and issuing an update would do, but ...

I used to do the same on PB v9 and it worked, now using PB v11.5, with SQL
Anywhere v11

Norb


Chris Werner Posted on 2009-03-17 13:18:46.0Z
From: "Chris Werner" <cwAT{PleaseNoSpam}f-s.de>
Newsgroups: sybase.public.powerbuilder.datawindow
References: <49bf8c91$1@forums-1-dub>
Subject: Re: datastore won't update
Lines: 37
X-Priority: 3
X-MSMail-Priority: Normal
X-Newsreader: Microsoft Outlook Express 6.00.2900.5512
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: <49bfa336@forums-1-dub>
Date: 17 Mar 2009 05:18:46 -0800
X-Trace: forums-1-dub 1237295926 10.22.241.152 (17 Mar 2009 05:18:46 -0800)
X-Original-Trace: 17 Mar 2009 05:18:46 -0800, vip152.sybase.com
Path: forums-1-dub!not-for-mail
Xref: forums-1-dub sybase.public.powerbuilder.datawindow:88976
Article PK: 418227

Hi Norb,

if you are sure that all imported records already exist in the
table, you can simply change the dwItemStatus for all rows
from newModified! to dataModified!. Keep in mind that
this state change may need a little indirection because not
all changes are directly allowed.

If you are in doubt wether a record exists or not, you'd have
to check that and change the dwItemStatus only for the
existing rows.

HTH

Chris Werner
f+s software gmbh

"norb" <no@email.com> schrieb im Newsbeitrag news:49bf8c91$1@forums-1-dub...

> Hi,
>
> I use a datastore to fill it from an XML file. After importfile is done, I
> issue a ds_data.update() command which results in -1.
>
> sqlerrortext shows SQLSTATE = 23000, primary key for table is not unique,
> which is correct since there are only changes in the other fields, not in
> the primary key field.
>
> I though that an update would do an update not an insert, as the
> sqlerrortext shows. Should it be done differently? Deleting the contents
> of the table and issuing an update would do, but ...
>
> I used to do the same on PB v9 and it worked, now using PB v11.5, with SQL
> Anywhere v11
>
> Norb