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

Tags: Business Intelligence

Similar Questions

  • ORA-06508, procedure cannot call the procedure of package

    I have a large stored procedure that calls a package (procedure) that manages a number of procedures to determine whether the process can continue or not.  (It checks authorization of the student to enroll in a class).  We have a web process calling the stored procedure, and that works fine.  What does not work, is a call to the package.  Oracle returned ORA-06508: PL? SQL: could not find program unit called.

    I have included instructions for debugging, so I know that it is the specific call to a procedure in the package fails with ORA-06508.  Thinking it's perhaps something in the package, I inserted a debug statement as the first line in the procedure called in the package.    (Debugging instructions call a procedure inserts of rows in a table of debugging with independent validation).

    When I log in the user account with sqlplus and run a test, everything works fine.  But when the web process is running under the same user, the process fails to call the procedure of package and fails with ORA-06508.

    It seems as if the web process runs with the rights of the appellant, or a role is not granted.

    Can someone help me understand what the problem is?

    offered hv, I appreciate your comments.

    We solved the problem: remove the package that couldn't be cited, then re-create.   That's all!

    Apparently, something in the database was tangled upward.   The server recently had problems with disk space, then it might have been related to that.  But we'll never know for sure.

    The stored procedure and packaging (procedures) which he called were owned by the same schema, and there is no mechanism that I can find to prevent one of the other appellant.  But that was the case - Oracle threw the ORA-06508 exception when the stored procedure called the package procedure.

    I replaced the stored procedure and package several times fine-tuning debugging code, but this has not fixed the problem.

    Finally let it drop and then re-create the package, it's which solved the problem.

    Regarding requests to view the code, there is no way that I could reproduce the problem, since the error that occurred was against the permissions and rules which packages run and the procedures of the Oracle.  Thanks for all the tips and suggestions.

  • How to call the procedure on the page of the ofa

    Hi all

    I have a button.when I click this button need to call the procedure and should return the values.i tried with below code.am is error.i am passing two parameters to the procedure.please suggest me where I made a mistake in the code.

    error while calling procedure.PNG

    code in am

    -------------

    public String calprorate (String laseid, String billingid)

    {

    OADBTransaction oadbtransaction = (OADBTransaction) getTransaction ();

    OADBTransactionImpl oadbtransactionimpl = (OADBTransactionImpl) getTransaction ();

    String retValues;

    System.out.println ("number:" + laseid);

    StringBuffer str = new StringBuffer();

    Str.Append ("BEGIN");

    Str.Append (LEASE_PRORATE_PKG ".") LEASE_PRORATE_PROC1 (»);

    Str.Append ("p_lease_id = >: 1");

    Str.Append ("p_billing_id = >: 2");

    Str.Append ("P_PRORATE = >: 3");

    System.out.println ("params");

    Str.Append (»); «) ;

    Str.Append ("END");

    System.out.println ("End");

    OracleCallableStatement oraclecallablestatement =

    (OracleCallableStatement) oadbtransaction.createCallableStatement (str.toString (), 1);

    System.out.println ("Oracle");

    try {}

    oraclecallablestatement.setString(1,laseid);

    oraclecallablestatement.setString(2,billingid);

    oraclecallablestatement.setInt (1, Integer.parseInt (laseid));

    oraclecallablestatement.setInt (2, Integer.parseInt (billingid));

    System.out.println ("param");

    oraclecallablestatement.registerOutParameter (3, Types.VARCHAR);

    System.out.println("3");

    oraclecallablestatement. Execute();

    System.out.println ("exe");

    retValues = oraclecallablestatement.getString (3);

    }

    catch (System.Exception e)

    {

    System.out.println ("delivery");

    throw OAException.wrapperException (e);

    }

    Return retValues;

    System.out.println ("End");

    }

    code co:

    -------------

    If (pageContext.getParameter ("Calc")! = null) {}

    Vo1 OAViewObject = (OAViewObject) am.findViewObject ("AddonBillingVO");

    System.out.println ("VO");

    {if(VO1!=null)}

    CNT int = vo1.getRowCount ();

    System.out.println ("count:" + cnt);

    If (cnt > 0)

    {

    RowSetIterator rs = vo1.createRowSetIterator("empIterator");

    System.out.println ("EMP");

    If (rs! = null)

    {

    While (rs.hasNext ())

    {

    AddonBillingVORowImpl line = rs.next ((AddonBillingVORowImpl));

    System.out.println ("impl");

    If (line! = null)

    {

    String laseid = row.getAttribute("LeaseId").toString ();

    System.out.println (laseid);

    String billingid = row.getAttribute("AddonBillingId").toString ();

    [Serializable] param = {}

    laseid, billingid

    };

    String newupc = (String) am.invokeMethod ("calprorate", param);

    }

    }

    Khalil.

    You can paste your spec procedure here?

    Also see: Oracle tips of Johny: OAF: sample code to call the PL/SQL of OA Framework procedure

  • Avoid calling the procedure in the cursor loop

    Hi all

    The following example of procedure the procedure written in cursor loop, is called each time until the end of the cursor loop...
    procedure proc_main is
    DECLARE
     cursor c1 is 
        select e.empno empno
               ,e.ename ename
               ,d.dname dname
               ,d.loc   loc
        from emp e,dept d
        where e.deptno = d.deptno ;
     
    BEGIN
      for i in c1 LOOP
       proc_test(i.empno,i.ename,i.dname,i.loc) ;
       end loop;
    END;
    -----------
    
    PROCEDURE proc_test (p_empno,p_ename,p_dname,p_loc) is
    ---
    ---
    begin
     select * into v1,v2,v3 ..
      from temp_tab
       where col1 =p_empno
        ----
        ----
    
    end;
    What would be the alternative methods to write the procedure above instead to call the procedure inside the cursor for loop
    My idea is to use collections... could you give me the code example using collections to meet the above criteria

    Thank you

    Published by: smile on February 28, 2012 15:45

    The ideal would be to collect all SQL logic and put as much of it in a single SQL statement as possible. It would be also great to determine what is the final outcome of the process and use it as a starting point for your SQL. For example, if the desired result is to upgrade the salaries of the employees where they have an entry in table x, you might find that you can avoid needing to separate the logic between multiple, i.e. instead of procedures

    procedure proc_main is
    DECLARE
     cursor c1 is
        select e.empno empno
               ,e.ename ename
               ,d.dname dname
               ,d.loc   loc
        from emp e,dept d
        where e.deptno = d.deptno ;
    
    BEGIN
      for i in c1 LOOP
       proc_test(i.empno,i.ename,i.dname,i.loc) ;
       end loop;
    END;
    -----------
    
    PROCEDURE proc_test (p_empno,p_ename,p_dname,p_loc) is
    ---
    ---
    begin
     select * into v1,v2,v3 ..
      from temp_tab
       where col1 =p_empno
        ----
        ----
    
        UPDATE
            emp e
        SET
            sal = v2
        WHERE
            e.empno = p_Empno;
    
    end;
    

    You may simply have

    procedure proc_main is
    BEGIN
    
        UPDATE
            emp e
        SET
            sal = ( SELECT
                        t.new_sal
                    FROM
                        temp_tab t
                    WHERE
                        t.empno = e.empno
                   )
        WHERE
            EXISTS
                (   SELECT
                        NULL
                    FROM
                        temp_tab t
                    WHERE
                        t.empno = e.empno
                );
    
    END;
    

    Even if your logic is more complex, you are likely to find that you can merge several of the statements that you could be running in a loop and replace that loop with a join.

    Given the particular structure of what you posted if, instead of calling the procedure in a loop, you can simply move the cursor c1 as a parameter to proc_test that is

    procedure proc_main is
    
        lc_c1   sys_refcursor;
    
    BEGIN
    
        OPEN lc_c1 FOR
        select e.empno empno
               ,e.ename ename
               ,d.dname dname
               ,d.loc   loc
        from emp e,dept d
        where e.deptno = d.deptno ;
    
       proc_test(c1) ;
    
    END;
    -----------
    
    PROCEDURE proc_test (p_Cursor sys_refcursor) is
    
    begin
    
        LOOP
            FETCH ....
    
            ...DO SOMETHING...
    
            EXIT WHEN p_Cursor%NOTFOUND;
    
        END LOOP;
    
        CLOSE p_Cursor;
    END;
    

    But I highly recommend that you consider trying to merge as much of your SQL before considering the approach of cursor.

    HTH

    David

  • How to call the procedure type table

    Hi I have the below requirement

    Created in the sub table type

    CREATE or REPLACE the TYPE char_type IS the TABLE OF VARCHAR2 (4000);

    create or replace procedure test_proc_type (p_type char_type) is

    Start

    I'm looping 1.p_type.count

    dbms_output.put_line (p_type (i));

    end loop;

    end;

    How to call the procedure with parameter as a type!

    SQL> create or replace type  char_type as table of varchar2(4000)
      2  /
    
    Type created.
    
    SQL> create or replace procedure test_proc_type (p_type char_type)
      2  is
      3  begin
      4    for i in 1..p_type.count loop
      5      dbms_output.put_line (p_type(i) ) ;
      6    end loop;
      7  end;
      8  /
    
    Procedure created.
    
    SQL> set serveroutput on
    SQL>
    SQL> exec test_proc_type(char_type('A','B','C','D','E'))
    A
    B
    C
    D
    E
    
    PL/SQL procedure successfully completed.
    
    SQL>
    
  • Can we call the procedure inside the function?

    Hello

    Can we call the procedure inside the function?

    Thank you
    Brij

    845712 wrote:

    Can we call the procedure inside the function?

    Strange question to ask.

    Yes. This is the standard behavior in most (if not all) procedural and object oriented languages.

    A procedure, function or a method is a unit of code.

    You can call one of the other units. Units can call themselves (recursion). Technically, this means simply by pushing the battery current (to save the stack of the current device memory), the call to the new unit and then popping up battery when control is returned to the unity of the appellant.

    There are very few exceptions to this. The only one that comes to mind programming languages I've used through the years, is natural 1 - could not call a new unit of code to replace the existing one in memory. If no call-and-return was possible.

    Exactly what did you ask this question? Some newcomers to confused Oracle SQL and PL/SQL - two different languages aside server. And then also mistaken for PL/SQL client command vocabulary of SQL * more.

    You will need to make sure that understand the basics of programming (applies to most current programming languages) and Oracle concepts.

  • When I tried to run the sample App "Weather" on ripple Packager for OS 7.0 Bb I got the error

    When I tried to run the sample App "Weather" on ripple Packager for OS 7.0 Bb I got the error

    Oh, Snap! Build request failed with the message: [ERROR] feature is not found in any extension (blackberry.ui.Spinner)

    What should be done to avoid the mistake and build/package for the web app and run it on the device?

    You need install the SpinnerControl extension.

    See "Dependencies" sample weather README on Github:

    https://github.com/BlackBerry/WebWorks-samples/tree/master/weather

  • Call the procedure problem

    Hello
    It's my first day at procedures SQL, my apologies if this question is stupid
    I wrote this procedure which compiles ok:
    CREATE PROCEDURE ADDLOCATION (lid IN locations.location_id%TYPE, ldes IN locations.description%TYPE)AS
    BEGIN
         INSERT INTO LOCATIONS (location_id,description) 
         VALUES (lid,ldes);
    END ADDLOCATION;
    /
    When I try to call this procedure in the script below, it does not work. I can't call a procedure since the BEGIN clause or is my syntax incorrect? Can you explain or explain the error message I'm getting >(PLS-00103: Encountered the symbol "ADDLOCATION" when expecting one of the following::=.) ( @ % ; The symbol ': = ' was replaced by 'ADDLOCATION' continue.)
    Thanks a mil :)
    DECLARE
           highestlid locations.location_id%TYPE;
    BEGIN
           SELECT 
                max(location_id)
           INTO
                highestlid
           FROM
                locations;
           highestlid:=highestlid+1;
           CALL ADDLOCATION(highestlid,'Lucan'); 
    END;
    /
    DECLARE
           highestlid locations.location_id%TYPE;
    BEGIN
           SELECT
                max(location_id)
           INTO
                highestlid
           FROM
                locations;
           highestlid:=highestlid+1;
           ADDLOCATION(highestlid,'Lucan');
    END;
    / 
    
  • Call the procedure to set the context before interactive report refreshes the data

    Hi guys,.

    I have a question mind an interactive report which takes the data in a view.

    The problem is that whenever I take the data from the database I need to define a context (user name and password) before running the query so the view will be taken into account the context and return only the lines that I have access.

    Everything works fine when I'm first loading of the page: I have first to define the context, then load all the data I need on the page, including the IR. But when I try to apply IR filters, or even don't go to the next page no data is returned. I believe this happens because the context is not defined before the execution of the query to load the data and I don't seem to find a way to put it.

    I tried to add a dynamic action on some events on IR (change, clicking, etc.) that executes the procedure to set the context, but without success - even if the event is raised, the report still doesn't return any data.

    Can someone help me with this issue please?

    Florin

    Use the attributes of application security Code PL/SQL of the initialization/cleanup of the database Session to do this: http://docs.oracle.com/cd/E37097_01/doc/doc.42/e35125/bldr_attr.htm#HTMDB28929

  • error Oracle parse_list could call the procedure

    I get the error message "wrong number or type of arguments to call the"parse_list"procedure in Oracle 'Parse_List' package in Oracle 9i.» The parse_list procedure returns an array of strings and I try to access the table. Can someone tell me what the problem with my call to parse_list below? The code is OK if I remove the call. I have also included my code after the description of the procedure for packaging.

    = MY FUNCTION CALL =.
    create or replace function test_parse_list
    return VARCHAR2

    is
    type ARR_STR is table of the varchar2 (32767) index directory.
    Table ARR_STR.
    char DELIM: = ', ';
    String varchar2 (100): = 'a, b, c, d;

    Start
    Array (1): = null;
    Parse_List.parse_list (String, delim, Array);
    return array (1);
    end;

    = DESCRIPTION OF THE ORACLE PACKAGE PROCEDURE =.
    create or replace package parse_list
    is
    -Table used to analyze the delimited record tank with parse_list
    TYPE ARR_STR IS TABLE OF THE VARCHAR2 (32767) INDEX DIRECTORY.

    -load an array of string with values scanned from a list delimited by the tank
    -given a string or a file to be reviewed, the single-character delimiter (for example, ',')
    -first entry is in element 1
    -Treaty the single area as NULL
    PROCEDURE parse_list)
    P_STR IN VARCHAR2
    p_delim in TANK
    p_arr to ARR_STR);
    -load an array of string with values scanned from a list delimited by the tank
    -given a string or a file to be reviewed, the single-character delimiter (for example, ',')
    -first entry is in element 1
    -Treaty the single area as NULL
    END;
    ========================================

    Hello

    Welcome to the forum!

    The p_arr argument must be the type defined in the package.
    You cannot substitute your own type, even if the name and the definition are identical.

    Try this:

    create or replace function test_parse_list
    return VARCHAR2
    
    is
       array xyz.ARR_STR;
       ...
    

    where xyz is the name of the package. (I see no parse_list in the Oracle supplied packages 9 manual).

  • 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

  • I'm having problems trying to use the

    IM Tony, I have an iPhone 6 more and since the update, I tried to use the animated messages but seems that theres also problem with the power button. The arrow leaves no other icons appear.

    Hi Indestruct1,

    I understand that you encounter some problems that can use the new screen effects and effects in the bubble Messages application. I have updated to iOS 10 as well and I love the new effects. I'll be happy to review some information for you.

    Use of the effects of message with iMessage on iPhone, iPad and iPod touch, this article stipulates that

    You need iMessage to send from the effects of the message. If you are unsure if you use iMessage or SMS/MMS texts, learn the difference. If you cannot send or receive effects of bubbles, make sure that you haven't reduce Motion activated.

    The same applies if you can't send or receive screen effects, check that reduce the Motion is turned off.

    Thank you for bringing your question in Apple Support communities. Have a great weekend.

  • Satellite L300: problems trying to get the CD player work

    Currently, I have a Satellite L300 unit and have problems trying to get my CD drive work.

    Recently, I deleted the cd player, completely by chance instead of a printer.
    Now it won't reinstall and no update driver makes no difference.
    Anyone have any ideas?

    First of all, try to restore Windows back to a Restore Point prior to a date before the problem occurred. System Restore is in the start menu-> programs-> Accessories-> system tools

    Then try to remove the CD/DVD filters in the registry, and then restart. Windows should find the CD Player automatically, unless the registry has been messed up.

    When the associated CD/DVD (such as iTunes, Nero, virtual CD software), the software is installed, they install filters in the registry, which can cause compatibility problems.

    (1) run Regedit (start-> Run-> Regedit)
    2) navigate to HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Contro l\Class\ {4D36E965-E325-11CE-BFC1-08002BE10318}
    (3) in the right pane, delete the "UpperFilters" key and delete the key "LowerFilters".
    (4) restart.

    If your CD/DVD programs stop working, you will need to reinstall them (preferably with an updated version).

  • How can I change my country? I tried to call the number but it does not work

    I'm about to pay the photo plane, but when he says to put my address it gives me just as an alternative to the United States, and I don't live there anymore. Tried calling the number it gives but does not work

    A few changes/Verify account https://forums.adobe.com/thread/1465499 links that can help

    -Credit card https://helpx.adobe.com/x-productkb/policy-pricing/membership-subscription-troubleshooting-cr creative - cloud.html

    -e-mail https://forums.adobe.com/thread/1446019

    -html http://helpx.adobe.com/x-productkb/policy-pricing/change-country-associated-with-adobe-id.

  • How to call the procedure Oracle in ODI

    Hello

    I use ODI 10 g.

    Before you run the interface in a package, I wanted to place my procedure.

    I created the procedure in d/b (target)

    CREATE OR REPLACE PROCEDURE TEST_MY_NEW_PROCE
    AS
    BEGIN
    REMOVE FROM EMPLOYEE_TABLE
    WHERE EMPLOPYEE_ID LIKE '% P ';
    COMMIT;
    END;
    /

    The procedure works well in the target database.

    Now, before the execution of my interface, I want to run this procedure in my package. So can some please help me how to call this oracle (creation in target schema) ODI procedure and run it.

    Thank you.

    Hi, GRK,.

    You can create an ODI procedure, add one step, choose Oracle as technology and your target schema.
    Then just call it through a pl/sql block:

    BEGIN
     TEST_MY_NEW_PROCE;
    END;
    

    In your package, then drag this ODI procedure.

    Kind regards
    JeromeFr

