Subject | for..do statement help |
---|---|
Author | dinol.softedge |
Post date | 2008-08-20T19:12:32Z |
Hi
I am trying to iterate through records in the tbl_job_card table and
insert the values retrieved from the select statement and insert them
into another table called tbl_job_card_employee. My statement follows
BEGIN
for select job_card_id, employee_id, employee_commission FROM tbl_job_card
into :job_card, :employee, :comm DO
INSERT INTO tbl_job_card_employee
(job_card_id,
employee_id,
commission)
VALUES
(job_card,
employee,
comm);
SUSPEND;
END
I get an error on job_card on line 4
I would also like to run this statement directly (i.e. not a
procedure), is this possible?
Any help with this statement would be greatly appreciated.
Thanks in advance
I am trying to iterate through records in the tbl_job_card table and
insert the values retrieved from the select statement and insert them
into another table called tbl_job_card_employee. My statement follows
BEGIN
for select job_card_id, employee_id, employee_commission FROM tbl_job_card
into :job_card, :employee, :comm DO
INSERT INTO tbl_job_card_employee
(job_card_id,
employee_id,
commission)
VALUES
(job_card,
employee,
comm);
SUSPEND;
END
I get an error on job_card on line 4
I would also like to run this statement directly (i.e. not a
procedure), is this possible?
Any help with this statement would be greatly appreciated.
Thanks in advance