[quote]Originally posted by d4jaj1:
How do I get the sequence number from the insert after it is executed (see code below).[/quote]
If you are using Oracle8, you can use the 'returning into' clause:
[quote]
insert into table (id, ...) values (idseq.nextval, ...) returning id into :new_id
[/quote]
The :new_id variable will hold the generated value for the id column. If you are using Oracle7, you need to use a little PL/SQL Block:
[quote]
begin
select idseq.nextval into :new_id from dual;
insert into table (id, ...) values (:new_id, ...);
end;
[/quote]
The result is the same.
[quote]Originally posted by d4jaj1:
1) have I coded the RollBack\Commit correctly so that nothing is saved to either the Invoice & exams tables if an error occurs[/quote]
If UpdateExamsinvoiced.CommitOnPost = False, then it seems okay to me. You have hidden any exception though. Also note that it seems that the UpdateExamsinvoiced loop could be replaced by a single update statement: all updated columns are the same for all records.
[quote]Originally posted by d4jaj1:
2) How can I make sure that this process continues for each an every test center (while not EOF on OpenInvCenters) - regardless of whether the previous record posting was successful?[/quote]
What is the problem?
------------------
Marco Kalter
Allround Automations