I can not understand the correct syntax for the following pseudo-SQL:
in some table Call (Column 1, Column 2) SELECT col1_value, col2_value FROM other_table where ... the ID is returning to local_var; I would like to include something with the values of a subquery, after inserting, I need a new generated ID.
Okay, I think this is not possible with only the price segment. Is there any alternative?
You can not use the returning bulk archive An INSERT This method may work with updates and Howeveer can be removed:
Make Test Test 2 (aa number) / test2 (AA) selection level from double connect level & lt; Announce 100 / set serveroutput TYPE t_Numbers is the table of the test2.aa% type index by BINARY_INTEGER; V_Numbers t_Numbers; V_count number; Start update test2 set aa = aa + 1 is coming back in a bulk v_Numbers; 1.v_Numbers.count loop for v_count dbms_output.put_line ('v_Numbers:' 'v_Numbers (v_count)); End loop; End; As you are told in this article, you can meet to work with a few extra steps (an INSERT of course to use the troll):
T
To create an example, they make it and apply it to test2 test table
create or opty object object Number); Prepare as tab / ot; / Set server output DECLARE at nt_passed_in ntt; Nt_to_return ntt; Function pretax_permator returns NTT IS NT NTT; Choose from the start of OT (level) with double connectivity by bulk level & lt; = 5; Returns NT; END pretend_parameter; BEGIN nt_passed_in: = pretend_parameter (); FORALL i IN 1 .. nt_passed_in.COUNT INSTERT test2 (AA) values (TREAT (NTPad_In (i) AS OT) .a) Bulk Returning (AA) bulk returning in NT_to_reature; FOR I IN 1 .. nt_to_return.COUNT LOOP DBMS_OUTPUT.PUT_LINE ('Sequence value = [' || TO_CHAR (nt_to_return (i) .aa) || ']'); End loop; End; /
Comments
Post a Comment