If this is your first visit, be sure to
check out the FAQ by clicking the
link above. You may have to register
before you can post: click the register link above to proceed. To start viewing messages,
select the forum that you want to visit from the selection below.

Unanswered: help needed for this problem ?

Create a sequence starting at 1000 and incrementing by one. This sequence is used to
generate transaction numbers for the entries into the wgb_transaction table.

a. Reads in the transactions from wgb_in_transactions and inserts each one with an
automatically generated transaction number and date into the wgb_transaction
table
b. Updates the wgb_account and wgb_assets tables as appropriate to maintain
balanced books (assume valid data).

Do not create (and drop) a sequence (or a table, or ...) within PL/SQL (not that it is not possible - if you are interested in the subject, research use of dynamic SQL and EXECUTE IMMEDIATE). Create a sequence BEFORE running your PL/SQL block.

If you've created a cursor and created a FOR loop, then there's really no need to repeat the same SELECT statement once again. "r_returns" already contains everything you need, so just use those values in the INSERT statement.