Odd issue when using UDT (user defined type)

Hi all,
11g.
I ran into an odd issue when using UDT, I have these 4 schemas: USER_1, USER_2, USER_A, USER_B.
Both USER_1 and USER_2 have an UDT (actually a nested table):
CREATE OR REPLACE TYPE TAB_NUMBERS AS TABLE OF NUMBER(10)USER_A has a synonym points to the type in USER_1:
create or replace synonym TAB_NUMBERS for USER_1.TAB_NUMBERS;USER_B has a synonym points to the type in USER_2:
create or replace synonym TAB_NUMBERS for USER_2.TAB_NUMBERS;Both USER_A and USER_B have a procedure which uses the synonym:
CREATE OR REPLACE PROCEDURE proc_test (p1 in tab_numbers)
IS
BEGIN
  NULL;
END;And in the C# code:
OracleConnection conn = new OracleConnection("data source=mh;user id=USER_A;password=...");
OracleCommand cmd = new OracleCommand();
cmd.Connection = conn;
cmd.CommandText = "proc_test";
cmd.CommandType = CommandType.StoredProcedure;
OracleParameter op = new OracleParameter();
op.ParameterName = "p1";
op.Direction = ParameterDirection.Input;
op.OracleDbType = OracleDbType.Object;
op.UdtTypeName = "TAB_NUMBERS";
Nested_Tab_Mapping_To_Object nt = new Nested_Tab_Mapping_To_Object();
nt.container = new decimal[] { 1, 2 };
op.Value = nt;
......This code works fine, but it raises an error when I change the connection string from USER_A to USER_B, the error says:
OCI-22303: type ""."TAB_NUMBERS" not foundInterestingly, if I change op.UdtTypeName = "TAB_NUMBERS"; to op.UdtTypeName = "USER_2.TAB_NUMBERS", the error is gone, and everything works fine.
Anyone has any clues?
Thanks in advance.

Erase and reformat the ext HD. Then, redo the SuperDuper! backup.

