Skip to Main Content

SQL Developer

Announcement

For appeals, questions and feedback about Oracle Forums, please email oracle-forums-moderators_us@oracle.com. Technical questions should be asked in the appropriate category. Thank you!

Pass an output variable to a query?

StaticFXJul 11 2022 — edited Jul 12 2022

Ok, so I took over someone else's stuff.. they had written a python app that broke lol.
Now, I need to manually run a few steps so wondering if there is an easier way to do this:
step 1:
a stored proc is run... this enters a new row in a table, retrieves an id, then populates a field in another table.
step 2:
run a query on a view, filtering with the above id...

My though is that I want something like this:

DECLARE
  var batchID number;
  var ts varchar2;
BEGIN
  CAR.CREATE_MRC_OUTBOUND(batchID,ts);
  select * from CAR.XR_MRC_OUTBOUND where header = 1 or OUTBOUND_BATCH_ID = &batchID;
END;

so it runs the stored proc, passed the batchID to the select.. the user then just gets the select that they can export.
is this possible? am I close? (I cannot test easily since I would have to reverse the updates in the proc)
THANK YOU!

Comments
Post Details
Added on Jul 11 2022
8 comments
622 views