dbTalk Databases Forums  

Trigger creation issue ASA 9.0.2.3480

sybase.public.sqlanywhere.general sybase.public.sqlanywhere.general


Discuss Trigger creation issue ASA 9.0.2.3480 in the sybase.public.sqlanywhere.general forum.



Reply
 
Thread Tools Display Modes
  #1  
Old   
eric
 
Posts: n/a

Default Trigger creation issue ASA 9.0.2.3480 - 09-21-2009 , 06:20 PM






Hello,
I'm running this version on Window Server 2003 SP 2.

When I create my trigger in Power Designer 9.5.2.873 I use the following:


create trigger TR_UpdateFaxSL
after update on tbl_FaxServiceLogger
referencing new as new_data old as old_data
begin
-- a bunch of stuff
end

It seems to create fine, but when I run an update against the table I
get an error saying 'correlation name 'old_data' not found.

If I look in Sybase Central at the trigger, I see it defined as this:
ALTER TRIGGER "TR_UpdateFaxSL" on
DBA.tbl_FaxServiceLogger for update
as
begin
-- all my stuff here
end

It seems the referencing statement is missing. And I have an 'as' in the
command. None of my other triggers look like this and they all work.

Am I building the trigger wrong?

thanks
eric

Reply With Quote
  #2  
Old   
tduemesnil
 
Posts: n/a

Default Re: Trigger creation issue ASA 9.0.2.3480 - 09-22-2009 , 01:56 AM






On 22 Sep., 01:20, eric <pos... (AT) cox (DOT) net> wrote:
Quote:
Hello,
* *I'm running this version on Window Server 2003 SP 2.

When I create my trigger in Power Designer 9.5.2.873 I use the following:

create trigger TR_UpdateFaxSL
after update on tbl_FaxServiceLogger
referencing new as new_data old as old_data
begin
* -- a bunch of stuff
end

* It seems to create fine, but when I run an update against the table I
get an error saying 'correlation name 'old_data' not found.

Hello Eric

I tried your code with my ASA 10.0.1
Looks OK

Regards Thomas

Reply With Quote
  #3  
Old   
R. Pods
 
Posts: n/a

Default Re: Trigger creation issue ASA 9.0.2.3480 - 09-22-2009 , 02:52 AM



tduemesnil wrote:
Quote:
On 22 Sep., 01:20, eric <pos... (AT) cox (DOT) net> wrote:
Hello,
I'm running this version on Window Server 2003 SP 2.

When I create my trigger in Power Designer 9.5.2.873 I use the following:

create trigger TR_UpdateFaxSL
after update on tbl_FaxServiceLogger
referencing new as new_data old as old_data
begin
-- a bunch of stuff
end

It seems to create fine, but when I run an update against the table I
get an error saying 'correlation name 'old_data' not found.

Hello Eric

I tried your code with my ASA 10.0.1
Looks OK

Regards Thomas
Same thing with ASA 9.0.2.3804. Did you use PowerDesigner to update the
database directly or did you let it create an update script? You might
want to check if something went wrong during that process.

Cheers
Reimer

Reply With Quote
  #4  
Old   
Reg Domaratzki [Sybase iAnywhere]
 
Posts: n/a

Default Re: Trigger creation issue ASA 9.0.2.3480 - 09-22-2009 , 08:20 AM



eric wrote:
Quote:
Hello,
I'm running this version on Window Server 2003 SP 2.

When I create my trigger in Power Designer 9.5.2.873 I use the following:


create trigger TR_UpdateFaxSL
after update on tbl_FaxServiceLogger
referencing new as new_data old as old_data
begin
-- a bunch of stuff
end

It seems to create fine, but when I run an update against the table I
get an error saying 'correlation name 'old_data' not found.

If I look in Sybase Central at the trigger, I see it defined as this:
ALTER TRIGGER "TR_UpdateFaxSL" on
DBA.tbl_FaxServiceLogger for update
as
begin
-- all my stuff here
end

