简体   繁体   中英

How call procedure inside in another procedure in Oracle, Sql Developer?

CREATE OR REPLACE PROCEDURE ShowShips3Task(
       p_Register IN ship.registry_country%TYPE,
       o_name OUT ship.ship_name%TYPE,
       o_capitan OUT  ship.captain_name%TYPE)
IS
   procedure showshipsDisp(
    o_cap out Ship.captain_name%type,
    o_dis out Ship.displacement%type)
    is
    begin
    Select Captain_name, Displacement
    into o_cap, o_dis
    from Ship Where Ship_name = 'Avrora';
    end;

BEGIN

  SELECT Ship_name , Captain_Name
  INTO o_name, o_capitan
  from  Ship WHERE registry_country LIKE p_register || '%';

END;

how execute one Procedure inside another in same time?

and how can i create multivalued paramater, means that second proceduru inside depend on paramatr of first procedure?

In the example from the question nested procedure is only declared but never called. To run the nested procedure the call has to be present between BEGIN and END statements:

BEGIN

  SELECT Ship_name , Captain_Name
  INTO o_name, o_capitan
  from  Ship WHERE registry_country LIKE p_register || '%';

  showshipsDisp(o_cap => ?
               ,o_dis => ?);

END;

Question marks should be replaced by proper variables.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM