Re: TRIGGER AND STORED PROCEDURE HELP NEEDED
Posted in 1998
Topics: Stored Procedures & SPL, Server Administration, Triggers, Constraints & Referential Integrity
Ramki,
ISQL cannot handle the creation of Procedures, it is not aware of
the syntax - To create your procedure, just use DBACCESS instead...
HTH
Stuart.
______________________________ Reply Separator ____________________________
_____
Subject: TRIGGER AND STORED PROCEDURE HELP NEEDED
Author: Ramki Natesan <rnatesan@bactc.com> at LEND LEASE/LLAP
Date: 14/05/98 18:11
Hi all,
I have the following trigger stmnt.
create trigger get_wo_num
insert on workorder
after (execute procedure create_wo_for_nt())
Q: Can I do this in isql mode?
-------
then, p1.sql file has the following:-
CREATE PROCEDURE create_wo_for_nt()
DEFINE wo, new_wo INT; DEFINE dept, req CHAR(20);
DEFINE req_date DATE;
SELECT requestor, department, wo_number, date_created
INTO req, dept, wo, req_date
FROM no_num_for_nt
INSERT workroder
INTO (wo_number, requestor, department, date_created)
VALUES (wo,req,dept,req_dat)
LET new_wo = SQLCA.SQLERRD[1];
update wo_num_for_nt
set (wo_number) = new_wo
where wo_num_for_nt.wo_number = 0
and wo_num_for_nt.requestor = req
and wo_num_for_nt.date_created = req_date
END PROCUDERE;
--------
Q:
Can I run this (p1.sql) file in isql mode? I tried this, and I got
some
syntax error at first DEFINE stmnt.
How can I implement this to make it available for my trigger?
Could some one help on this?
//rn