Maybe you are looking for

  • Satellite M200 screen turns off after that start & battery does not charge

    Hello, I am from Jakarta, IndonesiaI have a problem with my Toshiba Satellite M200 Notebook (running Windows 7 Home Premium) After I press the power button to the top of my laptop, it works fine display BIOS and Windows startup screen.but after that

  • When I opened a second browser window, I get error messages and a non-functional browser window.

    Messages are: ' Exc in ev handl: TypeError: brw is not defined "in a small window labeled" [JavaScript Application] and, after clicking on "OK" in this window, a browser window opens with none of my recorded options with the following: "bitsMarkingCo

  • Toshiba e-studio 206 does not print USB cable

    Hello! We have Toshiba e studio 206 which is installed with the usb cable.Official drivers for e-studio 206 granted official website (here and later - a Russian) had been installed without error, the device shows any errors as well and can be used as

  • Tecra S3 - blue screen after first before installation

    I bought a new Tecra S3 and is the first time installation with recovery DVDs before installation and the system will reboot and crash blue screen first boot. I returned to the dealer and change an another Tecra S3 so same problem continues... I can'

  • Delete AutoFill suggestion!

    Good evening My apologies if this is in the wrong section, but I don't know where to ask! Basically, I missed part of my email address once when I was typing it and now I always get the wrong suggestion. How can I remove this please? It makes me craz