Procedure whith variables parameters

I want to make a Form in Oracle Portal, based on a procedure, but I want the numbers of the parameters of the procedure to be dynamic.If the number of the rows from a table is changing , the number of parameters must be increased whith the same value.Haw to make the procedure? I need a solution, please...

This isn't really the way PL/SQL procedures are supposed to work but there are ways around it.
The easiest way of doing this is to use DBMS_UTILITY.NAME_ARRAY, which you can then unpack in your procedure, one entry in the array for each parameter. Of course you lose the datatypes of your parameters, so the procedure is going to have to know how to understand them. If any parameter is likely to exceed 256 chars you'll need to use your own array.
rgds, APC

Similar Messages

  • Problem in calling of stored procedure with variable parameters

    Hello!
    When we try to call our stored procudure with variable parameter (year and month) we receive various errors.
    Here's the dynamic package script code:
    DEBUG(ON)
    PROMPT(SELECTINPUT,,,"Please select time for restatement",%TIME_DIM%)
    TASK(Execute formulas,USER,%USER%)
    TASK(Execute formulas,APPSET,%APPSET%)
    TASK(Execute formulas,APP,%APP%)
    TASK(Execute formulas,SELECTION,%SELECTIONFILE%)
    TASK(Execute formulas,LOGICFILE,%APPPATH%\..\AdminApp\%APP%\zbpc_to_fm.lgx)
    TASK(Execute formulas,RUNMODE,1)
    TASK(Execute formulas,LOGICMODE,1)
    TASK(Execute formulas,SIMULATION,1)
    TASK(Execute formulas,CHECKLCK,0)
    Our logic script file (zbpc_to_fm.lgx) code is:
    *RUN_STORED_PROCEDURE=ztest('%TIME_SET%')
    *commit
    The problem occures while transferring the variable parameter %TIME_SET% value.
    How can we correctly transfer the selected value of TIME_SET into the procedure?

    Everything in the debug log looks correct -- the most important lines are the ones indicating the values passed from the user's response to the PROMPT(SELECTINPUT...)
    INFO(%CATEGORY_SET%, BUDGET)
    INFO(%ENTITY_SET%, 1733)
    INFO(%FUND_SET%, )
    INFO(%PROJECT_SET%, )
    INFO(%TIME_SET%, 2008.NOV)
    Are you certain that the stored proc is processing the input parameter for time correctly, when you run it directly in MS Mgmt Studio?
    What error messages do you see running it from BPC?
    By "customized user authorities" do you mean that the time dimension is secured, and this user has access only to 2008.total and its descendants? If that's the case, the user should be able to see only those members in the action pane / current view, but the SELECTINPUT prompt should only show the base members (and not the year total and quarters). I'm still confused as to why all 12 + 4 + 1 members are passed through to the stored proc.

  • Can you get values back from a stored procedure via OUTPUT parameters?

    Can you get values back from calling a stored procedure via OUTPUT parameters/variables? I call the SP via a SQL statement from a script either in a WF or DF.
    I thought I read some reference that DI could not get the values from OUTPUT parameters but I could not find it again (don't know if it is in any of the documentation or referred to in a forum.
    I did try a couple of tests but it did not reutrn any values via OUTPUT. But before I give up I thought I'd see if you could and maybe I needed to change something.

    This isn't exactly an answer to your question, but I'll point out that, given that you're resorting to a SQL script in the first place, there's no reason you can't also turn the output parameters into a regular result or record set. (The following uses T-SQL, although I think it's pretty generic.)
    declare @param1 int, param2 varchar(100), @return int;
    exec @return = proc @param1 = @param1 output, @param2 = @param2 output;
    select @param1 as param1, @param2 as param2;
    That is, to get from output parameters to a "regular" output from the SQL script isn't much of a leap...
    Jeff Prenevost
    BI Consultant
    Ann Arbor, MI

  • Calling a Stored Procedure with output parameters from Query Templates

    This is same problem which Shalaka Khandekar logged earlier. This new thread gives the complete description about our problem. Please go through this problem and suggest us a feasible solution.
    We encountered a problem while calling a stored procedure from MII Query Template as follows-
    1. Stored Procedure is defined in a package. Procedure takes the below inputs and outputs.
    a) Input1 - CLOB
    b) Input2 - CLOB
    c) Input3 - CLOB
    d) Output1 - CLOB
    e) Output2 - CLOB
    f) Output3 - Varchar2
    2. There are two ways to get the output back.
    a) Using a Stored Procedure by declaring necessary OUT parameters.
    b) Using a Function which returns a single value.
    3. Consider we are using method 2-a. To call a Stored Procedure with OUT parameters from the Query Template we need to declare variables of
    corresponding types and pass them to the Stored Procedure along with the necessary input parameters.
    4. This method is not a solution to get output because we cannot declare variables of some type(CLOB, Varchar2) in Query Template.
    5. Even though we are successful (step 4) in declaring the OUT variables in Query Template and passed it successfully to the procedure, but our procedure contains outputs which are of type CLOB. It means we are going to get data which is more than VARCHAR2 length which query template cannot return(Limit is 32767
    characters)
    6. So the method 2-a is ruled out.
    7. Now consider method 2-b. Function returns only one value, but we have 3 different OUT values. Assume that we have appended them using a separator. This value is going to be more than 32767 characters which is again a problem with the query template(refer to point 5). So option 2-b is also ruled out.
    Apart from above mentioned methods there is a work around. It is to create a temporary table in the database with above 3 OUT parameters along with a session specific column. We insert the output which we got from the procedure to the temporary table and use it further. As soon the usage of the data is completed we delete the current session specific data. So indirectly we call the table as a Session Table. This solution increases unnecessary load on the database.
    Thanks in Advance.
    Rajesh

    Rajesh,
    please check if this following proposal could serve you.
    Define the Query with mode FixedQueryWithOutput. In the package define a ref cursor as IN OUT parameter. To get your 3 values back, open the cursor in your procedure like "Select val1, val2, val3 from dual". Then the values should get into your query.
    Here is an example how this could be defined.
    Package:
    type return_cur IS ref CURSOR;
    Procedure:
    PROCEDURE myProc(myReturnCur IN OUT return_cur) ...
    OPEN myReturnCur FOR SELECT val1, val2, val3  FROM dual;
    Query:
    DECLARE
      MYRETURNCUR myPackage.return_cur;
    BEGIN
      myPackage.myProc(
        MYRETURNCUR => ?
    END;
    Good luck.
    Michael

  • Calling stored procedure with output parameters in a different schema

    I have a simple stored procedure with two parameters:
    PROCEDURE Test1(
    pOutRecords OUT tCursorRef,
    pIdNumber IN NUMBER);
    where tCursorRef is REF CURSOR.
    (This procedure is part of a package with REF CURSOR declared in there)
    And I have two database schemas: AppOwner and AppUser.
    The above stored procedure is owned by AppOwner, but I have to execute this stored procedure from AppUser schema. I have created a private synonym and granted the neccessary privileges for AppUser schema to execute the package in the AppUser schema.
    When I ran the above procedure from VB using ADO and OraOLEDB.Oracle.1 driver, I got the following error when connecting to the AppUser schema:
    ORA-06550: line 1, column 7:
    PLS-00306: wrong number or types of arguments in call to 'TEST1'
    ORA-06550: line 1, column 7:
    PL/SQL: Statement ignored
    but when I was connecting to the AppOwner schema, everything is running correctly without errors.
    Also, when I switch to the microsoft MSDAORA.1 driver, I can execute the above procedure without any problems even when connecting to the AppUser schema.
    I got this error only when I am trying to execute a stored procedure with an output parameter. All other procedures with only input parameters have no problems at all.
    Do you know the reason for that? Thanks!

    If anyone has figured this one out let me know. I'm getting the same problem. Only in my case I've tried both the "OraOLEDB.Oracle" provider and the "MSDAORA" provider and I get an error either way. Also my procedure has 2 in parameters and 1 out parameter. At least now I know I'm not the only one with this issue. :)
    '*** the Oracle procedure ***
    Create sp_getconfiguration(mygroup in varchar2, myparameter in varchar2, myvalue out varchar2)
    AS
    rec_config tblconfiguration.configvalue%type;
    cursor cur_config is select configvalue from tblconfiguration where configgroup = mygroup and configparameter = myparameter;
    begin
    open cur_config;
    fetch cur_config into rec_config;
    close cur_config;
    myvalue := rec_config;
    end;
    '** the ado code ****
    dim dbconn as new adodb.connection
    dim oCmd as new adodb.connection
    dim ors as new adodb.recordset
    dbconn.provider = "MSDAORA" 'or dbconn.provider = "OraOLEDB.Oracle"
    dbconn.open "Data Source=dahdah;User ID=didi;Password=humdy;PLSQLRSet=1;"
    set ocmd.activeconnection = dbconn
    cmd.commandtext = "{call fogle.sp_getconfiguration(?,?)}"
    'i've also tried creating a public synonym called getconfiguration and just refering to procedure by that.
    ' "{call getconfiguration(?, ?)}"
    ' "{call getconfiguration(?,?, {resultset 1, myvalue})}"
    'and numerous numerous other combinations
    set oPrm = cmd.createparameter("MYGROUP", advarchar, adparaminput, 50, strGrouptoPassIn$)
    cmd.parameters.append oPrm
    set oPrm = cmd.createParameter("MYPARAMETER", advarchar, adParamInput, 50, strParameterToPassIn$)
    cmdParameters.append oPrm
    set rs = cmd.execute

  • How to call stored procedure with multiple parameters in an HTML expression

    Hi, Guys:
    Can you show me an example to call stored procedure with multiple parameters in an HTML expression? I need to rewrite a procedure to display multiple pictures of one person stored in database by clicking button.
    The orginal HTML expression is :
    <img src="#OWNER#.dl_sor_image?p_offender_id=#OFFENDER_ID#" width="75" height="75">which calls a procedure as:
    procedure dl_sor_image (p_offender_id IN NUMBER)now I rewrite it as:
    PROCEDURE Sor_Display_Current_Image(p_n_Offender_id IN NUMBER, p_n_image_Count in number)could anyone tell me the format for the html expression to pass multiple parameters?
    Thanks a lot.
    Sam

    Hi:
    Thanks for your help! Your question is what I am trying hard now. Current procedure can only display one picture per person, however, I am supposed to write a new procedure which displays multiple pictures for one person. When user click a button on report, APEX should call this procedure and returns next picture of the same person. The table is SOR_image. However, I rewrite the HTML expression as follows to test to display the second image.
    <img src="#OWNER#.Sor_Display_Current_Image?p_n_Offender_id=#OFFENDER_ID#&p_n_image_Count=2" width="75" height="75"> The procedure code is complied OK as follows:
    create or replace
    PROCEDURE Sor_Display_Current_Image(p_n_Offender_id IN NUMBER, p_n_image_Count in number) AS
        v_mime_type VARCHAR2(48);
        v_length NUMBER;
        v_name VARCHAR2(2000);
        v_image BLOB;
        v_counter number:=0;
        cursor cur_All_Images_of_Offender is
          SELECT 'IMAGE/JPEG' mime_type, dbms_lob.getlength(image) as image_length, image
          FROM sor_image
          WHERE offender_id = p_n_Offender_id;
        rec_Image_of_Offender cur_All_Images_of_Offender%ROWTYPE;
    BEGIN
        open cur_All_Images_of_Offender;
        loop
          fetch cur_All_Images_of_Offender into rec_Image_of_Offender;
          v_counter:=v_counter+1;
          if (v_counter=p_n_image_Count) then
            owa_util.mime_header(nvl(rec_Image_of_Offender.mime_type, 'application/octet'), FALSE);
            htp.p('Content-length: '||rec_Image_of_Offender.image_length);
            owa_util.http_header_close;
            wpg_docload.download_file (rec_Image_of_Offender.image);
          end if;
          exit when ((cur_All_Images_of_Offender%NOTFOUND) or (v_counter>=p_n_image_Count));
        end loop;
        close cur_All_Images_of_Offender;
    END Sor_Display_Current_Image; The procedure just open a cursor to fetch the images belong to the same person, and use wpg_docload.download_file function to display the image specified. But it never works. It is strange because even I use exactly same code as before but change procedure name, Oracle APEX cannot display an image. Is this due to anything such as make file configuration in APEX?
    Thanks
    Sam

  • RMAN scripts & variables/parameters

    Hi
    We are using RMAN with TSM. There are a number of 9i and 8i databases. I tried to set the environment up to with as few scripts as possible to cover the variety of databases. I provide various variables/parameters to handle the differences between the various databases.
    In the 9i environment I "CONFIGURE" as much as possible to avoid setting changes in the actual backup script. That gives me a fairly clean generic backup script which also avoids manual channel allocations ie :
    run
    backup incremental level=0
    not backed up since time='SYSDATE-(8/24)'
    check logical
    filesperset=4
    format='/LVL0_%d_%T_%U'
    (database include current controlfile)
    plus archivelog format '/ARC_%d_%T_%U' delete all input;
    However due to the lack of "CONFIGURE" in 8i I cannot configure automatic channels. Therefor my script has to change to :
    run
    allocate channel ch01 type 'sbt_tape' parms 'ENV=(TDPO_OPTFILE=/usr/tivoli/tsm/client/oracle/bin/tdpo_${ORACLE_SID}.opt)';
    allocate channel ch02 type 'sbt_tape' parms 'ENV=(TDPO_OPTFILE=/usr/tivoli/tsm/client/oracle/bin/tdpo_${ORACLE_SID}.opt)';
    allocate channel ch03 type 'sbt_tape' parms 'ENV=(TDPO_OPTFILE=/usr/tivoli/tsm/client/oracle/bin/tdpo_${ORACLE_SID}.opt)';
    allocate channel ch04 type 'sbt_tape' parms 'ENV=(TDPO_OPTFILE=/usr/tivoli/tsm/client/oracle/bin/tdpo_${ORACLE_SID}.opt)';
    backup incremental level=0
    check logical
    filesperset=4
    format='/LVL0_%d_%T_%U'
    (database include current controlfile)
    (archivelog all format '/ARC_%d_%T_%U' delete input);
    release channel ch01;
    release channel ch02;
    release channel ch03;
    release channel ch04;
    I have multiple database instances on the same server & would like to have a single generic script with a variable/parameter to change the "tdpo.opt" file for each instance. The alternate is to have a complete set of scripts for each DB instance with everything hard coded.
    The question is : Can I pass variables/parameters to a RMAN script? If yes, how do I go about it?
    Maybe there are other ideas out there to do this. The key to me in this whole execise is to reduce maintenance & increase flexibility.
    Your responses will be appreciated
    CM

    I was hoping to get away from building part of the backup script ie the channel allocation in the RMAN statement.Don't know how you expect to do this when it's required for 8i databases ?
    Well since you are looking to accommodate 8i & 9i database and you need to manually allocate channels for the 8i databases, then you could configure your script to include an IF..THEN block that will run one set of RUN commands if the database name that is passed in is in a certain list and run the other RUN block if it isn't. You could maintain two "here document" blocks, one for 8i and one for 9i. Therefore, all of the commands can reside in one generic script.
    For example, you could configure your single, generic script as:
    # add your logic checking here to see if a 9i database sid
    # was passed in as a parameter.  If so run the following code
    rman target / log=${sid}bkp_log append << !1
    run
    backup incremental level=0
    not backed up since time='SYSDATE-(8/24)'
    check logical
    filesperset=4
    format='/LVL0_%d_%T_%U'
    (database include current controlfile)
    plus archivelog format '/ARC_%d_%T_%U' delete all input;
    !1
    # if not run the following (ie. 8i databases)
    rman target / log=${sid}bkp_log append << !2
    run
    allocate channel ch01 type 'sbt_tape' parms 'ENV=(TDPO_OPTFILE=/usr/tivoli/tsm/client/oracle/bin/tdpo_${ORACLE_SID}.opt)';
    allocate channel ch02 type 'sbt_tape' parms 'ENV=(TDPO_OPTFILE=/usr/tivoli/tsm/client/oracle/bin/tdpo_${ORACLE_SID}.opt)';
    allocate channel ch03 type 'sbt_tape' parms 'ENV=(TDPO_OPTFILE=/usr/tivoli/tsm/client/oracle/bin/tdpo_${ORACLE_SID}.opt)';
    allocate channel ch04 type 'sbt_tape' parms 'ENV=(TDPO_OPTFILE=/usr/tivoli/tsm/client/oracle/bin/tdpo_${ORACLE_SID}.opt)';
    backup incremental level=0
    check logical
    filesperset=4
    format='/LVL0_%d_%T_%U'
    (database include current controlfile)
    (archivelog all format '/ARC_%d_%T_%U' delete input);
    release channel ch01;
    release channel ch02;
    release channel ch03;
    release channel ch04;
    !2then you could call this generic script with the appropriate command line parameters.
    Hope I'm following your explanation/requirement.

  • Creating variables/parameters from a code module that persist when the sequence is over

    I am creating variables/parameters programmatically in a code module (C#) by passing in the Locals object and calling the method 'NewSubProperty'.
    I've also tried SetValNumber with PropOption_InsertIfMissing.
    But it seems they are only being created in that instance of the sequence, because they are gone when the sequence is over. I really wanted them to persist.
    I wanted to avoid creating station globals dynamically like this, but maybe that's all I can do to make them last.
    Any ideas would be gratefully appreciated.
    Thanks,
    Ronnie
    TestStand 4.2.1, LabVIEW 2009, LabWindows/CVI 2009
    Solved!
    Go to Solution.

    Hi,
    Check out the links on this response
    http://forums.ni.com/ni/board/message?board.id=330&message.id=11226&query.id=267719#M11226
    It maybe of help
    Regards
    Ray Farmer
    Regards
    Ray Farmer

  • URGENT!!! a way to find out if Oracle stored procedures have OUT parameters

    I'm having problemes properly creating a string for the prepareCall().
    so that i can call up a stored procedure in oracle.
    the problem is that some stored procedures have OUT parameters that I have to register, and some stored procedures don't.
    how can i find out if a stored procedure has an OUT parameter or not?
    So that i can format a string with one less ? for statements that don't,
    and one more ? for statements that do have an OUT parameter.
    is there such a method as boolean OUTparameterExist();
    or i'll take any suggestions.

    any other solutions?That was the solution. You don't need to execute any sql statement to get Database Meta Data. You just need a connection, which you use to get the DatabaseMetaData instance
    DatabaseMetaData dbmd = connection.getMetaData();then invoke any of the (numerous) methods to get the info you require
    ResultSet rs = dbmd.getProcedureColumns("mydb","myschema","myproc",null);
    while(rs.next()) {
      String name = rs.getString("COLUMN_NAME");
      if (rs.getShort("COLUMN_TYPE")==DatabaseMetaData.procedureColumnOut) {
        // column is an OUT parameter
    }Dave

  • Variable Parameters for customization

    Hi All,
    As a SCM functional consultant-
    1. What are the variable parameters(like DFF) for customization/apps extn in oracle apps for me?
    2. I will have to prepare/use MD50 docs for apps extension. How can I update my skill on that?
    3. I will have to prepare TE-20(functional part) so how can I make myself strong in that? Whether MD-50 & TE-20 docs of other projects will help or is there any other way also?
    Thanks & regards

    Hi;
    All APIs are listed in Oracle Integration Repository
    http://irep.oracle.com/index.html
    API User Notes - HTML Format [ID 236937.1]
    R12.0.[3-4] : Oracle Install Base Api / Open Interface Setup Test [ID 427566.1]
    Oracle Trading Community Architecture API User Notes, June 2003 [ID 241320.1]
    Technical Uses of Customer Interface and TCA-API [ID 269121.1]
    "12: How To Access API References via the Oracle Integration Repository" [ ID 462586.1]
    "Oracle Integration Repository Documentation Resources Release 12" [ ID 396116.1]
    Pelase also check below:
    Api's in EBS
    Re: Api's in EBS
    http://sairamgoudmalla.blogspot.com/2009/05/script-to-find-oracle-apis-for-any.html
    API
    Fixed Asset API
    List of API
    Re: List of APIs
    Oracle Common Application Components API Reference Guide
    download.oracle.com/docs/cd/B25284_01/current/acrobat/jta115api.pdf
    List of APIs and open interface R12
    Re: List of APIs and open interface R12
    Regard
    Helios

  • What are mapping variables & parameters ?

    1.In real time scenario where can we use mapping parameters and variables?
    2.what are mapping variables & parameters ?

    http://download.oracle.com/docs/cd/E11882_01/appdev.112/e10577/d_xplan.htm#CACICEDJ]
    BPS@xe>explain plan for
      2  select sysdate from dual;
    Explained.
    BPS@xe>select * from table(dbms_xplan.display());
    Plan hash value: 1388734953
    | Id  | Operation        | Name | Rows  | Cost (%CPU)| Time     |
    |   0 | SELECT STATEMENT |      |     1 |     2   (0)| 00:00:01 |
    |   1 |  FAST DUAL       |      |     1 |     2   (0)| 00:00:01 |
    8 rows selected.
    BPS@xe>select * from table(dbms_xplan.display('PLAN_TABLE',null,'BASIC'));
    Plan hash value: 1388734953
    | Id  | Operation        | Name |
    |   0 | SELECT STATEMENT |      |
    |   1 |  FAST DUAL       |      |
    8 rows selected.

  • Calling Procedure B from Procedure A having parameters

    Hi,
    I have two procedures, I m registering first procedure as a concurrent program  like  XXXpackage.main
    I want to call Procudure new_segments_id from Procedure main.
    I need l_old_id  parameter for new_segments_id procedure, so I m passing to main procedure.
    Now, how should i call new_segments_id procedure from main procedure.
    Procedure main(
                           errbuf       OUT VARCHAR2
                          ,retcode    OUT VARCHAR2
                          ,l_old_id    IN  NUMBER
    Procudure new_segments_id(l_old_id    IN  NUMBER
                                             ,l_new_id   OUT NUMBER
    Thanks.

    Not sure if this is what exactly you want but below is an example of propagation of OUT parameters of one procedure as IN parameters to the another procedure within the same package.
    SQL> CREATE OR REPLACE
      2  PACKAGE PACKAGE_TEST
      3  AS
      4    PROCEDURE procedure_1(
      5        out_ename OUT VARCHAR2);
      6    PROCEDURE procedure_2(
      7        v_ename VARCHAR2);
      8  END PACKAGE_TEST;
      9  /
    Package created.
    SQL> CREATE OR REPLACE
      2  PACKAGE body package_test
      3  IS
      4  PROCEDURE procedure_1(
      5      out_ename OUT VARCHAR2)
      6  AS
      7    v_ename VARCHAR2(200) := 'SMITH' ;
      8  BEGIN
      9    SELECT
    10      ename
    11    INTO
    12      out_ename
    13    FROM
    14      emp
    15    WHERE
    16      ename = v_ename;
    17    DBMS_OUTPUT.PUT_LINE('PROCEDURE 1');
    18    procedure_2(out_ename);
    19  END;
    20
    21  PROCEDURE procedure_2(
    22      v_ename VARCHAR2)
    23  IS
    24  v_count number;
    25  BEGIN
    26    DBMS_OUTPUT.PUT_LINE('PROCEDURE 2');
    27    dbms_output.put_line(V_ENAME);
    28    select count(*) into v_count from emp where ename = v_ename;
    29    dbms_output.put_line('COUNT is ' || v_count);
    30  END;
    31  END;
    32
    33  /
    Package body created.
    SQL> DECLARE
      2    ENAME VARCHAR2(5);
      3  BEGIN
      4    package_test.procedure_1(ENAME);
      5  END;
      6  /
    PROCEDURE 1                                                                   
    PROCEDURE 2                                                                   
    SMITH                                                                         
    COUNT is 1                                                                    
    PL/SQL procedure successfully completed.
    Ishan.

  • Call procedure with named parameters

    Call procedure with positional parameters works, but with named parameters gives an ORA-907.
    This post seems similar: Re: Error with report - pkg and bind var
    Run as a script:
    set echo on
    call dbms_stats.delete_table_stats ('ZZZMIG', 'CHAINED_ROWS', cascade_columns=>true, no_invalidate=>false);
    call dbms_stats.delete_table_stats ('ZZZMIG', 'CHAINED_ROWS');
    begin dbms_stats.delete_table_stats ('ZZZMIG', 'CHAINED_ROWS', cascade_columns=>true, no_invalidate=>false); end;
    gives:
    set echo on
    call dbms_stats.delete_table_stats ('ZZZMIG', 'CHAINED_ROWS', cascade_columns=>true, no_invalidate=>false)
    Error starting at line 2 in command:
    call dbms_stats.delete_table_stats ('ZZZMIG', 'CHAINED_ROWS', cascade_columns=>true, no_invalidate=>false)
    Error report:
    SQL Error: ORA-00907: missing right parenthesis
    00907. 00000 - "missing right parenthesis"
    *Cause:
    *Action:
    call dbms_stats.delete_table_stats ('ZZZMIG', 'CHAINED_ROWS')
    call dbms_stats.delete_table_stats succeeded.
    begin dbms_stats.delete_table_stats ('ZZZMIG', 'CHAINED_ROWS', cascade_columns=>true, no_invalidate=>false); end;
    anonymous block completed
    I like the idea of using call, because the procedure name appears in the feedback - useful in longer scripts.
    I'm using SQL Developer Version 1.5.1 Build MAIN-5440
    on Windows XP SP3
    with database EE 10.2.0.3

    CALL is a SQL command which executes a routine
    (procedure/function)
    http://download-uk.oracle.com/docs/cd/B19306_01/server
    .102/b14200/statements_4008.htm
    whereas EXECUTE is a SQL*Plus command which executes
    a single PL/SQL statement
    http://download-uk.oracle.com/docs/cd/B19306_01/server
    .102/b14357/ch12022.htm#i2697931
    Message was edited by:
    Jens PetersenThank you very much, esp. for the links!

  • PLS-00306 calling a procedure with default parameters

    Hi,
    I have the following procedure :
    PROCEDURE P_SUPPRESSION_ENRG (
    DIR in VARCHAR2,
    Tab_Diff_traitee in VARCHAR2,
    TabSup in VARCHAR2,
    ColCode in VARCHAR2,
    Code in VARCHAR2,
    Trig in VARCHAR2 default '',
    Etat in VARCHAR2 default '',
    TypMod in VARCHAR2 default '',
    IndRev in VARCHAR2 default '',
    Crd out NUMBER
    ) is
    END P_SUPPRESSION_ENRG;
    When I run this procedure without the parameters Trig,Etat,TypMod and IndRev, I receive the error PLS-00306 :
    INFOLIG.pck_diff.P_SUPPRESSION_ENRG(Directory,'DIFF_PYLONE_TYPE','DIFF_PYLONE_TYPE','DFP_PYL_CODE_PYLONE',rec.OIP_PYL_CODE_PYLONE,Icrd);
    PLS-00306
    wrong number or types of arguments in call to P_SUPPRESSION_ENRG.
    What have I to do to run this procedure without the parameters Trig,Etat,TypMod and IndRev ?
    Regards,
    Rachel

    hi, i think you are only passing 6 parameters when you called out the procedure p_supperion_enrg. your procedure requires a 10 parameters.
    if you do not want to include Trig,Etat,TypMod and IndRev you can simply put a null value.
      INFOLIG.pck_diff.P_SUPPRESSION_ENRG(Directory,
                                          'DIFF_PYLONE_TYPE',
                                          'DIFF_PYLONE_TYPE',
                                          'DFP_PYL_CODE_PYLONE',
                                          rec.OIP_PYL_CODE_PYLONE,
                                          Null,
                                          Null,
                                          Null,
                                          Null,
                                          Icrd); also you don't need to expplicitly defualt a parameter to null value. it is understood that parameters are initially default to null values.
      PROCEDURE P_SUPPRESSION_ENRG ( DIR              in VARCHAR2,
                                     Tab_Diff_traitee in VARCHAR2,
                                     TabSup           in VARCHAR2,
                                     ColCode          in VARCHAR2,
                                     Code             in VARCHAR2,
                                     Trig             in VARCHAR2,
                                     Etat             in VARCHAR2,
                                     TypMod           in VARCHAR2,
                                     IndRev           in VARCHAR2,
                                     Crd             out NUMBER ) IS
      END P_SUPPRESSION_ENRG;

  • Running a procedure which has parameters using dbms_job.submit

    I have a procedure which accepts some parameter and i need to schedule this using dbms_job in another procedure. My intention is to execute test_proc without waiting for test_asynch_proc
    CREATE or REPLACE PROCEDURE test_asynch_proc(p_1 in number) as
    i number;
    BEGIN
    for i in 1.. 100000
    loop
         insert into item_p values (dbms_random.random, p_1,sysdate);
    end loop;
    commit;
    END;
    I have another procedure which does an asynchronous call to this procedure by scheduling this procedure.
    create or replace procedure test_proc is
    jobno binary_integer;
    --x number :=100;
    begin
         insert into test_table values(1,sysdate);
         dbms_job.submit(job => jobNo,
         what=>'test_asynch_proc(''100'');',
         next_date=>sysdate );
    commit;
    dbms_output.put_line ('insert complete at '|| to_char(sysdate, 'DD-MON-YYYY HH24:MI:SS'));
    end;
    but here instead of
    what=>'test_asynch_proc(''100'');'
    i need to give a variable. How can i do that?
    Thanks,
    mv

    There is another possibility where job parameters are stored in a parameter table with the job number that can be retrieved by the job code:
    bas002>
    bas002> select * from v$version;
    BANNER
    Oracle Database 10g Enterprise Edition Release 10.2.0.2.0 - Prod
    PL/SQL Release 10.2.0.2.0 - Production
    CORE    10.2.0.2.0      Production
    TNS for 32-bit Windows: Version 10.2.0.2.0 - Production
    NLSRTL Version 10.2.0.2.0 - Production
    bas002>
    bas002> drop table t;
    Table dropped.
    bas002> drop table p;
    Table dropped.
    bas002>
    bas002> create table t(x int,d date);
    Table created.
    bas002> create table p(jn int, jp int);
    Table created.
    bas002>
    bas002>
    bas002> create or replace procedure test_asynch_proc as
      2  begin
      3  insert into t select jp, (select sysdate from dual)
      4   from p where jn = sys_context('USERENV','BG_JOB_ID');
      5  commit;
      6  end;
      7  /
    Procedure created.
    bas002> show errors
    No errors.
    bas002>
    bas002> create or replace procedure test_proc (tp number) is
      2  jobno binary_integer;
      3  begin
      4  dbms_job.submit(
      5   job => jobno,
      6   what=>'test_asynch_proc;',
      7   next_date=>sysdate );
      8   insert into p values(jobno, tp);
      9  commit;
    10  end;
    11  /
    Procedure created.
    bas002> show errors
    No errors.
    bas002>
    bas002> alter session set nls_date_format='DD-MON-YYYY HH24:MI:SS';
    Session altered.
    bas002> select sysdate from dual;
    SYSDATE
    28-FEB-2008 10:40:13
    bas002>
    bas002> exec test_proc(1);dbms_lock.sleep(5);
    PL/SQL procedure successfully completed.
    bas002> select * from t;
             X D
             1 28-FEB-2008 10:40:17
    bas002> exec test_proc(2);dbms_lock.sleep(5);
    PL/SQL procedure successfully completed.
    bas002> select * from t;
             X D
             1 28-FEB-2008 10:40:17
             2 28-FEB-2008 10:40:22Message was edited by:
    Pierre Forstmann
    Message was edited by:
    Pierre Forstmann

Maybe you are looking for

  • Need help in creating XSD for a WSDL file to tranform given XML

    Hi, Please let me knoe if this is the right forum to post the query below: We are trying to transform a XML output from a webservice using a XSD file. But we are facing problem as the XML output has some namespace issue and schema due to which transf

  • Image Capture

    I am trying to assign a device (HP OfficeJet Pro 8500 printer/fax/Scanner) to Image Capture. Using browse the device is listed, however I do not seem to be able to get it assigned so that Image Capture will use it. What am I doing wrong. Thanks! JB

  • Can I run apple hardware disk from a clone of the Install disk 2 on an external hard drive?

    I have just installed a new SATA cable and HDD and want to check everything is in order.  I don't have my original disks with me, but I do have copies of both disks on an external hard drive.  Can I use that to run Apple Hardware Test on my machine?

  • Photoshop CS4 and graphic cards. Can cause crashing?

    Since upgrading to CS4 I seem to have increased crashing. Here are my system specs. Mac 2 x 2.66 GHz Dual-Core Intel Xeon 9 GB of Ram 250 GB internal dedicated scratch disc NVDIA GeForce 7300 GT with 256 VRAM After having endless techs look at my mac

  • Problem with JBoss startup in a zone

    Hi! I try to run JBoss inside a sparse-root zone, but encounter a problem during startup, it simply stucks always at a certain point. This is how the zone is configured: root@mantis:/usr/local/Dtrace # zonecfg -z setam-test zonecfg:setam-test> info z