Call a procedure that returns a refcursor, use it in an another proc sql?

I have a procedure that returns a refcursor; How can I include this refcursor in a sql statement that is inside another procedure, or view etc.?

This is the kind of foolery, I tried so far (myproc1 returns a ref cursor):

create or replace procedure myproc2
(
slider ref RC
)
AS
RC1 of ref cursor;
Start
EXECUTE myproc1 (rc1).
Open rc for
Select rc1.* in the rc1;
end myproc2;

If you want to use the result set in an SQL Ref Cursor won't be of any help. Can be read all nested Table Type. You can declare an object type and store your result in them and use them in SQL.

Thank you
Knani.

Tags: Database

Similar Questions

  • Call a procedure that returns an array of the results of dotnet

    Hi I have a function in the database (see below), I am creating a Web page and you want to call the function and get the results, how can I do this in dotnet using the ODP.net. does anyone have a code please... I called procedures in the database that return of refCursors but not tables.


    Type rec_user is record (call varchar2 (200),)
    Identification number);

    Type tab_user is table of the rec_user;

    function populate_user (piusername in varchar2) return tab_user;

    ------------------------------
    Concerning
    Ash

    Hello

    Registration table is a PLSQL type and cannot be called from OIC (this is what ODP.NET is written in). If you change the procedure to return the table or Varray of the object instead, you could do that with the support of the UDT available in ODP 11106.21 and higher.

    There is an example in this thread that you may find useful:
    By the way the table of the UDT or Collection, as IN to the OracleDbType.InputOutput HELP

    It will be useful,
    Greg

  • Calling a procedure that returns a cursor in a procedure

    Hello
    I have two stored procedures. They both return a cursor as output variables. However, I have another stored procedure that calls these procedures and return their results once again an output variable. I know that sounds strange to want to do something like this, but how can I do this?

    Mikhail says:

    My first procedure returns a cursor. But the cursor is opened on one condition. Like, if PARAM1 = 1 THEN OPEN cursor_1 to SELECT... OTHERWISE, OPEN CURSOR_1 TO SELECT... And the second slider has the same structure. The thing is in the two procedures if I declare that a single CURSOR_1 IN OUT parameter that the procedure will not work. So in both entities, I have two variables IN OUT SYS_REFCURSOR: c1 and c2. Then, in the third procedure I first call the first procedure, then the second. How can I write my third procedure in order to obtain the result two procedures United?

    Why the appellant (3rd procedure) need to have 2 ref Cursor? How will the appellant to "unite" the sliders?

    The actual data, a power of work must be done inside sliders. Not in PL/SQL or other languages. The SQL language is a very powerful and flexible language.

    So if the SQL 2 data sets (or more) must be "United", then you should not use the 3rd procedure and PL/SQL code to do. Should use you 2 sliders.

    You should watch this by using SQL only. The 2 sets of data can be merged, joined, union'ed. You can determine the intersection. You can determine the difference (with a negative sign). It can be rotated. It can be aggregated. It can be cube' ed. Etc.

    This SQL will then be used as a single slider and a unique reference cursor handle will be used to consume the output of the cursor.

    The basic rule to develop Oracle applications is simple. Optimize SQL. Minimize the PL/SQL.

    Use the SQL language to the data of the crisis. No PL/SQL.

  • Calling an Oracle stored procedure that returns a REF cursor

    Hi guys,.

    I'm calling an Oracle stored procedure that returns a REF CURSOR. Here is the piece of code that I'm working on:

    procedure TC307_MAIN (p_program varchar2, varchar2, varchar2, result_set OUT eng_cur p_engchgno p_project) as
    Start
    IF (p_program = 'Navybased' and p_project = 'PROTECTOR-BUILD') THEN
    result_set: = comments. Tc307_Eng_Chg_Rpt.TC307_RNZN (p_engchgno, result_set = >);
    END IF;
    end TC307_MAIN;

    procedure TC307_RNZN (p_engchgno varchar2, result_set IN OUT eng_cur) as
    Start
    end TC307_RNZN;

    PL/SQL code behind TC307_RNZN is big enough, that's why I've not stuck here. Basically, the second stored procedure executes a PLSQL statement and returns a result set. I need to return the result_set in the main proceedings based on nested else statement which I am still trying to build. I get a compilation... error can someone guide me with the correct method to call the second stored procedure and returning in the main proceedings.

    Thank you very much.

    Rohan,

    Try this

    procedure TC307_MAIN(p_program  varchar2,
                           p_project  varchar2,
                           p_engchgno varchar2,
                           result_set OUT eng_cur) as
      begin
           IF (p_program = 'RNZN' and p_project = 'PROTECTOR-BUILD') THEN
                  -- This is a procedure not a function
                         guest.Tc307_Eng_Chg_Rpt.TC307_RNZN(p_engchgno, result_set); --UR compilation error on this line*
          END IF;
      end TC307_MAIN;
    

    SS
    http://DB-Oracl.blogspot.com

  • How to execute a stored procedure that returns a cursor?

    How to execute a stored procedure that returns a cursor?

    Follow the code:

    CREATE OR REPLACE PROCEDURE stp_cashin_grupo
    (p_func in VARCHAR
    p_cod_grup in full
    p_des_grup in VARCHAR
    p_logi in VARCHAR
    p_curs_rset ON infoc.pck_cashin_grupo.curs_rset
    )
    IS
    BEGIN

    If p_func = "1" then
    OPEN FOR P_curs_rset
    Select
    cod_grup
    des_grup
    dat_manu_grup
    des_logi_manu
    of infoc.tbl_cashin_grupo
    order of des_grup;
    end if;
    END stp_cashin_grupo;


    and packaging:

    CREATE or REPLACE PACKAGE pck_cashin_grupo
    AS
    TYPE curs_rset IS REF CURSOR;
    END pck_cashin_grupo;

    My question is how to execute in sql plus?
    Stp_cashin_grupo EXEC ('1', 0, ", '465990', my doubt is how to move the cursor as return)


    Thank you

    It is described in the manual

    http://download.Oracle.com/docs/CD/B19306_01/server.102/b14357/CH5.htm#sthref1122

  • How to call a function that returns a SYS_REFCURSOR?

    Here's the situation.
    If I use ODP. NET to get a REF_CURSOR of a procedure in a package that it works without a hitch.

    If I use ODP .NET to run an Oracle function that returns a REF CURSOR, all sorts of things fool you.
    I use .NET 3.5 and ODP .NET version 2.112.1.2 (11 G). My Oracle database is 9.2.0.7.0

    There is this function returns a REF CURSOR.
    The code looks something like this.
    CREATE OR REPLACE FUNCTION SENDMEAREFCURSOR RETURN SYS_REFCURSOR IS
      X_REF genPkg.genericcursor;
    BEGIN
      OPEN X_REF for
        SELECT customer_id, name FROM CUSTOMERS;
      Return X_REF;
    END;
    .NET code looks like this. It's after a few adjustments.
            private static OracleDataReader FireMyFunc(OracleConnection oc)
            {
                try
                {
                    OracleCommand cmd = new OracleCommand();
                    cmd.Connection = oc;
                    //cmd.CommandText = "SELECT sendmearefcursor FROM DUAL";
                    //cmd.CommandType = System.Data.CommandType.Text;
                    cmd.CommandText = "sendmearefcursor";
                    cmd.CommandType = CommandType.StoredProcedure;
                    OracleParameter prm = cmd.CreateParameter();
                    prm.OracleDbType = OracleDbType.RefCursor;
                    prm.ParameterName = "returncurse";
                    prm.Direction = ParameterDirection.ReturnValue;
                    cmd.Parameters.Add(prm);
                    cmd.ExecuteNonQuery();
                    return (OracleDataReader) prm.Value; //Throws an UnableToCast exception.
                }
                catch (System.Exception ex)
                {
                   Console.WriteLine(String.Format("FireMyFunc: {0}",ex.ToString()));
                    throw;
                }
            }
    What should I do to get the refCursor?

    Hello

    You can use the GetDataReader of the OracleRefCursor object to return the datareader object.

    OracleRefCursor rc is prm (OracleRefCursor). Value;
    return of rc. GetDataReader();

    HTH
    Jenny

  • Cannot configure DBAdapter to call the procedure that takes no parameters

    Hello

    I created a test as a package below:

    create or replace package Tester
    as
    Main1 procedure;
    procedure (x VARCHAR2) Main2;

    end;

    create or replace package body Tester
    as

    procedure Main1
    is
    Start
    insert into ziptest values (' Main', sysdate);
    commit;
    end;

    procedure (x VARCHAR2) Main2
    is
    Start
    insert into ziptest values (' in Main2 :'|| x, sysdate);
    commit;
    end;

    end;
    ----------------------------------------
    When I try to configure a DB adapter to call the Main1 procedure, that I'll meet with the following error:
    An error occurred while getting stored procedures. Verify that the database connection is valid.

    If I try to configure the DB adapter to call Main2, it works without problem.
    In addition, this occurs only when the procedure is in a package. If the procedure is independent, no error is delivered.

    Is this a known bug or am I missing something. I use Jdev 10.1.3.4 and SOA Suite 10.1.3.4.

    Kind regards

    Amit

    Hi Amit,

    This is a bug in the wizard of DBAdapter. Try to update BPEL for the latest available patch, and if this does not work here workaround has been tested to work on 10.1.3.1 too!

    1. modify "Main1' to"Main1 (dummy IN VARCHAR2)"in your package.
    2. use the wizard of DBAdapter as ususal to create a partner link that hits this procedure has changed.
    3. change your procedure "Main1" back to the way it was IE without any parameters.
    4. in your BPEL process file, find the file .xsd to Main1 generated by the wizard in step 2. Replace ... inside the for the "InputParameters" element with an emty tag.

    Now, go ahead and invoke this link partner as usual. It would work! ;)

    Kind regards
    Ravi

  • Hi friends I want to know how to call a procedure that has values arrary as parameter?

    I have a procedure as shown below, and I am using oracle 11g.

    create or replace procedure procedureName (v_hospital_id in NUMBER,

    v_process_id VARR_VARRY,

    v_cnt OUT NUMBER);

    Now, how to call this procedure from PLSQL. If v_process_id values ('abc123', 'xyz234', 'sfs234')

    Please present the definition of VARR_VARRY

    If it's a simple table of varchar2.

    declare

    v_cnt NUMBER;

    Start

    procedureName (1, VARR_VARRY('abc123','xyz234','sfs234'), v_cnt);

    end;

  • How to fix the error by calling the procedure that contains THE mode variable

    Hello

    I managed to create a procedure.
    create or replace procedure A_three_num2
    (n_1 number,
    N_2 number: = 2.
    n_3 number: = 3)
    as
    Start
    n_1: = n_2 + n_3;
    dbms_output.put_line (n_1);
    end;

    So I called procedure expects number 8 to display.
    Start
    A_three_num2 (n_2 = > 4, n_3 = > 4);
    end;

    But I got an error. Would you please help me understand the problem?
    ORA-06550: line 2, column 1:
    PLS-00306: wrong number or types of arguments in the call to 'A_THREE_NUM2 '.
    ORA-06550: line 2, column 1:
    PL/SQL: Statement ignored
    1. start
    2 A_three_num2(n_2=>4, n_3=>4);
    3. end;

    Thank you
    Guy

    Try this->

    set serveroutput on
    
    declare
      c_out number;
    begin
      A_three_num2(c_out,4,4);
      dbms_output.put_line('result is: '||c_out);
    end;
    

    Kind regards.

    LOULOU.

  • Calling a database procedure which returns the array as output parameters

    Hello


    I wanted to call a procedure that returns "T_Disponibilidad_Diaria".

    Type T_Disponibilidad_Diaria is Table of the R_Disponibilidad_Diaria
    INDEX OF DIRECTORY;


    Type R_Disponibilidad_Diaria is {Record

    }

    Please suggest me the best way to convert this type of array complex java object
    Thanks in advance


    Concerning
    Vidya

    But what you can do...

    Try to create a new stored procedure, which returns the type of the database object.
    In this procedure, you can call the original procedure.
    Take what it returns and make the type object. That's what you need to retrieve your procedure ;-) (.. .huh?)

  • test a SP that returns a CURSOR

    I am using Oracle 11 and trying to use SQL Developer. However, I can't seem to get the DEBUGGING to work to test the call a SP that returns a cursor.

    I wrote a small test program to test, but they do not compile and I'm not sure why not. Can help you?

    the first code fragment is a package that I have that has a defined CURTYPE. It is used throughout my request, when you declare a cursor:
    create or replace
    PACKAGE          "SP_STATE" 
    Is
        type     curtype is ref cursor;
    ...
    now, here's the first part of the SP I want to test. Note that I've defined PriceCur as using the CURTYPE package.
    create or replace
    PROCEDURE          "USP_GETL_ACCOUNT_PRICES" (
      AcctNo          in     marketer_account.mka_last_full_css_acct_no%type,
      MktrNo          in     marketer_account.mka_mktr_no%type,
      Status                     in              varchar2 default null,     
      PriceCur          out            sp_state.curtype
      )
    as
    begin
    Open Pricecur For 
    Select 
    ...
    Now, here's my m.o.:
    Declare 
       Price_Cur  Sp_State.Curtype;
       price_rec  price_cur%rowtype;
    Begin
       Usp_Getl_Account_Prices('302189139000026', 11813,'A', price_cur);
       Open Price_Cur;
       Loop
          Fetch Price_Cur Into Price_Rec;
          Exit When Price_Cur%Notfound;
          dbms_output.put_line(price_cur%rowcount || ') ' || price_rec.apr_account_price_id);
       End Loop;
       close price_cur;
    end;
    They do not compile. What I'm doing here is call SP - pass 3 incoming parameters and retrieve a cursor.
    so I want to loop through the cursor and list some fields on...

    Where I'm going wrong? Any help would be greatly appreciated.

    Sean

    userLynx wrote:
    I get this error:

    Error report:
    ORA-06504: PL/SQL: return variables of the game results or the query types do not match
    ORA-06512: at line 7
    + 06504. 00000 - "PL/SQL: return of the variable result set or query types do not match." + "
    * Cause: Numbers or types of columns in a query does not match declared.
    return type of a variable result is defined or declared two result types
    Set of variables do not match.
    * Action: Change the program or the declaration statement. Check what query variable +.
    actually we want during execution.

    He doesn't like the var defined as varchar2. I can change that to a % rowType heart?

    When I proposed to modify the code according to your needs, I assume that you would like to change the instruction WRT Fetch your columns retrieved in the Refcursor; And so I suggest no changes in it.

    As riedelme says, a record would help for better maintainability. :)

    You do not experience other errors, you met earlier, right?

    Kind regards
    P

    Published by: Jen K on July 12, 2012 12:04 AM

  • Calling stored procedure - re-edited NullPointerException

    Hi all

    I am re-editing that my first attempt was quite low.

    I want to create a Java application that communicates with an Oracle XE database edition to:

    Class.forName ("oracle.jdbc.driver.OracleDriver");
    JOptionPane.showMessageDialog (null, "Driver loaded");
    Connection con = DriverManager.getConnection ("jdbc:oracle:thin:@//localhost:1521/xe", "SYSTEM", "root");
    JOptionPane.showMessageDialog (null, "database connected");

    This all works fine and I can perform queries and transactional instructions within the instance of java.

    However, I can't call stored procedures that I will receive a null pointer exception. The stored procedure, I try to call returns values however I know it works as I can run it in SQL Developer. The code below is the statement that calls the stored procedure, alll the sources I looked at it's correct, I also tried, cs.executeUpdate and Resultset rs when you try to call the java statement.

    public void thread_actionsperformed (ActionEvent c) //generates son
    {
    Try
    {
    CallableStatement cs = con.prepareCall ("{call PROCEDURE2}"); Calls a stored procedure that would generate threaded emails
    CS. Execute();
    JOptionPane.showMessageDialog (null, "Algorithm Threading successfully Executed");
    }
    catch (SQLException ex)
    {
    ex.printStackTrace ();
    JOptionPane.showMessageDialog (null, "Threading algorithm Executed without success"); Error response
    }
    catch (NullPointerException ex)
    {
    ex.printStackTrace ();
    JOptionPane.showMessageDialog (null, "Threading algorithm Executed without success"); Error response
    }
    }

    The Java application cannot 'see' the sp? Or is it something to do with privileges? I was puzzled by this during some time now, any help would be greatly appreciated.

    java.lang.NullPointerException
    at ETA_Final.thread_actionPerformed (ETA_Final.java:332)
    to ETA_Final$ 5.actionPerformed(ETA_Final.java:141)
    at javax.swing.AbstractButton.fireActionPerformed(AbstractButton.java:1995)
    in javax.swing.AbstractButton$ Handler.actionPerformed (AbstractButton.java:2318)
    at javax.swing.DefaultButtonModel.fireActionPerformed(DefaultButtonModel.java:387)
    at javax.swing.DefaultButtonModel.setPressed(DefaultButtonModel.java:242)
    at javax.swing.AbstractButton.doClick(AbstractButton.java:357)
    at javax.swing.plaf.basic.BasicMenuItemUI.doClick(BasicMenuItemUI.java:1223)
    in javax.swing.plaf.basic.BasicMenuItemUI$ Handler.mouseReleased (BasicMenuItemUI.java:1264)
    at java.awt.Component.processMouseEvent(Component.java:6263)
    at javax.swing.JComponent.processMouseEvent(JComponent.java:3255)
    at java.awt.Component.processEvent(Component.java:6028)
    at java.awt.Container.processEvent(Container.java:2041)
    at java.awt.Component.dispatchEventImpl(Component.java:4630)
    at java.awt.Container.dispatchEventImpl(Container.java:2099)
    at java.awt.Component.dispatchEvent(Component.java:4460)
    at java.awt.LightweightDispatcher.retargetMouseEvent(Container.java:4574)
    at java.awt.LightweightDispatcher.processMouseEvent(Container.java:4238)
    at java.awt.LightweightDispatcher.dispatchEvent(Container.java:4168)
    at java.awt.Container.dispatchEventImpl(Container.java:2085)
    at java.awt.Window.dispatchEventImpl(Window.java:2475)
    at java.awt.Component.dispatchEvent(Component.java:4460)
    at java.awt.EventQueue.dispatchEvent(EventQueue.java:599)
    at java.awt.EventDispatchThread.pumpOneEventForFilters(EventDispatchThread.java:269)
    at java.awt.EventDispatchThread.pumpEventsForFilter(EventDispatchThread.java:184)
    at java.awt.EventDispatchThread.pumpEventsForHierarchy(EventDispatchThread.java:174)
    at java.awt.EventDispatchThread.pumpEvents(EventDispatchThread.java:169)
    at java.awt.EventDispatchThread.pumpEvents(EventDispatchThread.java:161)
    at java.awt.EventDispatchThread.run(EventDispatchThread.java:122)

    Thank you and best regards,

    K

    Published by: Outbound86 on April 28, 2010 13:58

    Hi Kev,

    I expected this - so is it possible that your dumb object is null when you are in the ActionListener who manages the procedures?
    How will you spend until you use it (line 332), are you using Threads?

    Thnaks,
    Ivaylo

  • java.sql.SQLException: ORA-06550 and ORA-00900 call stored procedures

    Hi all

    I have 2 a stored procedures that I want to call from my Session bean. One of them takes a few settings, but not the other. When I call the procedures, I get the following errors described below. I tested the two stored procedures in sql plus and sqldveleoper and they work well. The funniest, it is, I have another stored procedure that I can call successfully from the same bean in session with no problems, so I'm a bit confused as to why his play now.

    I use stand-alone 10.1.3.4 OC4J and Oracle 10 g Db 10.2.0.4 and platform DB that I use is Oracle10gPlatform and Eclipselink as my JPA provider. I have also tried against toplink (not toplink essentials) and still no joy

    Here is the error I get when I try and call the procedure which takes the parameters of the session bean
    Internal Exception: java.sql.SQLException: ORA-06550: line 1, column 7:
    PLS-00306: wrong number or types of arguments in call to 'HASHDATA'
    ORA-06550: line 1, column 7:
    PL/SQL: Statement ignored
    
    Error Code: 6550
    Call: BEGIN HashData(input=>?, hashedValue=>?, hashed=>?); END;
         bind => [password1, => hashedValue, => hashed]
    Query: DataReadQuery()
    Here are my stored procedure that take parameters
    create or replace procedure hashData(input IN VARCHAR2, hashedValue OUT BLOB, hashed OUT BOOLEAN)  as  
    
    inputRaw RAW(2000);
    --hashed BOOLEAN := false;
    begin 
    
    dbms_output.put_line('the data to be hashed is '||input);
    
    dbms_output.put_line('converting input to raw ...');
    inputRaw := utl_i18n.string_to_raw(input,'AL32UTF8');
    
    dbms_output.put_line('Hashing Data ...');
    hashedValue := DBMS_CRYPTO.Hash (src=>inputRaw,typ=>DBMS_CRYPTO.HASH_SH1);
    
    dbms_output.put_line('hash is '||UTL_I18N.raw_to_char(dbms_lob.substr(hashedValue, 4000,1)));
    
    if (hashedValue  is not null) then 
     
    
     hashed :=true;
      dbms_output.put_line('hashedValue IS NOT  null');
     else
     hashed := false;
      dbms_output.put_line('hashedValue IS null');
     end if;
    
    end;
    Here is my code in the session bean to call the procedure that takes as parameters (Hashdata)

    public UserBean() {
              // TODO Auto-generated constructor stub
    
              sessMan = SessionManager.getManager();
              session = sessMan.getSession("Session", Thread.currentThread()
                        .getContextClassLoader());
    
         }
    
    public Serializable hashData(String input){
    
              logger.debug("Hashing Data ... "); 
              hashedValue= null; 
              boolean hashed=false; 
         
              StoredProcedureCall call = new StoredProcedureCall();
    
              ValueReadQuery query = new ValueReadQuery();
              call.setProcedureName("HashData");
              call.addNamedArgumentValue("input", input);
              call.addNamedOutputArgument("hashedValue", "hashedValue", java.sql.Blob.class);
              call.addNamedOutputArgument("hashed", "hashed", java.lang.Integer.class);
                        
              query.addArgument("input");
              
              query.setCall(call);
              
              session.executeQuery(query);
               
              if ((Boolean)hashed){
                   logger.debug("The data has been hashed and the hash value is: "+hashedValue);
              }
              
              else{
                   logger.debug("The data has could not be hashed");
                   hashedValue=null;
              }
              
              return (Serializable)hashedValue;
              }
    When I call the other takes no parameters, I get the following error.
    Internal Exception: java.sql.SQLException: ORA-00900: invalid SQL statement
    
    Error Code: 900
    Call: BEGIN testJPAProc(); END;
    Query: DataReadQuery()
    Here is the procedure which takes no parameters
    create or replace procedure testJPAProc is 
     
     begin
     dbms_output.put_line('testJPAProc called');
     end;
    Heres is the code to call procedures that take no parameters
                                    StoredProcedureCall call = new StoredProcedureCall();
      
              ValueReadQuery query = new ValueReadQuery();
              
              call.setProcedureName("testJPAProc");
              query.setCall(call);
              
              session.executeQuery(query);
    You guys can tell me where I'm wrong if I do something wrong. Why make these mistakes? because as far as I can tell the code (java and pl/sql) are both correct unless there is something I missed. It's kinda funny because I have another stored procedure I can call successfully.


    Thank you

    The first question is that the Boolean in Oracle is not a supported JDBC type, but a PLSQL type.
    Change to an INTEGER is probably the best, you can also use the PLSQLStoredProcedureCall class to access.

    The second problem is perhaps that the stored procedure is not valid, make sure that it compiled correctly. It can also be the type of your query, you must use a DataModifyQuery, not a read request that it returns nothing.
    If still no luck, try to call directly through JDBC, it works?

    ---
    James: http://www.eclipselink.org: http://en.wikibooks.org/wiki/Java_Persistence

  • Do stuff to PL/SQl that returns the value and redirect to modal page by setting this value

    Hello

    a button click Page1 I would perform a PL/SQL procedure that returns a value in P1_ITEMVAL and then redirect to a page 2 (modal page) and the value of an item on this page with the value previously returned. To do the same thing with a normal page is quite easy:

    Button action is present, then process of PL/SQL that returns the value in the P1_ITEMVAL element and, finally, a branch at page 2 that sets P2_ITEMVAL with P1_ITEMVAL. I really have no idea how to do the same thing when the target is a modal page.

    I created a unit test on https://apex.oracle.com/pls/apex (application 1554 - redir_to_modal)

    Workspace: tests

    USER: supporter

    PWD: supporter1234

    Any help would be much appreciated.

    Kind regards

    Pavel

    Pavel

    If you prepare a URL using the value calculated in the PLSQL of DA part you can then use a subsequent stage of javascript to set the location of the window.

    This will jump to the top of the page of the modal dialog box

    : P1_URL: = apex_util.prepare_url)

    ' f ? p ='|| : APP_ID - Application id

    |': 2' - Page id

    ||': ' || : APP_SESSION - Session id

    ||':'                      -- Request

    ||':NO'                    -- Debug

    : ': ' - Clear Cache

    : ': ' - Settings

    ||' P2_ITEMVAL'

    : ': ' - Parameter values

    || (: P1_ITEMVAL);

    then in the action of javascript

    Window.Location.Replace ($v ('P1_URL'));

    Hope this is of some use

    Concerning

    Kelvin

  • Problems trying to call the procedure in a PL/SQL package.

    We use BI Publisher 10.1.3.4.1.

    I am trying to call a procedure in a package by using a data model, as I read it is the best way to do it.

    Here's the package. Very straightforward, just insertion of a row in a table to try this out. I tested the procedure and that it works correctly.

    -----
    CREATE OR REPLACE PACKAGE JM_PKG_OBIEE_ETL_TEST

    -Declarations of function and public procedure
    PROCEDURE INSERT_TEST_ROW;


    END JM_PKG_OBIEE_ETL_TEST;
    /
    CREATE OR REPLACE PACKAGE BODY JM_PKG_OBIEE_ETL_TEST

    -Function and procedure implementations
    PROCEDURE INSERT_TEST_ROW IS

    NUMBER OF NEXT_ID;

    BEGIN

    SELECT COUNT ()) + 1 IN EDDWMAN NEXT_ID. JM_OBIEE_ETL_TEST;

    INSERT INTO EDDWMAN. JM_OBIEE_ETL_TEST
    (ID, VALUE, DATE_STAMP)
    VALUES
    (NEXT_ID, 'Test' |) NEXT_ID, SYSDATE);

    COMMIT;

    EXCEPTION
    WHILE OTHERS THEN
    RAISE_APPLICATION_ERROR (-20001,
    "An error occurred"; SQLCODE.
    "- ERROR -" | SQLERRM);

    END INSERT_TEST_ROW;

    END JM_PKG_OBIEE_ETL_TEST;
    -----

    Here is the data model that I use. When I run it, I get a syntax error. If I change the "defaultPackage' to"defaultPackage", thus eliminating the appeal of the package, the data model works very well and I get an xml output of what is in the table.

    -----
    < name of dataTemplate = 'test' than one dataSourceRef = 'Oracle BI EE"defaultpackage ="JM_PKG_OBIEE_ETL_TEST">
    < name dataTrigger = source "beforeReport" = "JM_PKG_OBIEE_ETL_TEST. INSERT_TEST_ROW "/ >"
    < dataQuery >
    < SQLStatement instance name = "test_results" >
    <! [CDATA [SELECT ID, saw_2, DATE_STAMP SDS saw_3 VALUE saw_1. JM_OBIEE_ETL_TEST]] >
    < / sqlStatement >
    < / dataQuery >
    < dataStructure >
    < name of group = "G_TEST_RESULTS" source = "test_results" >
    < element name = "test_ID" value = "saw_1" / >
    < element name = "test_value" value = "saw_2" / >
    < element name = "test_DATE_STAMP" value = "saw_3" / >
    < / Group >
    < / dataStructure >
    < / dataTemplate >
    -----

    Any suggestions? Y at - it configuration settings that can be disabling package calls? This package is located in the same schema as the table is in and I can see the data in this table to OBIEE & BI Publisher.

    Thoughts?

    Published by: Jared Moe on June 30, 2011 12:42

    Published by: Jared Moe on June 30, 2011 12:45

    Yes you must change the procedure in function first. In addition, even if you do not use parameters here if passing them in you must also declare their in the package specification in the exact order you have set them up in your data source. Change your name to BeforeReportTrigger function (and note the case-sensitive characters). Here is the code that I modified.












    I hope this helps.

    Steve

    Published by: Steve P on July 1, 2011 14:12

    Published by: Steve P on July 1, 2011 14:14

    Published by: Steve P on July 1, 2011 14:14

Maybe you are looking for