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.

Problems with autoincrement after migrating from P9 to P10 or 11

4 posts in DataWindow Last posting was on 2008-12-05 20:03:14.0Z
Alfredo Santibáñez Posted on 2008-12-05 16:43:16.0Z
Reply-To: "Alfredo Santibáñez" <asantibanez@ng.co.cr>
From: "Alfredo Santibáñez" <asantibanez@ng.co.cr>
Newsgroups: sybase.public.powerbuilder.datawindow
Subject: Problems with autoincrement after migrating from P9 to P10 or 11
Lines: 38
Organization: RMO-NKG
X-Priority: 3
X-MSMail-Priority: Normal
X-Newsreader: Microsoft Outlook Express 6.00.2900.5512
X-RFC2646: Format=Flowed; Original
X-MimeOLE: Produced By Microsoft MimeOLE V6.00.2900.5579
NNTP-Posting-Host: vip152.sybase.com
X-Original-NNTP-Posting-Host: vip152.sybase.com
Message-ID: <49395a24$1@forums-1-dub>
Date: 5 Dec 2008 08:43:16 -0800
X-Trace: forums-1-dub 1228495396 10.22.241.152 (5 Dec 2008 08:43:16 -0800)
X-Original-Trace: 5 Dec 2008 08:43:16 -0800, vip152.sybase.com
Path: forums-1-dub!not-for-mail
Xref: forums-1-dub sybase.public.powerbuilder.datawindow:88313
Article PK: 417565

Hi,

I found the next strange problem after migrating an application from PB
9.0.3 (8004) to PB 10.2.1 (9948) and PB 11.2 (8407). Working with SQL
Server 2000, connection via OLE DB.

I have a tabular datawindow whith an autoincrement key, but after update,
the value returned to the datawindow, is not the value on the database. If
I issue a retrieve after the update, the values are corrected, but I need to
know if the row was new! or Datamodified!.

After trying several things in other tables and datawindows I found that on
this table I have a trigger that inserts a record on another table on each
insert. On that particular table, there is also an autoincrement field with
the same name of the one in the original table.

I found that my datawindow was filed with the value of the inserted record
by the trigger and not by the value of table updated on the datawindow.

Going back to PB9, with the same table and the same trigger, the problem
does not occurs.

After changing the name of the autoincrement field on the table created by
the trigger the problem disapeared.

I can work around the problem but, do you think this may be a Bug to report
to Sybase?

Regards
Alfredo Santibáñez


Scott Morris Posted on 2008-12-05 18:49:57.0Z
From: "Scott Morris" <bogus@bogus.com>
Newsgroups: sybase.public.powerbuilder.datawindow
References: <49395a24$1@forums-1-dub>
Subject: Re: Problems with autoincrement after migrating from P9 to P10 or 11
Lines: 49
X-Priority: 3
X-MSMail-Priority: Normal
X-Newsreader: Microsoft Outlook Express 6.00.2900.5512
X-RFC2646: Format=Flowed; Response
X-MimeOLE: Produced By Microsoft MimeOLE V6.00.2900.5579
NNTP-Posting-Host: vip152.sybase.com
X-Original-NNTP-Posting-Host: vip152.sybase.com
Message-ID: <493977d5$1@forums-1-dub>
Date: 5 Dec 2008 10:49:57 -0800
X-Trace: forums-1-dub 1228502997 10.22.241.152 (5 Dec 2008 10:49:57 -0800)
X-Original-Trace: 5 Dec 2008 10:49:57 -0800, vip152.sybase.com
Path: forums-1-dub!not-for-mail
Xref: forums-1-dub sybase.public.powerbuilder.datawindow:88314
Article PK: 417566


"Alfredo Santibáñez" <asantibanez@ng.co.cr> wrote in message
news:49395a24$1@forums-1-dub...
> Hi,
>
> I found the next strange problem after migrating an application from PB
> 9.0.3 (8004) to PB 10.2.1 (9948) and PB 11.2 (8407). Working with SQL
> Server 2000, connection via OLE DB.
>
> I have a tabular datawindow whith an autoincrement key, but after update,
> the value returned to the datawindow, is not the value on the database.
> If I issue a retrieve after the update, the values are corrected, but I
> need to know if the row was new! or Datamodified!.

Did you know that the itemstatus flags can tell you this same information?