Similar Messages

  • Issue in passing Oracle User Defined Types to PL SQL from Websphere Applica

    HI,
    I am facing an issue when trying to pass Oracle collection object(User Defined Types) from Java to PL SQL. The issue happens inside J2EE application which is running inside Websphere Application Server 6.x. My database is Oracle 10g and i am using ojdbc1.4.jar as thin driver.
    The issue is that when i pass the Oracle Object from java side, the attribute values of the collection objects at the Oracle PL SQL side is coming as empty. I have tried the same java code in a standalone application and it works fine. The issue happens only when the application is running inside WAS.
    Anybody has any idea how to pass Oracle User Defined Types from WAS 6.x server to Oracle PL SQL?

    Andy Bowes wrote:
    Hi
    I am using WebLogic 8.14 & Oracle 9i with thin JDBC driver.
    Our application needs to perform the same DB operation for every item in a Java Collection. I cannot acheive the required performance using the standard Prepare & Execute loop and so I am looking to push the whole collection to Oracle in a single invocation of a Stored Procedure and then loop on the database.
    Summary of Approach:
    In the Oracle database, we have defined a Object Type :
    CREATE OR REPLACE
    TYPE MYTYPE AS OBJECT
    TxnId VARCHAR2(40),
    Target VARCHAR2(20),
    Source VARCHAR2(20),
    Param1 VARCHAR2(2048),
    Param2 VARCHAR2(2048),
    Param3 VARCHAR2(2048),
    Param4 VARCHAR2(2048),
    Param5 VARCHAR2(2048),
    and we have defined a collection of these as:
    CREATE OR REPLACE
    TYPE MYTYPE_COLLECTION AS VARRAY (100) OF MYTYPE
    There is a stored procedure which takes one of these collections as an input parameter and I need to invoke these from within my code.
    I am having major problems when I attempt to get the ArrayDescriptor etc to allow me to create an Array to pass to the stored procedure. I think this is because the underlying Oracle connection is wrapped by WebLogic.
    Has anyone managed to pass an array to an Oracle Stored procedure on a pooled DB connection?
    Thanks
    AndyHi. Here's what I suggest: First please get the JDBC you want to work in a
    small standalone program that uses the Oracle thin driver directly. Once
    that works, show me the JDBC code, and I will see what translation if
    any is needed to make it work with WLS. Will your code be running in
    WebLogic, or in an external client talking to WebLogic?
    Also, have you tried the executeBatch() methods to see if you can
    get the performance you want via batches?
    Joe

  • Odd Issue when using Firewire drive with Leopard-Locks up Dock, etc.

    I have an odd issue that has developed on my MBP using OS X 10.5.1 Leopard. It only appears to occur when I plug in my External Firewire Lacie Rugged Hard Drive. I only use that Hard Drive approximately once a week when doing a complete mirror backup of my MBP's Hard Drive using SuperDuper. As far as I can tell the issue occurs only once the Hard Drive is plugged in, not because of SuperDuper or the Backup.
    Here is the issue: For some reason within a minute of plugging in my hard drive my Dock doesn't work. It scrolls when I put the mouse pointer down to the Dock but it won't open up any icons I click on. It's just like it doesn't recognize the left mouse button. Also, I am unable to select any menus at the top of the screen. I can left click on them and even right click on an icon such as Macintosh HD on the desktop and there is no response. I am able to drag Windows across my desktop though but it seems overall that my keyboard becomes inactive. For example in a open Numbers spreadsheet I am able to use the left mouse button (so it works then) to select a textbox and get the blinking cursor but yet if I type and use even the delete key there is no response. Even after I'm done with the Hard Drive if I drag the Lacie to the trash to eject it won't eject. The only way to eject it is simply pull the Firewire cable out.
    I had a few issues with my system earlier and found out I had some bad memory. The memory was replaced and the problems went away. I am worried I had some corrupted files from that time but what puzzles me is I have used my laptop for weeks with no problems. It is only while I plug in this hard drive. In a worse case if I can't figure out how to fix it I feel I'll have to do a complete format and reinstall Leopard and I don't want to have to do that. This only occurs when I do the backup but can be a pain. Any ideas if I can fix this?

    Erase and reformat the ext HD. Then, redo the SuperDuper! backup.

  • Cannot SELECT into a user-defined type variable

    Hi All,
    Oracle 11.2 on Linux.
    See the steps below. I am not able to insert/select into a TYPE variable. I do not want to do a TABLE declaration in my PL/SQL block, but want to use a user defined type. Is it possible ?
    SQL> create or replace type sample_obj_rec as object
      2  (
      3     object_id    number,
      4     object_name  varchar2(32),
      5     object_type  varchar2(32)
      6  );
      7  /
    Type created.
    SQL> create or replace type sample_obj_tab as table of sample_obj_rec ;
      2  /
    Type created.
    -- ------------   CASE 1 ---------------------
    SQL> declare
      2      v_tab   sample_obj_tab := sample_obj_tab() ;
      3  begin
      4      select object_id, object_name, object_type
      5      bulk   collect into v_tab
      6      from   dba_objects
      7      where  rownum < 11 ;
      8  end ;
      9  /
        from   dba_objects
    ERROR at line 6:
    ORA-06550: line 6, column 5:
    PL/SQL: ORA-00947: not enough values
    ORA-06550: line 4, column 5:
    PL/SQL: SQL Statement ignored
    -- ------------   CASE 2 ---------------------
    SQL> declare
      2      v_rec   sample_obj_rec;
      3  begin
      4      select object_id, object_name, object_type
      5      into   v_rec
      6      from   dba_objects
      7      where  rownum = 1;
      8  end ;
      9  /
        from   dba_objects
    ERROR at line 6:
    ORA-06550: line 6, column 5:
    PL/SQL: ORA-00947: not enough values
    ORA-06550: line 4, column 5:
    PL/SQL: SQL Statement ignoredWhat is the issue with both the above cases? what am I missing here?
    Thanks in advance.

    One small detail in the SELECT.
    SQL> create or replace type sample_obj_rec as object
      2  (object_id    number,
      3   object_name  varchar2(32),
      4   object_type  varchar2(32));
      5  /
    Type created.
    SQL>
    SQL> create or replace type sample_obj_tab as table of sample_obj_rec ;
      2  /
    Type created.
    SQL>
    SQL> declare
      2     v_tab   sample_obj_tab := sample_obj_tab() ;
      3  begin
      4     select sample_obj_rec(object_id, object_name, object_type)
      5     bulk   collect into v_tab
      6     from   dba_objects
      7     where  rownum < 11 ;
      8  end ;
      9  /
    PL/SQL procedure successfully completed.
    SQL>

  • Using stored procedure with Oracle user-defined types in database control

    Hi,
    I have a requirement where I need to call an Oracle Stored Proc which has IN and OUT parameters. OUT parameters are of user-defined types in Oracle packages.
    I am getting error while calling the Stored proc like below:
    Procedure:
    ==========
    create or replace
    PROCEDURE AA_SAM_TEST (
    col1 out types_aa.aa_tex_type ,
    col2 out types_aa.aa_tex_type ,
    col2 out types_aa.aa_num_type ) As
    Types:
    ======
    create or replace
    package types_aa as
    type aa_tex_type is table of varchar2(255) index by binary_integer;
    type aa_num_type is table of char index by binary_integer;
    end
    Wli Code:
    =========
    DB Control:
    ===========
    * @jc:sql statement="call AA_SAM_TEST(?,?,?)"
    void Call_AA_SAM_TEST(SQLParameter[] param) throws SQLException;
    JPD Code:
    =========
    param = new SQLParameter[3];
    Object param1 = new String();
    Object param2 = new String();
    Object param3 = new String();
    this.param[0] = new SQLParameter(param1 , Types.STRUCT, SQLParameter.OUT);
    this.param[1] = new SQLParameter(param2, Types.STRUCT, SQLParameter.OUT);
    this.param[2] = new SQLParameter(param3, Types.STRUCT, SQLParameter.OUT);
    database_Update.Call_AA_SAM_TEST(this.param);
    I am getting the following error...
    <Jul 24, 2007 6:47:42 PM IST> <Warning> <WLW> <000000> <Id=database_Update; Method=Ctrl_files.Database_Update.Call_AA_SAM_TEST(); Failure=java.sql.SQLException: ORA-06553: PLS-:
    ORA-06553: PLS-:
    ORA-06553: PLS-:
    ORA-06553: PLS-:
    ORA-06553: PLS-:
    ORA-06553: PLS-306: wrong number or typ
    ORA-06553: PLS-306: wrong number or types of arguments in call to 'AA_SAM_TEST'
    ORA-06553: PLS-306: wrong number or types of arguments in call to 'AA_SAM_TEST'
    Can anyone know how to specify OUT parameter of USer-Defined types while using a DB control to access a Stored Proc in Oracle.
    Any help is highly appreciated.
    Thanks

    Hi,
    I have similar problem. Have you already solved the issue?
    Thanks

  • Syntax error when creating a user-defined table type in SQL Server 2012

    Why am I getting a syntax error when creating a user-defined table type in SQL Server 2014?
    CREATE TYPE ReportsTableType AS TABLE 
    ( reportId INT
    , questionId INT
    , questionOrder INT );
    Results:
    Msg 156, Level 15, State 1, Line 1
    Incorrect syntax near the keyword 'AS'.

    Hope these posts could help, 
    https://social.msdn.microsoft.com/Forums/sqlserver/en-US/37a45a9a-ed8c-4655-be93-f6e6d5ef44be/getting-incorrect-syntax-while-creating-a-table-type-in-sql-server-2008-r2?forum=transactsql
    Regards, Dineshkumar,
    Please Mark as Answer if my post answers your question and
    Vote as Helpful if it helps you

  • Is there any way to use a For Each Loop for each property of an User Defined Type?

    Is there any way to use a For Each Loop for each property of an User Defined Type? That would be very handy!
    Jorge Barbi Martins ([email protected])

    Alas, no, not in VBA.
    Regards, Hans Vogelaar (http://www.eileenslounge.com)

  • Using columns of user defined types

    Can anyone help me display data from a column within a table which is of a user defined type - a object with 4 elements .
    Discoverer wont currently display the data - it says a MAP or ORDER method is required.
    The type is declared as :
    create or replace type m_p as object
    ( m_p_id number(9),
    m_p_start number,
    m_p_end number,
    m_p_length number )
    and the table is declared as
    create table t_m_p (
    N_ID NUMBER,
    N_PL M_P,
    N_ATT VARCHAR2(1)
    What do I need to do to allow Discoverer 3.1 to display the data held in the N_PL column?
    Also : can anyone tell me if it is possible to display data in Discoverer from a thre dimensional varray? - or would I have to create a view on it?

    Discoverer does not currently allow queries to contain the extended Oracle 8 object types. The way to resolve this is to write views that present a relational view of the object structure and then build a business area based on these views
    Oracle Discoverer Team
    <BLOCKQUOTE><font size="1" face="Verdana, Arial">quote:</font><HR>Originally posted by nikstace ([email protected]):
    Can anyone help me display data from a column within a table which is of a user defined type - a object with 4 elements .
    Discoverer wont currently display the data - it says a MAP or ORDER method is required.
    The type is declared as :
    create or replace type m_p as object
    ( m_p_id number(9),
    m_p_start number,
    m_p_end number,
    m_p_length number )
    and the table is declared as
    create table t_m_p (
    N_ID NUMBER,
    N_PL M_P,
    N_ATT VARCHAR2(1)
    What do I need to do to allow Discoverer 3.1 to display the data held in the N_PL column?
    Also : can anyone tell me if it is possible to display data in Discoverer from a thre dimensional varray? - or would I have to create a view on it?<HR></BLOCKQUOTE>
    null

  • 64,000 character limit on UDT user defined field column

    Hey All.
    We are storing more then 64,000 characters into a UDT user defined field column as it stores a large XML document. How can I retreive this information from the UDT using the DI API? Everytime I try to do this using either the UDT object or SAP recordset it chops off the data to 64000 characters. The UDF was created as a "TEXT" type using B1 client and when I look in the database it has a datatype of NTEXT.
    Is this a bug or is there no way using DI API to retreive all the data?

    Curtis,
    Apologies for my delay in getting back to you.
    I do not know the reasoning behind the limit.  As far as 2007A is concerned, the documentation that I was looking at when I first responded to your question was the 2007A SDK Help documentation, so I would say it is the same in 2007.
    I believe that you can use ADO to access data in SAP Business One as there are other ISV's that use ADO, just not access via stored procedures directly to the Business One database.  ADO and ODBC connectivity have rules in place for data validation, although it is recommended that you use the Business One API's for data access as much as possible.  You could also store data in your own tables in a separate database and retrieve from there.
    Eddy

  • User Defined Types menuitem not appears in Server Explorer at Remote Server

    Hi,
    I'm working on oracle 10g,odp.net with 2.0. i created two types which are input and output parameters for a function. I installed odp.net (ORACLE DATA PROVIDER FOR .NET 11.1.0.6.20) and generated UDT custom class code. It's working in my system. But when i installed odp.net (ORACLE DATA PROVIDER FOR .NET 11.1.0.6.20) in my remote server, its not showing the UDT Custom Class Code Generation Wizard to create UDT Custom Class Code. I have installed oracle Client 10g,.Net Framework 2.0 and ODP.Net(11.1.0.6.20) in the server.
    In my Local system server explorer it's showing
    Tables
    Views
    Procedures
    Functions
    Packages
    Synonyms
    Sequences
    XML Databases
    Java Classes
    User-Defined Types
    In server explorer it's showing only
    Tables
    Views
    Synonyms
    Sequences
    Procedures
    Functions
    Packages
    Package Bodies
    Why its not showing User-Defined Types.
    Pls Help.
    Ideas are highly appreciated.
    Anil

    As you noticed, not all database objects are available in Server Explorer, and because of this they can't have scripts generated for them, nor can they be compared with Schema Compare.
    In a pinch, you should be able to use SQL Developer to do this.

  • Deploying c# procedure with user-defined type

    Hi
    I've written a c# procedure which makes use of some Oracle user-defined types (c# classes generated using the wizard).
    I will be calling the procedure from an Oracle package and one of the out parameters needs to be one of my user defined Oracle objects (basically a record object). My problem is when I come to deploy the package, it tells me "... does not contain any .NET stored procedures that can be deployed to Oracle"
    If I change the user defined type (out param) to something like an Int32 or string, it works fine. AFAIK the latest version of ODT/ODAC supports user defined types. For Info I've 11g Client , .Net v4 & VS2010
    quick example of procedure entry point.
    works:
    public static void GetOrderCost(int OrderNr, out Int32 orderCost )
    Not work:
    public static void GetOrderCost(int OrderNr, out ORDER_RECORD orderCost ) - Note: ORDER_RECORD is the class created using the class generation wizard.
    I've spent 2 days now trying to get this to work, perhaps its not possible or perhaps my setup is not quite right but any help gratefully received.
    Ian

    think I have found some small print which scuppers my plan. Good if some one could confirm and nicer if someone could suggest a workaround (without resorting to writing the UDT to a Oracle table)
    Oracle User-Defined Type (UDT) Support
    UDTs are not supported within a context connection but they are supported with a client connection. UDTs are not supported as parameters to .NET stored procedures.
    Source:
    http://docs.oracle.com/cd/E14435_01/win.111/e10927/extenRest.htm#CJAHJBJI
    So you can use UDT's within the body of the procedure (and can read them off the DB) but as yet its not possible to use them as parameters.

  • Calling Oracle stored procedure with out param of user define type from Entity Framework 5 with code first

    Guys i am using Entity Framework 5 code first (I am not using edmx) with Oracle and all works good, Now i am trying to get data from stored procedure which is under package but stored procedure have out param which is user define type, Now my question is
    how i will call stored procedure from entity framework
    Thanks in advance.

    I agree with you, but issue is we have lots of existing store procedure, which we need to call where damn required. I am sure those will be few but still i need to find out.
    If you think you are going to get existing MS Stored Procedures  or Oracle Packages that had nothing to do with the ORM previously to work that are not geared to do simple CRUD operations with the ORM and the database tables, you have a rude awakening
    coming that's for sure. You had better look into using ADO.NET and Oracle Command objects and call those Oracle Packages by those means and use a datareader.
    You could use the EF backdoor, call Oracle Command object and use the Packages,  if that's even possible, just like you can use MS SQL Server Stored Procedures or in-line T-SQL via the EF backdoor.
    That's about your best shot.
    http://blogs.msdn.com/b/alexj/archive/2009/11/07/tip-41-how-to-execute-t-sql-directly-against-the-database.aspx

  • Access result set in user define type of table

    here is the situation. I have a stored procedure that dequeues messages of a AQ and passes them as an OUT parameter in a collection of a user defined type. The same type used to define the queues. The java code executes properly but seems like we don't/can't access the result set. We don't receive any erros but don't know how to access the results. I've included relevant parts of the problem.
    I know this should be doable but........Can someone please tell us what we are doing wrong....thanks in advance.
    -----create object type
    create type evt_ot as object(
    table_name varchar(40),
    table_data varchar(4000));
    ---create table of object types.
    create type msg_evt_table is table of evt_ot;
    ----create queue table with object type
    begin
    DBMS_AQADM.CREATE_QUEUE_TABLE (
    Queue_table => 'etlload.aq_qtt_text',
    Queue_payload_type => 'etlload.evt_ot');
    end;
    ---create queues.
    begin
    DBMS_AQADM.CREATE_QUEUE (
    Queue_name => 'etlload.aq_text_que',
    Queue_table => 'etlload.aq_qtt_text');
    end;
    Rem
    Rem Starting the queues and enable both enqueue and dequeue
    Rem
    EXECUTE DBMS_AQADM.START_QUEUE (Queue_name => 'etlload.aq_text_que');
    ----create procedure to dequeue an array and pass it OUT using msg_evt_table ---type collection.
    create or replace procedure test_aq_q (
    i_array_size in number ,
    o_array_size out number ,
    text1 out msg_evt_table) is
    begin
    DECLARE
    message_properties_array dbms_aq.message_properties_array_t :=
    dbms_aq.message_properties_array_t();
    msgid_array dbms_aq.msgid_array_t;
    dequeue_options dbms_aq.dequeue_options_t;
    message etlload.msg_evt_table;
    id pls_integer := 0;
    retval pls_integer := 0;
    total_retval pls_integer := 0;
    ctr number :=0;
    havedata boolean :=true;
    java_exp exception;
    no_messages exception;
    pragma EXCEPTION_INIT (java_exp, -24197);
    pragma exception_init (no_messages, -25228);
    BEGIN
    DBMS_OUTPUT.ENABLE (20000);
    dequeue_options.wait :=0;
    dequeue_options.correlation := 'event' ;
    id := i_array_size;
    -- Dequeue this message from AQ queue using DBMS_AQ package
    begin
    retval := dbms_aq.dequeue_array(
    queue_name => 'etlload.aq_text_que',
    dequeue_options => dequeue_options,
    array_size => id,
    message_properties_array => message_properties_array,
    payload_array => message,
    msgid_array => msgid_array);
    text1 := message;
    o_array_size := retval;
    EXCEPTION
    WHEN java_exp THEN
    dbms_output.put_line('exception information:');
    WHEN no_messages THEN
    havedata := false;
    o_array_size := 0;
    end;
    end;
    END;
    ----below is the java code....
    import java.sql.Connection;
    import java.sql.DriverManager;
    import java.sql.ResultSet;
    import java.sql.SQLException;
    import java.sql.Struct;
    import oracle.jdbc.driver.OracleCallableStatement;
    import oracle.jdbc.driver.OracleTypes;
    public class TestOracleArray {
         private final String SQL = "{call etlload.test_aq_q(?,?,?)}";//array size, var name for return value, MessageEventTable
         private final String driverClass = "oracle.jdbc.driver.OracleDriver";
         private final String serverName = "OurServerName";
         private final String port = "1500";
         private final String sid = "OurSid";
         private final String userId = "OurUser";
         private final String pwd = "OurPwd";
         Connection conn = null;
         public static void main(String[] args){
              TestOracleArray toa = new TestOracleArray();
              try {
                   toa.go();
              } catch (InstantiationException e) {
                   // TODO Auto-generated catch block
                   e.printStackTrace();
              } catch (IllegalAccessException e) {
                   // TODO Auto-generated catch block
                   e.printStackTrace();
              } catch (ClassNotFoundException e) {
                   // TODO Auto-generated catch block
                   e.printStackTrace();
              } catch (SQLException e) {
                   // TODO Auto-generated catch block
                   e.printStackTrace();
         private void go() throws InstantiationException, IllegalAccessException, ClassNotFoundException, SQLException{
              Class.forName(driverClass).newInstance();
              String url = "jdbc:oracle:thin:@"+serverName+":"+port+":"+sid;
              conn = DriverManager.getConnection(url,userId,pwd);
              OracleCallableStatement stmt = (OracleCallableStatement)conn.prepareCall(SQL);
              //set 1 input
              stmt.setInt(1, 50);
              //register out 1
              stmt.registerOutParameter(2, OracleTypes.NUMERIC);
              //register out 2
              stmt.registerOutParameter(3, OracleTypes.ARRAY, "MSG_EVT_TABLE");
              * This code returns a non-null ResultSet but there is no data in the ResultSet
              * ResultSet rs = stmt.executeQuery();
              * rs.close();
              * Tried all sorts of combinations of getXXXX(1);
              * All return the same error Message: Invalid column index
              * So it appears that the execute statment returns no data.
              stmt.execute();
              Struct myObject = (Struct)stmt.getObject(1);
              stmt.close();
              conn.close();
    }

    Hi,
    Sorry but I'd refer you to the following sections (and code samples/snippets) in my book:
    Mapping User-Defined Object Types (AD) to oracle.sql.STRUCT in section 3.3, shows how to pass user defined types as IN, OUT,IN/OUT
    JMS over Streams/AQ in the Database: shows how to consume AQ
    message paylod in section 4.2.4
    CorporateOnine, in section 17.2, show how to exchanges user defined type objects b/w AQ and JMS
    All these will hopefully help you achieve what you are trying to do.
    Kuassi

  • Notification with user defined type results in PLS-00306: wrong number..

    I created a user defined type TLogMessage:
    CREATE OR REPLACE TYPE TLogMessage AS OBJECT
    module VARCHAR2(4000),
    severity NUMBER,
    message VARCHAR2(4000)
    I also created a multi-consumer queue using this type as payload.
    My callback procedure in the package PK_SYST_LOGMESSAGE is defined as follows:
         PROCEDURE DefaultLoggerCallback(
              context          RAW,
              reginfo          SYS.AQ$_REG_INFO,
              descr          SYS.AQ$_DESCRIPTOR,
              payload          RAW,
              payload1     NUMBER
    Finally, I registered the callback procedure as follows:
              DBMS_AQADM.ADD_SUBSCRIBER(
                   queue_name      => QUEUE_NAME,
                   subscriber      => SYS.AQ$_AGENT(
                                            name => 'default_logger',
                                            address => NULL,
                                            protocol => NULL
              DBMS_AQ.REGISTER(
                   SYS.AQ$_REG_INFO_LIST(
                        SYS.AQ$_REG_INFO(
                             name          => QUEUE_NAME || ':default_logger',
                             namespace     => DBMS_AQ.NAMESPACE_AQ,
                             callback     => 'plsql://MTDX.PK_SYST_LOGMESSAGE.DefaultLoggerCallback',
                             context          => HEXTORAW('FF')
                   1
    However, when I put a message in the queue using this procedure:
         PROCEDURE LogMessage(
              pModule          VARCHAR2,
              pSeverity     NUMBER,
              pMessage     VARCHAR2
         IS
              vMessage               TLogMessage;
              vEnqueueOptions          DBMS_AQ.ENQUEUE_OPTIONS_T;
              vMsgProperties          DBMS_AQ.MESSAGE_PROPERTIES_T;
              vMessageHandle          RAW(16);
         BEGIN
              vMessage := TLogMessage(module => pModule, severity => pSeverity, message => pMessage);
              vEnqueueOptions.visibility := DBMS_AQ.IMMEDIATE;
              vMsgProperties.correlation := pModule;
              vMsgProperties.priority := -pSeverity;
              -- Enqueue the message to all subscribers
              DBMS_AQ.ENQUEUE(
                   queue_name               => QUEUE_NAME,
                   enqueue_options          => vEnqueueOptions,
                   message_properties     => vMsgProperties,
                   payload                    => vMessage,
                   msgid                    => vMessageHandle
         EXCEPTION
              WHEN no_subscribers THEN
                   -- No subscribers on the queue; ignore
                   NULL;
         END;
    I can see the message in the queue, by querying the queue view. I can also see that Oracle tried to call my callback procedure, because in the trace file I see the following:
    *** 2009-02-13 08:52:25.000
    *** ACTION NAME:() 2009-02-13 08:52:24.984
    *** MODULE NAME:() 2009-02-13 08:52:24.984
    *** SERVICE NAME:(SYS$USERS) 2009-02-13 08:52:24.984
    *** SESSION ID:(609.3387) 2009-02-13 08:52:24.984
    Error in PLSQL notification of msgid:4F7962FEDD3B41FA8D9538F0B38FCDD1
    Queue :"MTDX"."LOGMESSAGE_QUEUE"
    Consumer Name :DEFAULT_LOGGER
    PLSQL function :MTDX.PK_SYST_LOGMESSAGE.DefaultLoggerCallback
    : Exception Occured, Error msg:
    ORA-00604: Fout opgetreden bij recursief SQL-niveau 2.
    ORA-06550: Regel 1, kolom 7:
    PLS-00306: Onjuist aantal of type argumenten in aanroep naar 'DEFAULTLOGGERCALLBACK'..
    ORA-06550: Regel 1, kolom 7:
    PL/SQL: Statement ignored.
    So.. how many parameters does Oracle expect, and of what type? Is there any way to find out? What is wrong with my code?

    Ok, found it... I had defined the last parameter of the callback procedure as 'payload1' (that is: 'payload-ONE') instead of 'payloadl' ('payload-ELL'). It all works like a charm now.
    What a way to waste two whole days!

  • View Object with User Defined Type input

    I am trying to use a View Object with a query that requires a user defined object as an input parameter.
    I have the query working with a PreparedStatement, but would like to use a View Object.
    When I use the PreparedStatement, I prepare the user defined type data like this:
    // get the data into an object array
    Object[] wSRecObjArr = wSRec.getObjectArray();
    // set up rec descriptor
    StructDescriptor WSRecDescriptor = StructDescriptor.createDescriptor("WS_REC",conn);
    // populate the record struct
    STRUCT wSRecStruct = new STRUCT(WSRecDescriptor,conn,wSRecObjArr);
    Then I can use this in the PreparedStatement like this:
    OraclePreparedStatement stat = null;
    ResultSet rs = null;
    stat = (OraclePreparedStatement)conn.prepareStatement("Select test_pkg.test_function(?) FROM DUAL");
    stat.setSTRUCT(1, wSRecStruct);
    rs = stat.executeQuery();
    I would like to do the same process with a View Object instead of the PreparedStatement.
    My question is "How do I create the input objects"?
    I obtain the View Object from the Application Module using findViewObject(). I don't actually have a connection object to pass into the StructDescriptor.createDescriptor method.
    I have tried just using Java Object Arrays (Object[]) to pass the data, but that gave an error:
    oracle.jbo.SQLStmtException: JBO-27122: SQL error during statement preparation.
    Any help or pointers are greatly appreciated.
    Thank you.
    Edited by: 942120 on May 1, 2013 8:45 AM
    Edited by: 942120 on May 1, 2013 8:46 AM
    Edited by: 942120 on May 1, 2013 9:05 AM
    Edited by: 942120 on May 1, 2013 9:06 AM

    Custom domains are the way to go.
    When I try to pass custom domains that represent my user defined types - it works.
    However, one of the functions requires a table of a user defined type be passed in.
    I tried creating a domain of the table type. It forces me to add a field during creation (in JDEV), so I tried adding a field of type Array of Element of the domain representing the user defined type.
    I populate the table by setting the field I created, but the table is empty in PL/SQL (TEST_TAB.COUNT = 0).
    I also tried passing the oracle.jbo.domain.Array object, but that produced an error:
    java.sql.SQLException: ORA-06553: PLS-306: wrong number or types of arguments in call
    I also tried passing Object[], but that produced an error:
    oracle.jbo.SQLStmtException: JBO-27122: SQL error during statement preparation.
    How do I properly create, and pass an domain that represents a table of a user defined type?
    When I use a OraclePreparedStatement, I can pass a oracle.sql.ARRAY using stat.setARRAY.
    Thank you for the help you have provided, and any future advice.
    JDEV 10.1.2.3
    JDBC 10.2.0.5
    Edited by: 942120 on May 13, 2013 7:13 AM
    Edited by: 942120 on May 13, 2013 7:16 AM

Maybe you are looking for

  • Performance issue when using select count on large tables

    Hello Experts, I have a requirement where i need to get count of data  from a database table.Later on i need to display the count in ALV format. As per my requirement, I have to use this select count inside a nested loops. Below is the count snippet:

  • Adobe TV videos won't play on iPad

    Hi all, I'm posting this here as well as having updated another post on the Adobe TV forum - it looks like there's more activity here. There are reports (mine among them) that the Adobe TV site doesn't work on some iOS devices.   I have an iPad 2, an

  • Move stock between storage bin

    Hello, We have some materials created in the past and are created in dummy storage bin. Now we need to move this materials to the correct storage bin. How can I do move X units from a storage bin to other storage bin. Create a TR between storages bin

  • Site-wide media query file

    Let's say one has a style sheet for detail pages on one's website, say "detail.css", designed for desktop monitors.   Now one creates a sitewide media query file, e.g., mq-detail.css which looks like this to refer to the tablet and phone style sheets

  • Clone stamp tool on a 3D object (CS5)

    I'm getting very odd color corruption, using the clone stamp tool on a 3D object. I'm using it for one of the main aspects of PS 3D, painting out UV seams on an object. And I'm getting a very odd artifact: an entirely brown texture is, when sampled w