How to run a stored procedure in oracle sql developer?

后端 未结 3 1781
日久生厌
日久生厌 2021-01-30 17:12

I\'m trying to run this stored procedure

DECLARE
  P_TICKER_SERIAL VARCHAR2(200);
  P_SECTOR_CODE   VARCHAR2(200);
  P_SOURCE_ID     VARCHAR2(200);
  P_COUNTRY_         


        
相关标签:
3条回答
  • 2021-01-30 17:40

    -- If no parameters need to be passed to a procedure, simply:

    BEGIN
       MY_PACKAGE_NAME.MY_PROCEDURE_NAME
    END;
    
    0 讨论(0)
  • 2021-01-30 17:47

    Try to execute the procedure like this,

    var c refcursor;
    execute pkg_name.get_user('14232', '15', 'TDWL', 'SA', 1, :c);
    print c;
    
    0 讨论(0)
  • 2021-01-30 17:51

    Consider you've created a procedure like below.

    CREATE OR REPLACE PROCEDURE GET_FULL_NAME like
    (
      FIRST_NAME IN VARCHAR2, 
      LAST_NAME IN VARCHAR2,
      FULL_NAME OUT VARCHAR2 
    ) IS 
    BEGIN
      FULL_NAME:= FIRST_NAME || ' ' || LAST_NAME;
    END GET_FULL_NAME;
    

    In Oracle SQL Developer, you can run this procedure in two ways.

    1. Using SQL Worksheet

    Create a SQL Worksheet and write PL/SQL anonymous block like this and hit f5

    DECLARE
      FULL_NAME Varchar2(50);
    BEGIN
      GET_FULL_NAME('Foo', 'Bar', FULL_NAME);
      Dbms_Output.Put_Line('Full name is: ' || FULL_NAME);
    END;
    

    2. Using GUI Controls

    • Expand Procedures

    • Right click on the procudure you've created and Click Run

    • In the pop-up window, Fill the parameters and Click OK.

    Cheers!

    0 讨论(0)
提交回复
热议问题