ORA-14551 when using rules manager inside a SELECT * FROM TABLE(myFunction)

Hello
I want to return rows from a pipelined function, and map this to a view, or a BC4J an query this in my application.
I want to populate the rows based on many evaluations, to achieve this, I want to include the rules manager functionality.
I have defined my event, rule class and result view successfully, but... when I run my query, I have the following error:
ORA-14551: cannot perform a DML operation inside a query
We believe this is caused when the engine tries to populate the results view with the matching rules.
Is there a workaround for this?
Please help
Thnks in advance.
Alex.

Alex,
I cannot think of any workaround that would allow you to evaluate the rules and return the results with a single query. A Rules Manager application with composite events modifies the state of the database (for maintaining incremental state as well as the results view) when some events are processed. So, you will not be able to pipeline the results to a SQL query. If you can at least separate the ADD_EVENTS call from the rest of the logic this may be possible.
Hope this helps,
-Aravind.

Similar Messages

  • ORA-06502 When using MAX(Column) with %TYPE

    Hi Guys,
    Just had this discussion on the main database forums, and the problem was somewhat resolved. But they did ask me to check here if this was a known issue.
    Assuming I have a table defined as follows
    CREATE TABLE TEST_TABLE (TEST_COLUMN CHAR(8 BYTE)) ;and the table only has a single record NZ07100S
    We also define a function as
    CREATE OR REPLACE FUNCTION
    FUNCTION GETTESTVALUE
    RETURN TEST_TABLE.TEST_COLUMN%TYPE
    IS
    TEST_VALUE TEST_TABLE.TEST_COLUMN%TYPE;
    BEGIN
    SELECT MAX(TEST_COLUMN) INTO TEST_VALUE FROM TEST_TABLE;
    RETURN TEST_VALUE;
    END;We ran the following command
    SELECT GETTESTVALUE FROM DUAL;and receive an error as follows
    Error report:
    SQL Error: ORA-06502: PL/SQL: numeric or value error: character string buffer too small
    ORA-06512: at "GETTESTVALUE", line 6
    06502. 00000 - "PL/SQL: numeric or value error%s"However, if were to modify the function to the following
    CREATE OR REPLACE FUNCTION
    FUNCTION GETTESTVALUE
    RETURN TEST_TABLE.TEST_COLUMN%TYPE
    IS
    TEST_VALUE TEST_TABLE.TEST_COLUMN%TYPE;
    BEGIN
    SELECT TEST_COLUMN INTO TEST_VALUE FROM TEST_TABLE;
    RETURN TEST_VALUE;
    END;There is no error reported and the value NZ07100S is returned.
    Of course, when we modified the function to be
    CREATE OR REPLACE FUNCTION
    FUNCTION GETTESTVALUE
    RETURN TEST_TABLE.TEST_COLUMN%TYPE
    IS
    TEST_VALUE TEST_TABLE.TEST_COLUMN%TYPE;
    BEGIN
    SELECT CAST(MAX(TEST_COLUMN) AS CHAR(8))INTO TEST_VALUE FROM TEST_TABLE;
    RETURN TEST_VALUE;
    END;No errors are reported, and the value is returned
    Some of the guys in the main forums tried this out on Enterprise edition and did not encounter any issues. To faciliate their testing, I spooled the sqlsplus output and it is as follows
    SQL> select * from v$version;
    BANNER
    Oracle Database 10g Express Edition Release 10.2.0.1.0 - Product
    PL/SQL Release 10.2.0.1.0 - Production
    CORE    10.2.0.1.0      Production
    TNS for Linux: Version 10.2.0.1.0 - Production
    NLSRTL Version 10.2.0.1.0 - Production
    SQL> create table test_table (test_column char(8 byte));
    Table created.
    SQL> insert into test_table
      2       values ('NZ07100S');
    1 row created.
    SQL> commit
      2  /
    Commit complete.
    SQL> create or replace function gettestvalue
      2      return test_table.test_column%type
      3  is
      4     test_value   test_table.test_column%type;
      5  begin
      6     select max(test_column) into test_value from test_table;
      7  return test_value;
      8  end;
      9  /
    Function created.
    SQL> select gettestvalue from dual
      2  /
    select gettestvalue from dual
    ERROR at line 1:
    ORA-06502: PL/SQL: numeric or value error: character string buffer too small
    ORA-06512: at "JEGA.GETTESTVALUE", line 6
    SQL> spool offAt the request of one of the posters, the following was also executed.
    SQL> select lengthb (TEST_COLUMN)
      2  from test_table
      3  where test_column = 'NZ07100S'
      4  /
    LENGTHB(TEST_COLUMN)
                       8
    SQL> select max (lengthb (test_column))
      2  from test_table
      3  /
    MAX(LENGTHB(TEST_COLUMN))
                            8The eventual solution that made this piece of code work on XE was as follows
    SQL> alter table test_table modify test_column varchar2 (8 byte);
    Table altered.
    SQL> select gettestvalue from dual;
    GETTESTVALUE
    NZ07100S
    SQL> spool off;Now, I can't change the production (Enterprise Edition) schema. The XE is being used by the developers for their local testing. As such, knowing that the problem does not occur on Enterprise, I can ask them to make the changes locally to their XE for their local testing.
    However, I was just wondering, does anyone know if this is a known issue with Oracle XE ??
    Thanks and regards
    Jega

    Hi Jega,
    thank you for your post.
    Don't know is this issue XE release specific issue or 10.2.0.1 generally?
    Anyway, already 10.2.0.3 is patched - as you can see, even selecting from XE through PE102030 working OK:
    SQL> select * from v$version;
    BANNER
    Personal Oracle Database 10g Release 10.2.0.3.0 - Production
    PL/SQL Release 10.2.0.3.0 - Production
    CORE    10.2.0.3.0      Production
    TNS for 32-bit Windows: Version 10.2.0.3.0 - Production
    NLSRTL Version 10.2.0.3.0 - Production
    SQL> CREATE TABLE TEST_TABLE (TEST_COLUMN CHAR(8 BYTE)) ;
    Table created.
    SQL> CREATE OR REPLACE FUNCTION gettestvalue
      2  RETURN TEST_TABLE.TEST_COLUMN%TYPE
      3  IS
      4  TEST_VALUE TEST_TABLE.TEST_COLUMN%TYPE;
      5  BEGIN
      6  SELECT MAX(TEST_COLUMN) INTO TEST_VALUE FROM TEST_TABLE;
      7  RETURN TEST_VALUE;
      8  END;
      9  /
    Function created.
    SQL> insert into test_table
      2   values ('NZ07100S');
    1 row created.
    SQL> SELECT GETTESTVALUE FROM DUAL;
    GETTESTVALUE
    NZ07100S
    SQL> CREATE OR REPLACE FUNCTION gettestvalue_from_xe
      2  RETURN TEST_TABLE.TEST_COLUMN%TYPE
      3  IS
      4  TEST_VALUE TEST_TABLE.TEST_COLUMN%TYPE;
      5  BEGIN
      6  SELECT MAX(TEST_COLUMN) INTO TEST_VALUE FROM HR.TEST_TABLE@XE_LINK;
      7  RETURN TEST_VALUE;
      8  END;
      9  /
      Function created.
    SQL> SELECT GETTESTVALUE_FROM_XE FROM DUAL;
    GETTESTVALUE_FROM_XE
    NZ07100S
    SQL> conn hr/hr_password@xe
    Connected.
    SQL>  SELECT GETTESTVALUE FROM DUAL;
    SELECT GETTESTVALUE FROM DUAL
    ERROR at line 1:
    ORA-06502: PL/SQL: numeric or value error: character string buffer too small
    ORA-06512: at "HR.GETTESTVALUE", line 7
    SQL> select * from v$version;
    BANNER
    Oracle Database 10g Express Edition Release 10.2.0.1.0 - Product
    PL/SQL Release 10.2.0.1.0 - Production
    CORE    10.2.0.1.0      Production
    TNS for 32-bit Windows: Version 10.2.0.1.0 - Production
    NLSRTL Version 10.2.0.1.0 - Production
    SQL>Note: XE_LINK is database link pointing from my PE instance to XE instance.

  • URGENT : ORA 302000 when using TEXT_IO.fopen

    Hi,
    I get this error ORA 302000 when using TEXT_IO package, the code I use is
    new_file:=text_io.fopen('c:\text.txt','r')
    i don't have the description of this ORA 302000 , pls does anyone have it?

    Hi,
    I know it's been 2 years but it's still up to date for me.
    I tried the suggested piece of code to trace the error but it did not bring anything more
    EXCEPTION
    When Others then
    srw.Message( 2, 'EXCEPTION ' || SQLCODE || ' in common package. Can not open the file ');
    IF SQLCODE = -302000 then
    LOOP
    EXIT WHEN TOOL_ERR.NERRORS = 0;
    SRW.MESSAGE( 667, TO_CHAR(TOOL_ERR.CODE) || ': ' || TOOL_ERR.MESSAGE);
    TOOL_ERR.POP;
    END LOOP;
    END IF;
    srw.Message( 3, 'EXCEPTION ' || SQLCODE || ' in com package. Can not open the file ' || I_Desname || ' : ' || SQLERRM );
    Only Message 2 and 3 are displayed in the trace file
    Any other suggestion?
    Manu

  • Error ORA-06502 When using function REPLACE in PL/SQL

    Hi,
    I have a PL/SQL procedure which gives error 'Error ORA-06502 When using function REPLACE in PL/SQL' when the string value is quite long (I noticed this with a string 9K in length)
    variable var_a is of type CLOB
    and the assignment statement where it gives the error is
    var_a := REPLACE(var_a, '^', ''',''');
    Can anyone please help!
    Thanks

    Even then that shouldn't do so:
    SQL> select overload, position, argument_name, data_type, in_out
      2  from all_arguments
      3  where package_name = 'STANDARD'
      4  and object_name = 'LPAD'
      5  order by 1,2
      6  /
    OVERLOAD   POSITION ARGUMENT_NAME                  DATA_TYPE                      IN_OUT
    1                 0                                VARCHAR2                       OUT
    1                 1 STR1                           VARCHAR2                       IN
    1                 2 LEN                            BINARY_INTEGER                 IN
    1                 3 PAD                            VARCHAR2                       IN
    2                 0                                VARCHAR2                       OUT
    2                 1 STR1                           VARCHAR2                       IN
    2                 2 LEN                            BINARY_INTEGER                 IN
    3                 0                                CLOB                           OUT
    3                 1 STR1                           CLOB                           IN
    3                 2 LEN                            NUMBER                         IN
    3                 3 PAD                            CLOB                           IN
    4                 0                                CLOB                           OUT
    4                 1 STR1                           CLOB                           IN
    4                 2 LEN                            NUMBER                         INI wonder what happened?

  • Getting ORA-00600 when using table functions

    Hello,
    I am trying to use simple table function:
    create or replace type StatCall AS OBJECT (
    dial_number varchar2(255),
    start_date date,
    duration number(20)
    create or replace type StatCallSet AS TABLE OF StatCall;
    create or replace package ref IS
    type refcall_t IS REF CURSOR RETURN calls%ROWTYPE;
    end ref;
    create or replace function GetStats(p ref.refcall_t) return StatCallSet pipelined is
    out_rec StatCall;
    in_rec p%ROWTYPE;
    BEGIN
    LOOP
    FETCH p INTO in_rec;
    EXIT WHEN p%NOTFOUND;
    out_rec.dial_number := in_rec.dial_number;
    out_rec.start_date := in_rec.start_date;
    out_rec.duration := in_rec.duration;
    PIPE ROW(out_rec);
    END LOOP;
    CLOSE p;
    RETURN;
    END;
    select * from TABLE(GetStats(CURSOR(select * from call)));
    And I get:
    ORA-00600: internal error code, arguments: [17285], [0xFFFFFFFF7C4900A8], [1], [0x3943BA5E0], [], [], [], []
    Oracle 9.2.0.2
    Are there any ideas about how to fix this?

    What version of the database?
    Which flavor of Disco (Plus, Desktop, Viewer)?
    Standars EUL or Apps EUL?
    Can you post the code for the calculation?
    ORA-600 errors, as you mentioned, are internal, and may require opening a dialog with Oracle support. Then again, it could be something else in the calculation that is causing the sky to fall.

  • How to use C:when test... inside column in ADF table

    I am using ADF table with below two columns
    in First column i have to check the Type of document if it is doc type then i have to use commondlink to download that file ,Otherwise i need to show only text.
    for that i added
    *<c:when test="{boolean($favoriteType eq 'doc')}">*
    which is not working .
    please let me know how to use <C:when test... inside column in ADF table
    <tr:column sortProperty="favoriteName" sortable="true"
    headerText="#{res['favorite.favoritename']}"
    width="500" noWrap="false">
    <c:choose>
    *<c:when test="{boolean($favoriteType eq 'doc')}">*
    <tr:commandLink actionListener="#{bindings.downloadFile.execute}"
    text="#{row.favoriteName}"
    disabled="#{!bindings.downloadFile.enabled}"/>
    </c:when>
    <c:otherwise>
    <af:outputText value="#{row.favoriteName}"/>
    </c:otherwise>
    </c:choose>
    </tr:column>
    <tr:column sortProperty="favoriteType" sortable="true"
    headerText="#{res['favorite.favoriteType']}" rendered="true">
    <af:outputText value="#{row.favoriteType}" id="favoriteType"/>
    </tr:column>

    Hi Frank,
    Thanks it is working like cham..
    related to same page i am facing new problem which i posted at below thread
    How to get row data runtime @ trinidad table , set rowSelection="multiple"
    can u reply on same.
    Thanks for all help.
    Jaydeep

  • Not getting Cost information when using /*+ RULE */ in toad 9.5

    Hi,
    While optimizing a query when I am using /*+RULE */ in the query I am not getting any info for cost and cardinality.
    Can you tell me is the /*+RULE* / obsolete in oracle or what can be the reason.
    Help me..
    Thanks in advance.

    948707 wrote:
    Hi,
    While optimizing a query when I am using /*+RULE */ in the query I am not getting any info for cost and cardinality.
    Can you tell me is the /*+RULE* / obsolete in oracle or what can be the reason.
    Why are you using that hint?
    Aside from the fact that rule based optimization is obsolete, the optimiser can either do Rule based optimization or Cost based optimization. Why would you expect to get Cost based information when using Rule based optimization?
    Don't use such hints. Cost based optimization is far superior to rule based.

  • Passing arguments to Managed Server ServerStart when using Node Manager

    Below is the procedure to pass arguments to Managed Server serverstart tab when using Node Manager to start and stop the Managed Server instance
    For passing the JVM arguments we will have to use "-server" which is hotspot and then pass the arguments
    for eg: "-server -Xms2048m -Xmx2048m -verbosegc"
    For adding jar's to the classpath you will have to add weblogic.jar and weblogic_sp.jar from WL_HOME/server/lib directory as well along with the custom jar (In some cases we can ignore weblogic_sp.jar, just adding weblogic.jar will do).
    for eg: "\home\user\debug.jar;\home\user\bea\wlserver_10.3\server\lib\weblogic.jar;\home\user\bea\wlserver_10.3\server\lib\weblogic_sp.jar;"
    - - Tarun

    Hi,
    To me, if you don't wanna use the NodeManager, you won't be able to start your managed servers with WLST.
    I guess the only ways are :
    * through the console / WLST using the NodeManager
    * using the startManagedWebLogic.[cmd/sh]
    Regards

  • Getting Compilation error when used SET or MULTISET operator on nested tabl

    Dear All,
    I am getting Compilation error when used SET or MULTISET operator on nested tables inside a procedure.
    This is working fine in other DB installations of 10g but does not work in another 10g DB.
    it says "wrong number of parameter or datatype used in SET"
    Can any one suggest what went wrong here?
    Thanks in advance.

    Can any one suggest what went wrong here?Only if you would post the query and Oracle versions on both databases.
    Besides, this forum deals with issues in Oracle product installation. So post this query in SQL PL/SQL forum for better response.

  • Compilation error when used SET or MULTISET operator on nested tables

    Dear All,
    I am getting Compilation error when used SET or MULTISET operator on nested tables inside a procedure.
    This is working fine in other DB installations of 10g but does not work in another 10g DB.
    it says "wrong number of parameter or datatype used in SET"
    Can any one suggest what went wrong here?
    Thanks in advance.

    Hi,
    Thanks for ur reply...
    Since MULTISET and SET operators are the new additions in base 10g release for manipulation of nested tables data, I am surprised that same is working in similar 5 DBs installations with 10.2.0.1.0 version, but does not work in the sixth.
    SET and MULTISET operators are used inside the PL/SQL procedure which is getting compiled in the above mentioned 5 DBs but not in sixth DB.
    it gives
    On line: 3112
    PLS-00306: wrong number or types of arguments in call to 'SET'
    Hope this clarifies the issue...

  • When using Migration Assistant to transfer files from my pc, I get an error message saying that an attempt was made to access a socket in a way forbidden by its access permissions.  How can I fix this?

    When using Migration Assistant to transfer files from my pc, I get an error message saying that an attempt was made to access a socket in a way forbidden by its access permissions.  How can I fix this?

    You followed:
    http://www.apple.com/support/switch101/

  • Has anyone had issues with poor image quality when using lightroom to process raw images from Canon 7dmk2

    Hi everyone..
    ..I have been having image quality issues when using Lightroom to process raw files from a 7d mk2... They are all soft with poor clarity.....tonight in despair I tried processing them  using  canon's software and they are totally different..."much better"
    anyone else had similar problems....Andy

    I have a 7D2 and have not had what I interpret as poor image quality that has anything to do with the camera.
    Can you post a screenshot of what you’re seeing and what specifically you don’t like?  Maybe there is something you can do differently or at least there may be an explanation for what you’re seeing.
    And if you have a raw image that you wouldn’t mind sharing in a public forum, upload to http://www.dropbox.com/ then post a public share link to it in a reply, here.
    In other words post a screenshot of what you see in LR, another of what you see using DPP, and a link to the raw file you’re processing.

  • When using the migrate tool to migrate from windows to mac, can you use ethernet to connect the computers to each other?

    When using the migrate tool to migrate from windows to mac, can you use ethernet to connect the computers to each other? In the Migration tool, I was only given the option of choosing the computer when it appeared on the same network, and didn't see an option to connect them to each other. Even though they're both connected to the same network with a wired connection, the migration is painfully slow.

    Yes. The following quotation is from About Windows Migration Assistant
    These are the preferred network connections, in order:
    Use a CAT6-certified Ethernet cable that is in good condition to connect the Ethernet port of the PC directly to the Ethernet port of the Mac or Ethernet adaptor (USB or Thunderbolt). You shouldn't use an Ethernet cable that has any kinks in it or is missing connector tabs.
    Use CAT6-certified Ethernet cables that are in good condition to connect the Mac and PC to your home network router/hub/switch. You shouldn't use an Ethernet cable that has any kinks in it or is missing connector tabs.
    For wireless, use the fastest wireless signal possible (802.11n 5Ghz). Try to have the PC, Mac, and the wireless access point all in the same room close to each other.

  • Special Grant to use "Select * from Table(cast..."??

    Hi,
    I've recently created the types and function to use the Table(Cast(funtion) as type)). It works fine, and gives me the correct result. I've granted execute on the types and on the function to a role that is enabled for a user, but when the user tries to use the "select * from table(cast(function) as type))", he gets a "ORA-01031: Insufficient Privileges" error message. Is there any other grant that must be given to the role, so that the user can execute the select?
    Thanks in advance!
    Daniel

    Hi Kamal,
    I'm not sure what anonymous PL/SQL block means. When I (or the user) try to run the select, I enter all the information, i.e., the owners for the type and function: "select * from table(cast(a.my_function(my_argument) as a.my_type))". I'm trying to use SQLPlus at this time, and I have Oracle 8i.
    I didn't to explicitly grant execute to the user because that would go against some rules I have to follow... I'll se if I give it a try though!
    Thanks!

  • Can I simulate SELECT * FROM TABLE WHERE ROW IN (1111,2222) using SQLJ

    I have a fct like
    public void fct(String inStr) {
    String str = "SELECT * FROM TABLE WHERE ROW IN" + inStr;
    // then I xecute the query using JDBC connection
    But I want to do the same thisn using SQLJ like:
    public void fct(String inStr) {
    #sql [nctx] iter = { SELECT * FROM TABLE WHERE ROW IN :inStr}
    When I run the second version and give a parameter like "(1111,2222)" it gives
    ORA-01722: invalid number error.
    Is there a way to give parameters to in clauses of SQLJ statements.
    Thanks in regard.

    This is a SQLJ FAQ. You can find the FAQ at:
    http://technet.oracle.com/tech/java/sqlj_jdbc/htdocs/faq.html
    Your question is addressed in the following section:
    http://technet.oracle.com/tech/java/sqlj_jdbc/htdocs/faq.html#variablesizevaluelist
    Note that that section has a typo. The lines:
    ? // populate mynumbers
    #sql { SELECT * FROM tab WHERE col in (:(a[0]),:(a[1]),?};
    should read:
    ... // populate mynumbers
    #sql { SELECT * FROM tab WHERE col in (:(a[0]),:(a[1]),...};
    By the way, with the next release SQLJ will support pasting in of dynamic SQL fragments. Then you'll be able to do pretty much what you are trying to accomplish here (albeit with slightly different syntax). Until then you'd have to use the workarounds from the FAQ.

Maybe you are looking for

  • Incoming Payment Discount

    Greetings Gurus... I need to generate a report to show the incoming payment discount taken during cash application to customers.  For example, a customer has an invoice for $100, they pay only $99, the AR clerk puts $1 discount in the Incoming Paymen

  • Able to home share all but one album.  What's wrong?

    I've encountered a puzzling issue. I have home sharing enabled on my Mac Mini Server running Yosemite (10.10.1) and iTunes (12.0.1.26) as well as a 2012 rMBP (same software), 2012 Mac Mini, and various iOS devices (8.1).  I am able to access the iTun

  • Aaahhh!  help!!!

    lately, i've been having a problem where my screen will go dark, and i'll get a message in like 5 languages saying that i need to shut down/restart my computer. from what i understand, this is a kernel panic. is there any way to tell what's going wro

  • Subcontracting process to multiple vendors

    Dear friends, We have got the subcontracting process as below. 1) Material is given to subcontracting vendor for making finished product.This job consists of 5 operations. 2) After making 1 operation at first vendor ,for remaining operations,partly p

  • One Dimension with Facts at different levels

    I currently have a single dimension with 5 levels. I have two fact tables that both connect to the dimension table but at different levels. For example. If we have a Dimension Country -> Region -> City and then two fact tables. One that has facts at