Asanali Isataev
Asanali Isataev

Reputation: 3

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?

Upvotes: 0

Views: 4819

Answers (1)

kpater87
kpater87

Reputation: 1270

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.

Upvotes: 1

Related Questions