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

Similar Messages

  • Add column to user defined type based on existing table

    Hello guys,
    I am trying to compile my function which returns a user defined type based on existing table. Throughout the initializing process though my query returns one additional column - SCORE(1). Here is my package:
    create or replace
    PACKAGE STAFF_AGENCY_PKG AS
    TYPE TYPE_SEEKER_TABLE IS TABLE OF TOSS.SEEKER%ROWTYPE;
    FUNCTION GET_SEEKERS(IN_KEYWORD IN VARCHAR2)
    RETURN TYPE_SEEKER_TABLE PIPELINED;
    END STAFF_AGENCY_PKG;
    create or replace
    PACKAGE BODY STAFF_AGENCY_PKG
    AS
    FUNCTION GET_SEEKERS(IN_KEYWORD IN VARCHAR2)
    RETURN TYPE_SEEKER_TABLE PIPELINED
    IS
    R_TBL TYPE_SEEKER_TABLE; -- to be returned
    BEGIN
    FOR R IN(
    SELECT Seeker.SEEKER_ID,
    Seeker.FIRSTNAME,
    Seeker.LASTNAME,
    Seeker.NATIONALITY,
    Seeker.ISELIGIBLE,
    Seeker.BIRTHDATE,
    Seeker.ISRECIEVEEMAILS,
    Seeker.HIGHESTDEGREE,
    Seeker.ETHNICITY,
    Seeker.GENDER,
    Seeker.ISDISABILITY,
    Seeker.DISABILITY,
    Seeker.CV,
    Seeker.PASSWORD,
    Seeker.PREFFERED_CITY,
    SEEKER.EMAIL,
    SEEKER.JOB_PREFERENCES_ID,
    SCORE(1)
    FROM SEEKER Seeker
    WHERE CONTAINS(CV, '<query>
    <textquery lang="ENGLISH" grammar="context">' ||
    GET_RELATED_CATEGORIES(IN_KEYWORD) ||
    '</textquery>
    <score datatype="INTEGER"/>
    </query>', 1) > 0
    LOOP
    PIPE ROW(R); --Error(38,10): PLS-00382: expression is of wrong type
    END LOOP;
    RETURN;
    END GET_SEEKERS;
    END STAFF_AGENCY_PKG;
    How do I need to amend my user type in order to suffice?
    Oracle Release 11.2.0.1.0
    Many thanks in advance!

    >
    How do I need to amend my user type in order to suffice?
    >
    You will need to create two new TYPEs. One that has all of the columns of the TOSS.SEEKER table and the new SCORE column and then a TYPE that is a table of the first type.
    See the Example 12-22 Using a Pipelined Table Function For a Transformation in the PL/SQl language reference
    http://docs.oracle.com/cd/B28359_01/appdev.111/b28370/tuning.htm#i53120
    Here is the first part
    -- Define the ref cursor types and function
    CREATE OR REPLACE PACKAGE refcur_pkg IS
      TYPE refcur_t IS REF CURSOR RETURN employees%ROWTYPE;
      TYPE outrec_typ IS RECORD (
        var_num    NUMBER(6),
        var_char1  VARCHAR2(30),
        var_char2  VARCHAR2(30));
      TYPE outrecset IS TABLE OF outrec_typ;
    FUNCTION f_trans(p refcur_t)
          RETURN outrecset PIPELINED;
    END refcur_pkg;
    CREATE OR REPLACE PACKAGE BODY refcur_pkg IS
      FUNCTION f_trans(p refcur_t)
       RETURN outrecset PIPELINED IS
        out_rec outrec_typ;
        in_rec  p%ROWTYPE;
      BEGINModify
      TYPE outrec_typ IS RECORD (
        var_num    NUMBER(6),
        var_char1  VARCHAR2(30),
        var_char2  VARCHAR2(30));
      TYPE outrecset IS TABLE OF outrec_typ;to include all of the columns you need. Unfortunately you will have to manually list all of the columns of the TOSS.SEEKER table. If you expect to need this same structure in other places you should create them as SQL types instead of PL/SQL types.
    This example should be enough to show you how to change your code to do something similar.

  • Selecting Columns with User Defined Types... in PHP

    I've looked all over google and this forum and can't find anything about this... here's what I've got:
    a User Defined Type:
    CREATE TYPE "ADDRESS" AS OBJECT (
    ADDRESS VARCHAR2(256),
    COUNTRY VARCHAR2(256),
    STATE VARCHAR2(256),
    SUBURB VARCHAR2(256),
    TOWNCITY VARCHAR2(256)
    and it is used in a column in one of my tables:
    CREATE TABLE "SUPPLIERS" (
    "ID" NUMBER,
    "USER_ID" NUMBER,
    "NAME" VARCHAR2(50),
    "ADDRESS" "ADDRESS"
    so that column "address" is of type "address". I am then able to insert a row using:
    INSERT INTO "SUPPLIERS" VALUES(1,1,'name',ADDRESS('address','country','state','suburb','town city'));
    and that all works as expected. I can select the data using iSqlPlus and get the result I expect;
    ADDRESS('address', 'country', 'state', 'suburb', 'town city')
    So here's the problem. I cannot reterieve the data as expected, using PHP. If I make a select statement on the table that excludes the ADDRESS column I get the results as expected. If the ADDRESS column is included I get an error when fetching the row:
    ORA-00932: inconsistent datatypes: expected CHAR got ADT
    I'm assuming this is because the the cell cannot be cast to a string. How can I select the row so that the ADDRESS column is returned as an object? Can I even? If I can't, I don't see the use of Object Data Types... :(
    I have found that I can select a field of the type using:
    SELECT t.ADDRESS.TOWNCITY FROM SUPPLIERS t;
    But this is not ideal, because the whole idea was that I could (potentially) change the format for, in my example, an address, and not need to alter my SQL statements.
    Any ideas??

    PHP OCI8 can currently only bind simple types. Here are two possible
    solutions.
    -- cj
    create or replace type mytype as object (myid number, mydata varchar2(20));
    show errors
    create or replace type mytabletype as table of mytype;
    show errors
    create or replace procedure mycreatedata1(outdata out mytabletype) as
    begin
      outdata := mytabletype();
      for i in 1..10 loop
        outdata.extend;
        outdata(i) := mytype(i, 'some name'||i);
      end loop;
    end;
    show errors
    -- Turn the data into a ref cursor (but PHP OCI8 doesn't use prefetching for ref cursors)
    create or replace procedure mywrapper1(rcemp out sys_refcursor) as
    data mytabletype;
    begin
      mycreatedata1(data);
      open rcemp for select * from table(cast(data as mytabletype));
    end mywrapper1;
    show errors
    -- Turn the data into two collections
    -- This might be faster than returning a ref cursor because you can
    -- use oci_bind_array_by_name() on each parameter.
    create or replace procedure mywrapper2(pempno out dbms_sql.NUMBER_table, pename out dbms_sql.VARCHAR2_table) as
    data mytabletype;
    begin
      mycreatedata1(data);
      select myid, mydata
      bulk collect into pempno, pename
      from table(cast(data as mytabletype));
    end mywrapper2;
    show errorsThen in PHP you could do:
    // Use a Ref Cursor
    $s = oci_parse($c, "begin mywrapper1(:myid); end;");
    $rc = oci_new_cursor($c);
    oci_bind_by_name($s, ':myid', $rc, -1, OCI_B_CURSOR);
    oci_execute($s);
    oci_execute($rc);
    oci_fetch_all($rc, $res);
    var_dump($res);
    // Use Collections
    $s = oci_parse($c, "begin mywrapper2(:myid, :mydata); end;");
    oci_bind_array_by_name($s, ":myid", $myid, 10, -1, SQLT_INT);
    oci_bind_array_by_name($s, ":mydata", $mydata, 10, 20, SQLT_CHR);
    oci_execute($s);
    var_dump($myid);
    var_dump($mydata);

  • Data retrieval from columns having user defined type

    I was learning abstract types the other day.So I created an abstract type and a table.
    create type student_ty as object
    (name varchar2(20),roll number);
    create table result(
    student student_ty,
    total number);
    I have also inserted some data.But I am having some problems with the rretrieval of data.Suppose I want to select only the roll and name of the student as described in the studen type.So I used the follwing query:-
    select student.name from result;
    But its not working.But when i'm using something like this:-
    select r.total,r.student.name from result r;
    It is working perfectly.My question is that is it a rule that oracle enforces to use an alias whenever retrieving values from a user defined datatype?.Please help.
    Thanks in advance.

    Hi,
    Good observation. As you can see with your first query, the student is considered by oracle as a alias instead of a user-defined type column which is included in your result's table.
    >
    select student.name from result;
    >That is why in this case, you really need to use an alias or you can just use the complete table name like this:
    select result.student.name from resultBut, of course, it is not recommended, using alias is much appropriate.
    Cheers.

  • How to change list's column to user defined type in sharepoint2013?

    In my SharePoint Site Collection has a one list, it contains some column of the following type text, date, multiline  etc, so here i want to change the number field into range filed(like slider <input type="range" min="0" max="100"/>
    ) so i don't know, how to do this...? 
    and I am using sharepoint2013, visual studio 2013 and SharePoint Designer

    Not sure what you mean by slider field, However, create a custom field with custom type. Refer to the following posts for more information
    https://sp2013fieldsamples.codeplex.com/
    http://social.msdn.microsoft.com/Forums/sharepoint/en-US/5c9ffbe9-122f-4afa-a910-281926e6b2c9/how-to-create-custom-field-types-for-sharepoint-2013?forum=sharepointdevelopment
    --Cheers

  • 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

  • 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)

  • 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

  • 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>

  • Querying user-defined types

    I have a table in which one of the columns is a user-defined datatype:
    SQL> describe my_table
    USER_DATA    MYTYPEThe type "MYTYPE" is a simple object that contains one field: a CLOB called MESSAGE:
    SQL> describe mytype
    Name       Null?    Type
    MESSAGE          CLOBWhen I do a "select * ..." from this table, the column USER_DATA is displayed as "MYTYPE(oracle.sql.CLOB@898c2d)"
    I know that for CLOB and BLOB fields, SQL Developer will let me double click the value and view the contents. But for a user-defined type like this that contains a field, I cannot browse into the data members of the type. I find myself wanting to do something like a "select user_data.message from my_table", but this is not valid syntax. Is there a way to query a specific data member of this user-defined type with the rest of the columns in the table so that I can be shown the CLOB member instead of a representation of the object? If not, is there a way to configure SQL Developer to allow me to browse the data members of user-defined types? TOAD has a feature like this but I would like to use SQL Developer exclusively and this is one table I must work with regularly.

    Just to back up a previous post:
    sqldeveloper 1.5.5.59.69 against 10.2 (Express Edition)
    desc r2
    input:
    select r.message from r2; --fails
    select r2.r.message from r2; --fails
    select this.r.message from r2 this; --succeeds
    output:
    desc r2
    Name Null Type
    R REALLY_CLOB()
    Error starting at line 1 in command:
    select r.message from r2
    Error at Command Line:1 Column:7
    Error report:
    SQL Error: ORA-00904: "R"."MESSAGE": invalid identifier
    00904. 00000 - "%s: invalid identifier"
    *Cause:   
    *Action:
    Error starting at line 2 in command:
    select r2.r.message from r2
    Error at Command Line:2 Column:7
    Error report:
    SQL Error: ORA-00904: "R2"."R"."MESSAGE": invalid identifier
    00904. 00000 - "%s: invalid identifier"
    *Cause:   
    *Action:
    R.MESSAGE
    (CLOB)
    (CLOB)
    (CLOB) start of clob
    3 rows selected

  • 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

  • How to find which all workbook is using Database function ( User Defined)

    Hi All,
    Is it possible to find out which all workbook is using Database function( User Defined).
    Thanks,

    Hi,
    If I had to do this detective work, I would probably do the following:
    1. Activate for a period of time the function, eul5_post_save_document. This function when activated is triggered at the time a workbook is saved. If you look at its columns, it save the worksheet's SQL.
    2. Next, I would parse the EUL5_WORKSHEET_SQL.SQL_SEGMENT column which is a varchar2(4000) column. There are many effective Oracle functions which could aid you in this effort (e.g. instring or perhaps a regular expression function).
    I hope this helps.
    Patrick

  • Table OF user defined type in c#

    Hello
    I am running C# using Oracle (PL/SQL, provider ODP.NET
    11.1.0.6.20) and I have a procedure which at the moment returns a table of
    records. The code below demonstrates this.
    TYPE R_OutData_tab IS RECORD ( ... );
    TYPE OutData_tab IS TABLE OF R_OutData_tab INDEX BY BINARY_INTEGER;
    PROCEDURE PROPERTY_GET (tOutData OUT <packagename>.OutData_tab);
    Since .NET doesn't support Oracle records I'm looking into rewriting the
    procedure so that it returns a table of a user defined type instead. The
    code below demonstrates this.
    create type person_type as object (name varchar2(30), address varchar2(60),
    age varchar2(3));
    TYPE person_table IS TABLE OF odp_obj1_sample_person_type;
    PROCEDURE PERSONS_GET(out_persons OUT person_table);
    I know how to handle a single user-defined type in .NET returned from a
    Oralce procedure but what I need to do now is to receive a or pass table of a user
    defined type using procedure. Is this supported in .NET?

    Dear ,
    I have posted a similar kind of reply in one of the thread  which may help u defining the User Defined Tabel /Filed .Just check this Out :
    For cm25/CM21 : Assuming that you have all the other set up for Capacity Requirement in place , please note the belwo steps for layout design for CM25 OR cm21 or cm22( all you will be used same overall profile )
    1.Make sure that you have proper Overall profile defined in OPD0-Define Overall profile .Here u will define Time Profile , Startegy prfoile . Lay out Profile etc .
    2.To paint your layout your soultion is to Goto -CY38-Pop down the menu -Select the Lay out Key which have been used as lay out -Goto Change Mode (Pencil symbol)-Now you will find the fields are high ligheted as per CM25 dipaly in a sequnce -You can un chekcde the Filed like Operation , Operation text , Setup what ever you do not want to show in Order Pool and Hit SAVE butotn and come back .
    CM25 --> Settings --> Display Profiles --> Planning tab.profile --> I01 --> Layout ID ( Example : 'SAPSFCLA05') which is Main Capacity Lay out id .
    If you goto CY38-Pop down the menu -You will find Main Capcitity Lay out Id : Example SAPSFCAS01 -Enter this lay out and chenage accordingly as I have explained in above
    Once you save this , then go back to CM25 and execute with coupe of work centres to check how is the order pool looks now .
    Refer this threade for Layout Id and option which u may need for CM25 front end
    Exception messages in CM21 or CM25
    I hope this should work
    Regards

  • Accessing User Defined Types

    We have recently updated our libraries to the latest version (2.102.2.20) - and have lost access to the critical objects and methods that were accessing our User Defined Types on Oracle.
    In particular, this code:
    OracleUdtDescriptor descriptor = OracleUdtDescriptor.GetOracleUdtDescriptor((OracleConnection)conn, "MY_USER.MYTYPE");
    OracleArray items = new OracleArray(descriptor);
    foreach (string s in testArrayItems)
    items.Append(s);
    IDbDataParameter itemsParam = cmd.OracleParameters.Add("items", OracleDbType.VArray, items, ParameterDirection.Input);
    simply doesn't work anymore. The 'OracleUdtDescriptor' and 'OracleArray' references no longer exist. This has brought all development on a critical application to a halt. (Doesn't it always.)
    How can I get the same functionality using the new version (2.102.2.20) of the Oracle.DataAccess library?

    Hi,
    Here's what I was referring to... say you wanted to execute the same procedure from PLSQL via an anonymous block. Execute the same anonymous block via ODP.NET.
    Here's a simple dumb example that passes an object type to a stored procedure, hope it helps. Hokey example, but hopefully points out what I was trying to say.
    Greg
    SQL
    ========
    create or replace type person_typ as object (name varchar2(50), age number(4))
    create table person_tab(col1 number, col2 person_typ);
    create or replace procedure insert_person_proc(v1 in number, v2 in person_typ) as
    begin
    insert into person_tab values(v1,v2);
    end;
    You could execute that via PLSQL as follows
    =================================
    declare
      myperson person_typ;
    begin
      myperson := person_typ('melody',5);
      insert_person_proc(1,myperson);
    end;
    /And do the same thing via ODP.NET
    =============================
    using System;
    using System.Data;
    using Oracle.DataAccess.Client;
    class Program
        static void Main(string[] args)
            using (OracleConnection con = new OracleConnection("data source=orcl;user id=scott;password=tiger"))
                con.Open();
                using (OracleCommand cmd = new OracleCommand("",con))
                    string strsql = "declare " +
                                    "myperson person_typ; " +
                                    "begin " +
                                    "myperson := person_typ(:1,:2); " +
                                    "insert_person(:3,myperson); " +
                                    "end; ";
                    cmd.CommandText = strsql;
                    cmd.Parameters.Add(new OracleParameter("", "Melody"));
                    cmd.Parameters.Add(new OracleParameter("", 5));
                    cmd.Parameters.Add(new OracleParameter("", 1));
                    cmd.ExecuteNonQuery();
    }

  • 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!

Maybe you are looking for

  • Load an external gallery  file into a host div via Ajax method?

    I was just wondering if anyone has been able to get a spry gallery to work when placed within an external html file and loaded into the host div of a page using Ajax method to load. It must work remotely (on the Internet). I've tried and mutilated en

  • WebLogic Server clusters not high available!!

              I'm working with WebLogic Server 6.0.           I try to connect to cluster using explicit IP addresses.           For this case,first ,I cluster server A,B and C ,then client try to look up home           interface at server A.           A

  • Life without Itunes is quiet...... pleeeeez help!!!

    Ok, here's what happened. I had itunes7, hated it. Got a message to upgrade to 7.0.2 (yay, maybe they fixed it). Dowloaded it, and now itunes won't open... at all! It sends a message saying "itunes cannot open because it has detected a problem with y

  • Upgradation from IPS 6.2(1)e3 to 7.0(2)E3.

    Hi All.    Any separate license is required to upgrading os from 6.2(1)e3 to  7.0(2)E3 . Pls find the show version of IPS. sh version Application Partition: Cisco Intrusion Prevention System, Version 6.2(1)E3 Host:     Realm Keys            key1.0 Si

  • CF9.01 and ActiveMQ

    I am trying to accept JMS messages on my CF9.01 server from a queue on a remote server running ActiveMQ 5.7 The examples event gateway uses a Topic rather than a Queue. I keep getting: "Error","Thread-94","02/11/13","13:43:30",,"Error starting gatewa