Re: TRIGGER AND STORED PROCEDURE HELP NEEDED
Posted in 1998
Ramki,
Try using dbaccess instead of isql
--
Rajiv Jhaveri (rajivp@qsun.ho.att.com)
Ramki Natesan wrote:
> 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