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.

PB11.2 SQLServer2005 OLEDB - Identity Column & Triggers Issue

3 posts in DataWindow Last posting was on 2008-07-02 09:41:43.0Z
Vipul Posted on 2008-07-01 16:49:42.0Z
Reply-To: "Vipul" <spam@myvisionexpress.com>
From: "Vipul" <spam@myvisionexpress.com>
Newsgroups: sybase.public.powerbuilder.datawindow
Subject: PB11.2 SQLServer2005 OLEDB - Identity Column & Triggers Issue
Lines: 14
Organization: Insight Software LLC
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.18000
NNTP-Posting-Host: vip152.sybase.com
X-Original-NNTP-Posting-Host: vip152.sybase.com
Message-ID: <486a6026$1@forums-1-dub>
Date: 1 Jul 2008 09:49:42 -0700
X-Trace: forums-1-dub 1214930982 10.22.241.152 (1 Jul 2008 09:49:42 -0700)
X-Original-Trace: 1 Jul 2008 09:49:42 -0700, vip152.sybase.com
Path: forums-1-dub!not-for-mail
Xref: forums-1-dub sybase.public.powerbuilder.datawindow:87292
Article PK: 416549

PB11.2 SQLServer2005 OLEDB - Identity Column & Triggers Issue:

Have a DW on a table with Identity Column defined. Value in Identity column
comes up correctly with no triggers.

However, I have a trigger on this table that inserts records in second
table. This second table also has identity column.

DW gets the identity value of the second table instead of the table in the
DW!


Any solutions are welcome.


Vipul Posted on 2008-07-01 16:50:37.0Z
Reply-To: "Vipul" <spam@myvisionexpress.com>
From: "Vipul" <spam@myvisionexpress.com>
Newsgroups: sybase.public.powerbuilder.datawindow
References: <486a6026$1@forums-1-dub>
In-Reply-To: <486a6026$1@forums-1-dub>
Subject: Re: PB11.2 SQLServer2005 OLEDB - Identity Column & Triggers Issue
Lines: 21
Organization: Insight Software LLC
MIME-Version: 1.0
Content-Type: text/plain; format=flowed; charset="iso-8859-1"; reply-type=response
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.18000
NNTP-Posting-Host: vip152.sybase.com
X-Original-NNTP-Posting-Host: vip152.sybase.com
Message-ID: <486a605d$1@forums-1-dub>
Date: 1 Jul 2008 09:50:37 -0700
X-Trace: forums-1-dub 1214931037 10.22.241.152 (1 Jul 2008 09:50:37 -0700)
X-Original-Trace: 1 Jul 2008 09:50:37 -0700, vip152.sybase.com
Path: forums-1-dub!not-for-mail
Xref: forums-1-dub sybase.public.powerbuilder.datawindow:87293
Article PK: 416550

dw.ReselectRow(1) still gets the wrong Identity column value (value from
table in the trigger)

"Vipul" <spam@myvisionexpress.com> wrote in message
news:486a6026$1@forums-1-dub...
> PB11.2 SQLServer2005 OLEDB - Identity Column & Triggers Issue:
>
> Have a DW on a table with Identity Column defined. Value in Identity
> column comes up correctly with no triggers.
>
> However, I have a trigger on this table that inserts records in second
> table. This second table also has identity column.
>
> DW gets the identity value of the second table instead of the table in the
> DW!
>
>
> Any solutions are welcome.


Arnd Schmidt Posted on 2008-07-02 09:41:43.0Z
Reply-To: "Arnd Schmidt" <arnd.schmidt@no-spam-at-work.org>
From: "Arnd Schmidt" <arnd.schmidt@no-spam-at-work.org>
Newsgroups: sybase.public.powerbuilder.datawindow
References: <486a6026$1@forums-1-dub> <486a605d$1@forums-1-dub>
Subject: Re: PB11.2 SQLServer2005 OLEDB - Identity Column & Triggers Issue
Lines: 37
X-Priority: 3
X-MSMail-Priority: Normal
X-Newsreader: Microsoft Outlook Express 6.00.2900.3138
X-MimeOLE: Produced By Microsoft MimeOLE V6.00.2900.3198
X-RFC2646: Format=Flowed; Response
NNTP-Posting-Host: vip152.sybase.com
X-Original-NNTP-Posting-Host: vip152.sybase.com
Message-ID: <486b4d57$1@forums-1-dub>
Date: 2 Jul 2008 02:41:43 -0700
X-Trace: forums-1-dub 1214991703 10.22.241.152 (2 Jul 2008 02:41:43 -0700)
X-Original-Trace: 2 Jul 2008 02:41:43 -0700, vip152.sybase.com
Path: forums-1-dub!not-for-mail
Xref: forums-1-dub sybase.public.powerbuilder.datawindow:87296
Article PK: 416551

You have to modify your pbodb110.ini (Sybase\Shared\PowerBuilder) .
Search for the [MS_SQLSERVER_SYNTAX] section and modify this line:

GetIdentity='Select @@identity'

Change this line to:

GetIdentity='Select IDENT_CURRENT(''&TableName'')'

Attention: the '' are two separate '-signs.

Why this?
http://msdn.microsoft.com/en-us/library/ms175098.aspx

HTH

Arnd

"Vipul" <spam@myvisionexpress.com> schrieb im Newsbeitrag news:486a605d$1@forums-1-dub...

> dw.ReselectRow(1) still gets the wrong Identity column value (value from table in the trigger)
>
>
>
> "Vipul" <spam@myvisionexpress.com> wrote in message news:486a6026$1@forums-1-dub...
>> PB11.2 SQLServer2005 OLEDB - Identity Column & Triggers Issue:
>>
>> Have a DW on a table with Identity Column defined. Value in Identity column comes up correctly with no triggers.
>>
>> However, I have a trigger on this table that inserts records in second table. This second table also has identity column.
>>
>> DW gets the identity value of the second table instead of the table in the DW!
>>
>>
>> Any solutions are welcome.
>