Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations strongm on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Triggers

Status
Not open for further replies.

GerryML

Programmer
Feb 20, 2002
8
US
Hi all,
I am new to ASE and ASA is different than ASE. I am using ASE 12.5 and
I am trying to create a trigger. Foe example here's a trigger:

CREATE trigger dbo.TDA_ADVISOR on dbo.Advisor for delete
as
begin
declare @@iAdvisorSeqNo numeric(10)
select @@iAdvisorSeqNo = DELETED.ADVISOR_SEQ_NO from
DELETED
delete from ADVISOR_CLIENT_REG where
ADVISOR_CLIENT_REG.ADVISOR_SEQ_NO = @iAdvisorSeqNo
end

HERES MY ERROR:
Msg 11729, Level 15, State 2:
Server 'SYBFAO_TRD2', Procedure 'dbo.TDA_ADVISOR', Line 4:
The name '@@iAdvisorSeqNo' is not a valid local variable name.
Msg 137, Level 15, State 1:

any help please is greatly appreciates.
-Gerard

 
User variables start with a single @ symbol. Sybase uses @@ for it's own internal variables.

CREATE trigger dbo.TDA_ADVISOR on dbo.Advisor for delete
as
begin
declare @iAdvisorSeqNo numeric(10)
select @iAdvisorSeqNo = DELETED.ADVISOR_SEQ_NO from
DELETED
delete from ADVISOR_CLIENT_REG where
ADVISOR_CLIENT_REG.ADVISOR_SEQ_NO = @iAdvisorSeqNo
end

Greg.
 
I did that but i get this message:
Server 'SYBFAO_TRD2', Procedure 'dbo.TDA_ADVISOR', Line 5:
DELETED not found. Specify owner.objectname or use sp_help to check whether the
object exists (sp_help may produce lots of output).

so do i put DBP. in front of DELETED?
 
I'm gueesing here, but the table is called deleted ... not DELETED. AFAIK Sybase is case-sensitive.

Greg.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top