Run the procedure

How can I perform this procedure

create or replace procedure hr.testemp
     ( in_empno in number,
       out_name          out     varchar2,
       many_found_   out     varchar2,
       err_i          out     varchar2,
       err_msg          out     varchar2
    
    
    
    execute hr.testemp(09998,null,null,null,null)

Hi Alex,

you need a few variables that can receive your output settings.

Try something like this:

declare
  out1 varchar2(100);
  out2 varchar2(100);
  out3 varchar2(100);
  out4 varchar2(100);
begin
  hr.testemp(09998,out1,out2,out3,out4) ;
end;
/

concerning
Kay

Tags: Database

Similar Questions

  • Cannot run the procedure several times

    Hello

    I use oracle 12 c

    I just created a stored procedure that works very well

    Problem is that the second time I run it, it does not what it should (data fusion)

    When I run the second time I always get PL/SQL procedure successfully completed but the target table is still empty, here is the procedure:

    1 create or replace procedure MERGE_TABLEA

    2 as

    3. start

    4 MERGE TABLE_A has B (SELECT 'ID', 'NAME' OF TABLE_B) with the HELP of

    ON (A.ID = B.ID)

    WHEN MATCHED THEN

                     UPDATE SET B.SID = B.NAME

    WHEN NOT MATCHED THEN

    INSERT (A.' ID',' NAME')

    VALUES (B.ID, B.NAME);

    END;

    /

    PL/SQL procedure successfully completed.

    I also tried to build a simple procedure that id just insert and name of the table to test ina and it works very well, no matter how many times I've run it

    Is it maybe something with the merger or what?

    Thank you!

    OK guys, I think there are some misunderstandings here,

    @ddf_dba_ifox , version of the db that I use is stated in the first line of my post, I can't publish data for security reasons


    @rp0428 I forgot to mention that I'M to truncate the table, and then run the procedure again but the merger no longer works as the table is empty

    In any case, I found out why

    I'm merging the tables in the DB using the schema that is related to my installation of Oracle APEX

    In the procedure if you notice there is no COMMIT

    As apex has users within a schema, that I couldn't see the lines without committing before

    Thank you all anyway!

  • Run the procedure after the application deployment

    Hi all

    I faced a small question.
    When I deploy my application to another server - it must run a procedure (this means that the procedure must be run once immediately after successful deployment).
    It takes to update some records in the system tables.

    Apex supports characteristic or something like that?

    APEX 4.1

    Thank you

    Published by: Rod 13.05.2013 confidence 0:56

    Cane Trust wrote:

    I faced a small question.
    When I deploy my application to another server - it must run a procedure (this means that the procedure must be run once immediately after successful deployment).
    It takes to update some records in the system tables.

    Apex supports characteristic or something like that?

    APEX 4.1

    How do you deploy your application? The documentation contains all the details of creating a packaged application with all dependencies for database included as items of support. Your procedure must be performed in one of these objects support scripts.

  • Run the procedure by table number

    Hello

    Oracle 11.2.0.1
    Windows

    Create the np_type type is varray (3) of the number
    /

    Create the cn_type type is varray (3) the number;
    /

    Create the cxn_type type is varray (3) of varchar2 (2000)
    /

    I created the TEST table by pl/sql block below:

    declare
    execstr varchar2 (2000): =' create table test(';)
    Start
    because me in 1.80 loop
    execstr: = execstr | 'col ' | TO_CHAR (i) | 'number,';
    end loop;
    execstr: = substr (execstr, 1, length (execstr)-1);
    execstr: = execstr | ')';
    dbms_output.put_line (execstr);
    run immediately execstr;
    end;
    /

    create the table sp_table (Splitid number, Delimiterlength number);
    insert into sp_table values (1.4);
    insert into sp_table values (2.7);
    insert into sp_table values (3.9);
    insert into sp_table values (4.1);
    insert into sp_table values (5.2);
    insert into sp_table values (6,6);


    create or replace procedure myproc1
    (
    STRX in varchar2, delarray in np_type)
    as
    execstr varchar2 (2000);
    CN cn_type.
    CXN cxn_type;
    XPos number: = 1;
    Start
    execstr: = ' insert into test values(';)
    because loop me in 1.3
    Select Delimiterlength in the sp_table (i) cn where Splitid = delarray (i);
    CXN (i):=substr(STRX,XPos,CN(i));
    execstr: = execstr | CXN (i) | ',';
    XPos: = (i) cn + xpos;
    end loop;
    execstr: = RTRIM (execstr, ','). ')';
    dbms_output.put_line (execstr);
    -execution immediate execstr;
    end;
    /

    SQL> declare
      2    v np_type:=np_type(4,4,4);
      3    begin
      4    --dbms_output.put_line(v(3));
      5    exec myproc1('111',v);
      6    end;
      7  /
      exec myproc1('111',v);
           *
    ERROR at line 5:
    ORA-06550: line 5, column 8:
    PLS-00103: Encountered the symbol "MYPROC1" when expecting one of the
    following:
    := . ( @ % ;
    The symbol ":=" was substituted for "MYPROC1" to continue.
    
    SQL>
    The procedure above will insert the numbered string supplied in the test table that splits the chain numbered inspires provided splitids of sp_table.

    In fact, I tried to help a member of the forum for his question, but I'm not get where I get the above error. Of course, there is little that miss me, but not that. This thread is running too in this forum.

    Please help me.

    Concerning
    Girish Sharma
    create or replace procedure myproc1
    (
    strx in varchar2, delarray in np_type)
    as
    execstr varchar2(2000);
    cn cn_type := cn_type(null, null, null);
    cxn cxn_type := cxn_type(null, null, null);
    xpos number:=1;
    begin
    execstr := 'insert into test values(';
    for i in 1..3 loop
    select Delimiterlength into cn(i) from sp_table where Splitid = delarray(i);
    cxn(i):=substr(strx,xpos,cn(i));
    execstr :=execstr || cxn(i) || ',';
    xpos :=cn(i) + xpos;
    end loop;
    execstr := RTRIM(execstr,',')|| ')';
    
    dbms_output.put_line(execstr);
    --execute immediate execstr;
    end;
    /
    

    and

    declare
        a1 number :=4; a2 number :=4; a3 number :=4;
        v np_type:=np_type(a1,a2,a3);
        begin
        for i in 1..3 loop
        dbms_output.put_line('v(' || i || ') = ' || v(i));
        end loop;
        myproc1('111',v);
        end;
    /
    

    Your varrays are null or empty in myproc1

  • Run the procedure works without slash

    It's weird.
    I'm in a plsql connected to a database session.

    I can run a procedure as follows:
    run status_pkg.check_owner_vcard (1,1,2);

    However, I would like eventually to use variables, but when I try to do something like this:

    SQL > declare
    2 start
    3 run status_pkg.check_owner_vcard (1,1,2);
    4 end;
    7 m
    run status_pkg.check_owner_vcard (1,1,2);
    *
    ERROR at line 3:
    ORA-06550: line 3, column 9:
    PLS-00103: encountered the symbol "STATUS_PKG" when awaits an of the
    Next:
    := . (@ %; immediate)
    The symbol ': = ' was replaced by 'STATUS_PKG' continue.

    It is not a function - procedure which could wait for oracle?
    Any help appreciated
    Rgds
    Peter

    sqlplus command does not work inside a plsql block. Remove it and your block should run.

  • Cannot run the procedure

    Hello


    I'm able to run this procedure.

    I created the procedure successfully.

    CREATE OR REPLACE PROCEDURE update_LOGIN_TABLE (NAMER OUT VARCHAR2)
    IS
    temp_num NUMBER;
    BEGIN
    temp_num: = 10;
    DBMS_OUTPUT. Put_line (temp_num);
    Setting a DAY to the USER SET NAME = 'Ranga' where NAME = NAMER;
    COMMIT;
    EXCEPTION
    WHILE OTHERS THEN
    ROLLBACK;
    END update_LOGIN_TABLE;
    */*


    It comes to my Table Structure:

    SQL > select * from users;
    PASS NAME
    -------------------- --------------------
    Sai Baba
    SAI Natha
    roux keyboard
    roux keyboard


    When I tried to run, I get this: execute update_LOGIN_TABLE ('good');


    SQL > execute update_LOGIN_TABLE ('good');
    BEGIN update_LOGIN_TABLE ('good'); END;

    ***
    ERROR on line 1:
    ORA-06550: line 1, column 26:
    PLS-00363: 'delighted' expression cannot serve a purpose of assignment
    ORA-06550: line 1, column 7:
    PL/SQL: Statement ignored

    update_LOGIN_TABLE (NAMER OUT VARCHAR2)

    I think you probably wanted an IN argument in your procedure.

  • Apex 4. Run the procedure to recover my files

    Dear all,

    I experience a problem moving my apex application (sss) to a new server.
    I export demand for 3.2 APEX to APEX 4.0 new
    + transfer of data using a simple DB dump (export).

    Everything will work perfectly except our main application functionality, sitting on the workspace of "HR_PRD" that we have a few problems.

    In our DB schema called "HR_REP" I have a table that stores BLOBs for download a document attached to a record of the employee.
    So I created a package that contains the custom procedure to download the files stored in the table "wr_docs".

    URL = http://sphfrapex01.hopfr.net.fr.ch:8080/apex/HR_PROD.wr_apputil.download_my_file?p_file=3655106341169143


    I can download the file whithout any problems and it appears correctly in the report showing all my files.
    BUT when it tries to download... Unfortunately, access to the file does not work on the new APEX 4.0 platform!

    As this sounds like a simple question 'rights', I did several tests...

    I tried to create a simple procedure on my 'old' server called 'TEST' which simply print a simple text:
    HTP. ("test to print something");

    Here, I granted AUDIENCE to perform this procedure.
    It works well on the APEX 3.2 platform when on the new APEX 4.0, refusal to execute the procedure.

    Can you help me please?
    I'm certainly missing something obvious thanks to the GRANT run the TEST at?

    I granted AUDIENCE, so the appeal should work...


    I have to admit, I'm a bit lost here.

    Thanks in advance for your help.
    Philippe Kilchoer

    Hi Philippe,.

    using EPG to APEX? You may have forgotten to update WWV_FLOW_EPG_INCLUDE_MOD_LOCAL to include your procedure. Take a look on

    http://download.Oracle.com/docs/CD/E14373_01/AppDev.32/e13363/up_dn_files.htm#CJACBEHG

    Concerning
    Patrick
    -----------
    My Blog: http://www.inside-oracle-apex.com
    APEX 4.0 Plug-Ins: http://apex.oracle.com/plugins

  • Not able to run the procedure

    Hello world

    I am trying to execute the procedure below,

    CREATE or REPLACE procedure test1 (n1 n2 in number, number, tot OUT number)
    is
    i the number: = null;
    Start
    loop
    If n2 > n1 then
    i: = i + 1;
    tot: = n1 + i;
    dbms_output.put_line (tot);
    elsif n2 < 1 then
    dbms_output.put_line ('enter a higher value for n2');
    end if;
    end loop;
    end;
    /

    All I'm trying to do is to print the numbers according to the values we give during execution, but doesn't seem to work for me.
    IE.,.

    N1 = 1;
    N2 = 5;
    tot = 1,2,3,4,5;

    I'm sorry if there is a mistake in the procedure and would be really grateful if you can help me with this. Thanks in advance for your help.

    Published by: Pravin on August 31, 2010 14:25

    If you want you can use this code it has the same logic

    CREATE OR REPLACE procedure test1(n1  IN number,
                                      n2  IN number,
                                      tot OUT number) is
      cnt number := 0;
    begin
      if n2 < n1 then
        dbms_output.put_line('Enter a higher value for n2');
      end if;
    
      for i in n1 .. n2 loop
        dbms_output.put_line(i);
        cnt := cnt + 1;
      end loop;
    
      tot := cnt;
    end test1;
    
  • Run the procedure once a year

    I have a procedure files and creating sequences that are used as serial numbers for some forms.
    For the moment, the admin user must click on a button, once a year to perform the procedure.

    I need to do this automatically every year eg 06:00 on 1 January.

    Can someone point me in the right direction

    Gus

    Hello

    At least you have some time to think about it! ;)

    Have a look/google for DBMS_SCHEDULER - which should sort out you.

    See you soon

    Ben

  • Try to run the procedure and get an error PLS-00103

    I have a procedure defined with these parameters

    create or replace PROCEDURE procAuth
    (
    EMAIL IN VARCHAR2,
    PASSWORD IN VARCHAR2,
    IP IN VARCHAR2,
    UL NUMBER
    )

    Using this code

    var x number
    procAuth exec ('[email protected]', ' 555555 ', ' 1.1.1.1': x);
    print x

    gives me


    Error at startup on line 2 of the command:
    procAuth exec ('[email protected]', ' 555555 ', ' 1.1.1.1': x);
    Error report:
    ORA-06550: line 1, column 65:
    PLS-00103: encountered the symbol "" when expecting one of the following values:

    . ( ) , * @ % & | = + - <>/ at is mod not rank rem = >
    .. < an exponent (*) > <>or! = or ~ = > = < = <>and or as
    between |
    The symbol ',' was replaced by ' ' to continue.
    06550 00000 - "line %s, column % s:\n%s".
    * Cause: Usually a PL/SQL compilation error.
    * Action:
    x
    ------



    Thanks for any help

    jerry8989 wrote:
    I have a procedure defined with these parameters

    create or replace PROCEDURE procAuth
    (
    EMAIL IN VARCHAR2,
    PASSWORD IN VARCHAR2,
    IP IN VARCHAR2,
    UL NUMBER
    )

    Using this code

    var x number
    exec procAuth (' [email protected]', '555555',' 1.1.1.1': x);
    print x

    gives me

    Error at startup on line 2 of the command:
    exec procAuth (' [email protected]', '555555',' 1.1.1.1': x);

    a comma is perhaps missing to the right of the right like apostrophe below?

    procAuth exec ('[email protected]', ' 555555 ', ' 1.1.1.1',: x);

  • How can I run the procedure without parameters.

    CREATE OR REPLACE PROCEDURE P1 ((nvl(A,'dkjf') VARCHAR2)
    IS
    BEGIN
    DBMS_OUTPUT. PUT_LINE(A||',');
    END;


    It gives me error

    I want to run in this mode exec p1;

    It should automatically take dkjf as a parameter;

    help required on this.
    CREATE OR REPLACE PROCEDURE P1 ( A VARCHAR2 default 'dkjf' )
    IS
    BEGIN
    DBMS_OUTPUT.PUT_LINE(A||',');
    END;
    
    begin
      p1;
    end;
    

    What do you expect?

  • How to run the procedure which parameter is in a single query

    Hi all

    Here's sinario

    create or repalce procedure proc1 (number, number xyz, sys_refcursor Prefcur abc)
    as
    Start
    ...
    ......
    ... do something...


    end;

    front end, all paramertes came as string...

    'proc1 (1,5,Prefcursor).


    now what I do is that I created an another procedure that accept this string as parameter.

    create or replace procedure proc2 (Vpstring varchar2, Prefcursor to sys_refcursor)
    as
    Start

    execute Vpstring;

    end;



    but it gives me error


    Please help me solve this problem.

    any help appriciated

    It looks like a very strange requirement for me.

    Try like this.

    SQL> create or replace procedure p1(a1 number, a2 number, a3 out sys_refcursor)
      2  as
      3  begin
      4     open a3 for select * from dual where a1 = a2;
      5  end;
      6  /
    
    Procedure created.
    
    SQL> create or replace procedure p2(str varchar2, rc out sys_refcursor)
      2  as
      3     lstr varchar2(100);
      4  begin
      5     lstr := 'BEGIN ' || substr(str,1,instr(str,',',1,2))||':1);' ||' END;';
      6
      7     execute immediate lstr using rc;
      8  end;
      9  /
    
    Procedure created.
    
    SQL> var rc refcursor
    SQL> exec p2('p1(1,1,rc)',:rc)
    
    PL/SQL procedure successfully completed.
    
    SQL> print rc
    
    D
    -
    X
    
    SQL> exec p2('p1(1,2,rc)',:rc)
    
    PL/SQL procedure successfully completed.
    
    SQL> print rc
    
    no rows selected
    
    SQL>
    

    Thank you
    Knani.

  • Run the statement in a stored procedure with Out parameters and

    Hi all

    I have a stored procedure that calls a select statement. Here it is...

    CREATE OR REPLACE PROCEDURE BLABLA_VIEW_PROCEDURE

    * (BLABLA_KEY IN NUMBER, *)
    XML_OUTPUT ON VARCHAR)
    AS
    BEGIN
    SELECT SYS. XMLTYPE.getStringVal (OBJECT_VALUE) in XML_OUTPUT FROM BLABLA_VIEW WHERE extractValue (OBJECT_VALUE, ' / BLABLA_TYPE/BLABLA_KEY ') = 2876;
    END;

    Is to have both IN and OUT parameters as described above. I am able to compile and run the procedure.

    The problem I want to share with everyone is...
    I want to run the stored procedure together with a single EXEC command.

    I tried different ways using the EXEC command but of no use.

    Could someone help me?
    Thanks in advance.

    Published by: user10763276 on June 3, 2010 15:47

    Please visit the following...

    sudhakar@ORCL>CREATE OR REPLACE PROCEDURE BLABLA_VIEW_PROCEDURE
      2  (BLABLA_KEY IN NUMBER,
      3  XML_OUTPUT OUT VARCHAR)
      4  AS
      5  BEGIN
      6  XML_OUTPUT := BLABLA_KEY || ' and whatever else...';
      7  END;
      8  /
    
    Procedure created.
    
    sudhakar@ORCL>
    sudhakar@ORCL>var XML_OUTPPUT varchar2(100);
    sudhakar@ORCL>exec BLABLA_VIEW_PROCEDURE (9151, :XML_OUTPPUT);
    
    PL/SQL procedure successfully completed.
    
    sudhakar@ORCL>print XML_OUTPPUT;
    
    XML_OUTPPUT
    --------------------------------------------------------------------------------
    9151 and whatever else...
    
    sudhakar@ORCL>
    

    Post tells you...

    var OUTPUT VARCHAR
    exec BLABLA_VIEW_PROCEDURE (9151, :OUTPUT);
    print OUTPUT
    

    VARCHAR is not a valid TYPe to declare. Use VARCHAR2 (nnn) where nnn is a number.
    VR,
    Sudhakar B.

  • UTL_MAIL does not work in the procedure.

    Hello guys, I have given privilege to run on my user and executed UTL_MAIL package the following

    exec utl_mail.send (sender = > ' < user_id1 > @ < domain_name > .com ', recipients = > ' < user_id2 > @ < domain_name > .com ', subject = > 'Test eMail', message = > 'blah');

    the utl_mail perform very well.

    But now I want to put the utl_mail package in a procedure.

    CREATE OR REPLACE PROCEDURE test_email AS

    BEGIN

    UTL_MAIL. SEND (sender = > ' < user_id1 > @ < domain_name > .com ',)

    recipients = > ' < user_id2 > @ < domain_name > .com '.

    subject = > 'Test eMail ',.

    message = > "blah");

    END;

    now, when I run the procedure "run the test_email", I get the following error.

    BEGIN user_id1.test_email; END;

    Error on line 1

    ORA-24247: network access denied by access control list (ACL)

    ORA-06512: at "SYS." UTL_MAIL", line 654

    ORA-06512: at "SYS." UTL_MAIL", line 671

    ORA-06512: at "USER_ID1. TEST_EMAIL', line 3

    ORA-06512: at line 1

    Script done on line 10.

    can someone help me on this point, which is UTL_MAIL to work when running individually and does NOT when it is used in a procedure, where mistaken?

    Thank you

    The procedure has worked.  to get the UTL_MAIL work with in a process, outside the grant execute on UTL_MAIL to the user, that user is referred to an ACL as follows. previously, I thought a creation of ACL is sufficient to generate emails for all users.

    BEGIN
    DBMS_NETWORK_ACL_ADMIN. (ADD_PRIVILEGE)
    ACL-online "."
    main-online "."
    IS_GRANT => TRUE,
    privilege of-online 'connect');
    END;
    /

  • Dynamic insertion within the procedure error


    Hi all

    I use under oracle database on HP - UX.

    BANNER
    ----------------------------------------------------------------
    Oracle Database 10g Enterprise Edition Release 10.2.0.5.0 - 64bi
    PL/SQL Release 10.2.0.5.0 - Production
    CORE Production 10.2.0.5.0
    AMT for HP - UX: 10.2.0.5.0 - Production Version
    NLSRTL Version 10.2.0.5.0 - Production

    I'm not able to run the procedure below and it returns the error. The insert in the procedure returns error. If I execute manually only the insert statement, it works well.
    Can someone help me with this issue?

    Procedure
    ===========
    create or replace procedure test_proc
    as
    v_sql varchar2 (2000);
    Start
    v_sql: =' insert into TABLE1 (select owner, object_type, object_name, "S", "Y" of dba_objects@LINK1 )
    where owner = "ABC" and object_type = "TABLE" less
    Select the owner, object_type, object_name, "S", "Y" from dba_objects where owner = "ABC" and object_type = "TABLE") ';

    immediately run v_sql;
    commit;
    end;
    /

    exec test_proc;

    Error:
    ===========

    ERROR on line 1:
    ORA-00942: table or view does not exist
    ORA-06512: at "SYSTEM. TEST_PROC", line 8
    ORA-06512: at line 1

    user running this procedure doesn't have permission to read data from DBA_OBJECTS. Grant select permission on that to the user running this procedure and it should work.

    Onkar

Maybe you are looking for