It seems the referencing statement is missing. And I have an 'as' in the
command. None of my other triggers look like this and they all work.

Am I building the trigger wrong?

thanks
eric
If you take your trigger code and connect to your SQL Anywhere database
using dbisql and execute the code, does it work? If it does, I'd try
reposting your question on a Power Designer newsgroup, and if it
doesn't, then the error you get (my guess is "trigger already exists")
will be a good piece of information that points you towards what is
going wrong.

--
Reg Domaratzki, Sybase iAnywhere Solutions
Please reply only to the newsgroup

Documentation : Exercise your WRITE @DocCommentXchange: DCX.sybase.com
SQL Anywhere Patches and EBFs : http://downloads.sybase.com/swd/base.do
-> Choose SQL Anywhere
-> Optionally set filter to "Display ALL platforms IN ALL MONTHS"

Reply With Quote
  #5  
Old   
Bruce Hay
 
Posts: n/a

Default Re: Trigger creation issue ASA 9.0.2.3480 - 09-22-2009 , 09:21 AM



Your trigger definition is missing the FOR EACH {ROW | STATEMENT} clause, which
may be what is causing it to be stored as a Transact-SQL dialect statement level
trigger.

SQL Anywhere Developer Community:
http://www.sybase.com/developer/libr...ere-techcorner


SQL Anywhere Blog Center: http://www.sybase.com/sqlanyblogs




eric wrote:
Quote:
Hello,
I'm running this version on Window Server 2003 SP 2.

When I create my trigger in Power Designer 9.5.2.873 I use the following:


create trigger TR_UpdateFaxSL
after update on tbl_FaxServiceLogger
referencing new as new_data old as old_data
begin
-- a bunch of stuff
end

It seems to create fine, but when I run an update against the table I
get an error saying 'correlation name 'old_data' not found.

If I look in Sybase Central at the trigger, I see it defined as this:
ALTER TRIGGER "TR_UpdateFaxSL" on
DBA.tbl_FaxServiceLogger for update
as
begin
-- all my stuff here
end

It seems the referencing statement is missing. And I have an 'as' in the
command. None of my other triggers look like this and they all work.

Am I building the trigger wrong?

thanks
eric

Reply With Quote
  #6  
Old   
eric
 
Posts: n/a

Default Re: Trigger creation issue ASA 9.0.2.3480 - 09-23-2009 , 03:04 PM



Reg Domaratzki [Sybase iAnywhere] wrote:
Quote:
eric wrote:
Hello,
I'm running this version on Window Server 2003 SP 2.

When I create my trigger in Power Designer 9.5.2.873 I use the following:


create trigger TR_UpdateFaxSL
after update on tbl_FaxServiceLogger
referencing new as new_data old as old_data
begin
-- a bunch of stuff
end

It seems to create fine, but when I run an update against the table I
get an error saying 'correlation name 'old_data' not found.

If I look in Sybase Central at the trigger, I see it defined as this:
ALTER TRIGGER "TR_UpdateFaxSL" on
DBA.tbl_FaxServiceLogger for update
as
begin
-- all my stuff here
end

It seems the referencing statement is missing. And I have an 'as' in
the command. None of my other triggers look like this and they all work.

Am I building the trigger wrong?

thanks
eric

If you take your trigger code and connect to your SQL Anywhere database
using dbisql and execute the code, does it work? If it does, I'd try
reposting your question on a Power Designer newsgroup, and if it
doesn't, then the error you get (my guess is "trigger already exists")
will be a good piece of information that points you towards what is
going wrong.

Hi,
I created the trigger in PD and then loaded it into the db via isql. I
then tried an update command and got the correlation error. I took a
look at the trigger via Sybase Central and saw the oddity.

Someone had referenced a missing "FOR EACH ...", I added that and the
trigger won't load. It calls an error near "FOR".

Eric

Reply With Quote
Reply




Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off



Powered by vBulletin Version 3.5.3
Copyright ©2000 - 2012, Jelsoft Enterprises Ltd.