> After trying several things in other tables and datawindows I found that
> on this table I have a trigger that inserts a record on another table on
> each insert. On that particular table, there is also an autoincrement
> field with the same name of the one in the original table.
>
> I found that my datawindow was filed with the value of the inserted record
> by the trigger and not by the value of table updated on the datawindow.
>
> Going back to PB9, with the same table and the same trigger, the problem
> does not occurs.
>
> After changing the name of the autoincrement field on the table created by
> the trigger the problem disapeared.

This may have "appeared" to correct the problem - one way it might
accidentally work is if this forced the identity seeds for the two tables to
now have the same value. However, this will only hide the issue for so
long - eventually the identity values of the two tables will diverge.

>
> I can work around the problem but, do you think this may be a Bug to
> report to Sybase?

You can control "how" PB retrieves the value of the identity column for
inserted rows. Refer to the pbodbxxx.ini file and replace the GetIdentity
line in the [MS_SQLSERVER_SYNTAX] section with:

GetIdentity='SELECT SCOPE_IDENTITY()'

By default, it will be set to 'Select @@identity' which is a known issue for
tables that have triggers inserting into other identity-based tables. Note
that you will need to deploy this file with your application.


Alfredo Santibáñez Posted on 2008-12-05 20:03:14.0Z
Reply-To: "Alfredo Santibáñez" <asantibanez@ng.co.cr>
From: "Alfredo Santibáñez" <asantibanez@ng.co.cr>
Newsgroups: sybase.public.powerbuilder.datawindow
References: <49395a24$1@forums-1-dub> <493977d5$1@forums-1-dub>
Subject: Re: Problems with autoincrement after migrating from P9 to P10 or 11
Lines: 58
Organization: RMO-NKG
X-Priority: 3
X-MSMail-Priority: Normal
X-Newsreader: Microsoft Outlook Express 6.00.2900.5512
X-RFC2646: Format=Flowed; Response
X-MimeOLE: Produced By Microsoft MimeOLE V6.00.2900.5579
NNTP-Posting-Host: vip152.sybase.com
X-Original-NNTP-Posting-Host: vip152.sybase.com
Message-ID: <49398902$1@forums-1-dub>
Date: 5 Dec 2008 12:03:14 -0800
X-Trace: forums-1-dub 1228507394 10.22.241.152 (5 Dec 2008 12:03:14 -0800)
X-Original-Trace: 5 Dec 2008 12:03:14 -0800, vip152.sybase.com
Path: forums-1-dub!not-for-mail
Xref: forums-1-dub sybase.public.powerbuilder.datawindow:88318
Article PK: 417571

Solved with GetIdentity='SELECT SCOPE_IDENTITY()'

Thanks
Alfredo

"Scott Morris" <bogus@bogus.com> escribió en el mensaje
news:493977d5$1@forums-1-dub...

> "Alfredo Santibáñez" <asantibanez@ng.co.cr> wrote in message
> news:49395a24$1@forums-1-dub...
>> Hi,
>>
>> I found the next strange problem after migrating an application from PB
>> 9.0.3 (8004) to PB 10.2.1 (9948) and PB 11.2 (8407). Working with SQL
>> Server 2000, connection via OLE DB.
>>
>> I have a tabular datawindow whith an autoincrement key, but after update,
>> the value returned to the datawindow, is not the value on the database.
>> If I issue a retrieve after the update, the values are corrected, but I
>> need to know if the row was new! or Datamodified!.
>
> Did you know that the itemstatus flags can tell you this same information?
>
>> After trying several things in other tables and datawindows I found that
>> on this table I have a trigger that inserts a record on another table on
>> each insert. On that particular table, there is also an autoincrement
>> field with the same name of the one in the original table.
>>
>> I found that my datawindow was filed with the value of the inserted
>> record by the trigger and not by the value of table updated on the
>> datawindow.
>>
>> Going back to PB9, with the same table and the same trigger, the problem
>> does not occurs.
>>
>> After changing the name of the autoincrement field on the table created
>> by the trigger the problem disapeared.
>
> This may have "appeared" to correct the problem - one way it might
> accidentally work is if this forced the identity seeds for the two tables
> to now have the same value. However, this will only hide the issue for so
> long - eventually the identity values of the two tables will diverge.
>
>>
>> I can work around the problem but, do you think this may be a Bug to
>> report to Sybase?
>
> You can control "how" PB retrieves the value of the identity column for
> inserted rows. Refer to the pbodbxxx.ini file and replace the GetIdentity
> line in the [MS_SQLSERVER_SYNTAX] section with:
>
> GetIdentity='SELECT SCOPE_IDENTITY()'
>
> By default, it will be set to 'Select @@identity' which is a known issue
> for tables that have triggers inserting into other identity-based tables.
> Note that you will need to deploy this file with your application.
>


Alfredo Santibáñez Posted on 2008-12-05 19:29:21.0Z
Reply-To: "Alfredo Santibáñez" <asantibanez@ng.co.cr>
From: "Alfredo Santibáñez" <asantibanez@ng.co.cr>
Newsgroups: sybase.public.powerbuilder.datawindow
References: <49395a24$1@forums-1-dub> <493977d5$1@forums-1-dub>
Subject: Re: Problems with autoincrement after migrating from P9 to P10 or 11
Lines: 70
Organization: RMO-NKG
X-Priority: 3
X-MSMail-Priority: Normal
X-Newsreader: Microsoft Outlook Express 6.00.2900.5512
X-RFC2646: Format=Flowed; Response
X-MimeOLE: Produced By Microsoft MimeOLE V6.00.2900.5579
NNTP-Posting-Host: vip152.sybase.com
X-Original-NNTP-Posting-Host: vip152.sybase.com
Message-ID: <49398111$1@forums-1-dub>
Date: 5 Dec 2008 11:29:21 -0800
X-Trace: forums-1-dub 1228505361 10.22.241.152 (5 Dec 2008 11:29:21 -0800)
X-Original-Trace: 5 Dec 2008 11:29:21 -0800, vip152.sybase.com
Path: forums-1-dub!not-for-mail
Xref: forums-1-dub sybase.public.powerbuilder.datawindow:88316
Article PK: 417578

Thanks,

> Did you know that the itemstatus flags can tell you this same information?
Yes I use it, but if I do a retrieve the status will be notmodified! for
just added rows and I guess would lost the delete! buffer.

> You can control "how" PB retrieves the value of the identity column for
> inserted rows. Refer to the pbodbxxx.ini file and replace the GetIdentity
> line in the [MS_SQLSERVER_SYNTAX] section with:
>
> GetIdentity='SELECT SCOPE_IDENTITY()'

I will test this

Regards
Alfredo

"Scott Morris" <bogus@bogus.com> escribió en el mensaje
news:493977d5$1@forums-1-dub...
> "Alfredo Santibáñez" <asantibanez@ng.co.cr> wrote in message
> news:49395a24$1@forums-1-dub...
>> Hi,
>>
>> I found the next strange problem after migrating an application from PB
>> 9.0.3 (8004) to PB 10.2.1 (9948) and PB 11.2 (8407). Working with SQL
>> Server 2000, connection via OLE DB.
>>
>> I have a tabular datawindow whith an autoincrement key, but after update,
>> the value returned to the datawindow, is not the value on the database.
>> If I issue a retrieve after the update, the values are corrected, but I
>> need to know if the row was new! or Datamodified!.
>
> Did you know that the itemstatus flags can tell you this same information?
>
>> After trying several things in other tables and datawindows I found that
>> on this table I have a trigger that inserts a record on another table on
>> each insert. On that particular table, there is also an autoincrement
>> field with the same name of the one in the original table.
>>
>> I found that my datawindow was filed with the value of the inserted
>> record by the trigger and not by the value of table updated on the
>> datawindow.
>>
>> Going back to PB9, with the same table and the same trigger, the problem
>> does not occurs.
>>
>> After changing the name of the autoincrement field on the table created
>> by the trigger the problem disapeared.
>
> This may have "appeared" to correct the problem - one way it might
> accidentally work is if this forced the identity seeds for the two tables
> to now have the same value. However, this will only hide the issue for so
> long - eventually the identity values of the two tables will diverge.
>
>>
>> I can work around the problem but, do you think this may be a Bug to
>> report to Sybase?
>
> You can control "how" PB retrieves the value of the identity column for
> inserted rows. Refer to the pbodbxxx.ini file and replace the GetIdentity
> line in the [MS_SQLSERVER_SYNTAX] section with:
>
> GetIdentity='SELECT SCOPE_IDENTITY()'
>
> By default, it will be set to 'Select @@identity' which is a known issue
> for tables that have triggers inserting into other identity-based tables.
> Note that you will need to deploy this file with your application.
>