Can we create an associative array of Object type Column

Hi All,
I have a scenario where there are many PLSQL Types passed as IN and OUT params in a procedure. Since the Java cannnot access these types, we've plannned to create Object types.
However the can we create one Object type as below:
create or replace type T_EMP_REC as object
emp_id number(8),
dept_id number(8),
emp_name varchar2(50),
Then now I want to create an array of T_EMP_REC.emp_id and others respectively. Is this possible.
The reason for doing this is, that we may get many emp_id, dept_id and emp_name for a condition and hence pass on the same to Java application.
Please share your thoughts to achieve for such scenario. Any pseudo or code logic is much helpful.
Regards,

Hi,
Sorry, this is forum is intended only for SQL Developer tool questions.
If you wish to pursue your question, mark this thread as answered and repost in the SQL and PL/SQL forum:
PL/SQL
Thanks,
Gary

Similar Messages

  • Error while assigning dates to associative array of date type

    Hi All,
    I am facing the issue while assigning dates to associative array of date type:
    Oracle Version:
    SQL> select * from v$version;
    BANNER
    Oracle Database 10g Enterprise Edition Release 10.2.0.1.0 - 64bi
    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
    Stored procedure i am trying to write is as following
    create or replace procedure jp1 (
    p_start_date date default trunc(sysdate,'MM')
    , p_end_date date default trunc(sysdate)
    is
    l_no_of_days number;
    type t_date_id is table of date
    index by pls_integer;
    l_date_id_arr t_date_id;
    begin
    l_no_of_days := p_end_date - p_start_date;
    for i in 0
    .. l_no_of_days - 1
    loop
        l_date_id_arr := p_start_date + i;
        dbms_output.put_line(p_start_date + i);
    end loop;
    end;
    I am getting error at line 14 while compiling this. and the error message is as following:
    Errors for PROCEDURE JP1:
    LINE/COL ERROR
    14/5     PL/SQL: Statement ignored
    14/22    PLS-00382: expression is of wrong type
    So while investigating this i tried to output the value of (p_start_date + i) using dbms_output.put_line and the output is date itself.
    create or replace procedure jp1 (
    p_start_date date default trunc(sysdate,'MM')
    , p_end_date date default trunc(sysdate)
    is
    l_no_of_days number;
    type t_date_id is table of date
    index by pls_integer;
    l_date_id_arr t_date_id;
    begin
    l_no_of_days := p_end_date - p_start_date;
    for i in 0 .. l_no_of_days-1
    loop
        --l_date_id_arr := p_start_date + i;
        dbms_output.put_line(p_start_date + i);
    end loop;
    end;
    output of the
    exec jp1
    is as following:
    01-DEC-13
    02-DEC-13
    03-DEC-13
    04-DEC-13
    05-DEC-13
    06-DEC-13
    07-DEC-13
    08-DEC-13
    09-DEC-13
    10-DEC-13
    11-DEC-13
    12-DEC-13
    13-DEC-13
    14-DEC-13
    15-DEC-13
    16-DEC-13
    17-DEC-13
    18-DEC-13
    I see the output as date itself. so why it is throwing error while assigning the same to associative array of date type.
    I tried to google also for the same but to no avail.
    Any help in this regard is appreciated or any pointer some other thread on internet or in this forum.
    Thanks in advance
    Jagdeep Sangwan

    Read about associative arrays :
    create or replace procedure jp1 (
    p_start_date date default trunc(sysdate,'MM')
    , p_end_date date default trunc(sysdate)
    ) is
    l_no_of_days number;
    type t_date_id is table of date
    index by pls_integer;
    l_date_id_arr t_date_id;
    begin
    l_no_of_days := p_end_date - p_start_date;
    for i in 0..l_no_of_days - 1
    loop
        l_date_id_arr(i) := p_start_date + i;
        dbms_output.put_line(p_start_date + i);
    end loop;
    end;
    Ramin Hashimzade

  • Can we create two dashboard prompts for the same column in the samepage

    hi ,
    can we create two dashboard prompts for the same column on the same page,
    I have a date column and I am trying to create 2 dashboard prompts on the same page one as from date and the other one as to date.Is this possible to create.When I am trying to create it is giving me error like cannot use same column for creating the prompt
    Any suggestions or ideas

    863997 wrote:
    hi ,
    can we create two dashboard prompts for the same column on the same page,
    I have a date column and I am trying to create 2 dashboard prompts on the same page one as from date and the other one as to date.Is this possible to create.When I am trying to create it is giving me error like cannot use same column for creating the prompt
    Any suggestions or ideasYou are correct. You cannot build two prompts on the same column. Use this link for instructions on how to build a "between prompt" because of this fact:
    http://oraclebizint.wordpress.com/2008/02/26/oracle-bi-ee-101332-between-prompts-for-date-columns-using-presentation-variables/

  • How can I create multi-dimensional arrays of controls?

    I'm building a VI that will have hundreds of on/off buttons, 24 on each of 8 tabs.  I can deal with them programmatically in an array, like this:
    and then find which one was pushed with some XOR'ing:
    But what if I want two rows of 12 buttons?  Can I make a 2D array of buttons somehow?  Or a 1D array of buttons on two rows for cosmetic reasons?
    What if I want to put 24 buttons on each of 8 tabs?  Can I make a 24x8 array of controls somehow?  Or a 12x2x8?
    Thanks,
    -Jordan
    Solved!
    Go to Solution.

    jordanglassman wrote:
    and then find which one was pushed with some XOR'ing:
    I would strongly recommend to replace the XOR with a not equal. Same outcome, but less nerdy. It is also much more universal! For example if you ever need to do this on an array of numerics to see which element got changed (I often do!), the XOR will no longer work as well (with integers, you'll end up with bitwise comparisons and numeric results, and with DBLs you'll end up with coercions and unpredictable results because bits are lost).
    LabVIEW Champion . Do more with less code and in less time .

  • Invoking stored procedure that returns array(oracle object type) as output

    Hi,
    We have stored procedures which returns arrays(oracle type) as an output, can anyone shed some light on how to map those arrays using JPA annotations? I tried using jdbcTypeName but i was getting wrong type or argument error, your help is very much appreciated. Below is the code snippet.
    JPA Class:
    import java.io.Serializable;
    import java.sql.Array;
    import java.util.List;
    import javax.persistence.Entity;
    import javax.persistence.Id;
    import org.eclipse.persistence.annotations.Direction;
    import org.eclipse.persistence.annotations.NamedStoredProcedureQuery;
    import org.eclipse.persistence.annotations.StoredProcedureParameter;
    * The persistent class for the MessagePublish database table.
    @Entity
    @NamedStoredProcedureQuery(name="GetTeamMembersDetails",
         procedureName="team_emp_maintenance_pkg.get_user_team_roles",
         resultClass=TeamMembersDetails.class,
         returnsResultSet=true,
         parameters={  
         @StoredProcedureParameter(queryParameter="userId",name="I_USER_ID",direction=Direction.IN,type=Long.class),
         @StoredProcedureParameter(queryParameter="employeeId",name="I_EMPLOYEEID",direction=Direction.IN,type=Long.class),
         @StoredProcedureParameter(queryParameter="TEAMMEMBERSDETAILSOT",name="O_TEAM_ROLES",direction=Direction.OUT,jdbcTypeName="OBJ_TEAM_ROLES"),
         @StoredProcedureParameter(queryParameter="debugMode",name="I_DEBUGMODE",direction=Direction.IN,type=Long.class)
    public class TeamMembersDetails implements Serializable {
         private static final long serialVersionUID = 1L;
    @Id
         private long userId;
         private List<TeamMembersDetailsOT> teamMembersDetailsOT;
         public void setTeamMembersDetailsOT(List<TeamMembersDetailsOT> teamMembersDetailsOT) {
              this.teamMembersDetailsOT = teamMembersDetailsOT;
         public List<TeamMembersDetailsOT> getTeamMembersDetailsOT() {
              return teamMembersDetailsOT;
    Procedure
    PROCEDURE get_user_team_roles (
    i_user_id IN ue_user.user_id%TYPE
    , o_team_roles OUT OBJ_TEAM_ROLES_ARRAY
    , i_debugmode IN NUMBER :=0)
    AS
    OBJ_TEAM_ROLES_ARRAY contains create or replace TYPE OBJ_TEAM_ROLES_ARRAY AS TABLE OF OBJ_TEAM_ROLES;
    TeamMembersDetailsOT contains the same attributes defined in the OBJ_TEAM_ROLES.

    A few things.
    You are not using a JDBC Array type in your procedure, you are using a PLSQL TABLE type. An Array type would be a VARRAY in Oracle. EclipseLink supports both VARRAY and TABLE types, but TABLE types are more complex as Oracle JDBC does not support them, they must be wrapped in a corresponding VARRAY type. I assume your OBJ_TEAM_ROLES is also not an OBJECT TYPE but a PLSQL RECORD type, this has the same issue.
    Your procedure does not return a result set, so "returnsResultSet=true" should be "returnsResultSet=false".
    In general I would recommend you change your stored procedure to just return a select from a table using an OUT CURSOR, that is the easiest way to return data from an Oracle stored procedure.
    If you must use the PLSQL types, then you will need to create wrapper VARRAY and OBJECT TYPEs. In EclipseLink you must use a PLSQLStoredProcedureCall to access these using the code API, there is not annotation support. Or you could create your own wrapper stored procedure that converts the PLSQL types to OBJECT TYPEs, and call the wrapper stored procedure.
    To map to Oracle VARRAY and OBJECT TYPEs the JDBC Array and Struct types are used, these are supported using EclipseLink ObjectRelationalDataTypeDescriptor and mappings. These must be defined through the code API, as there is currently no annotation support.
    I could not find any good examples or doc on this, your best source of example is the EclipseLink test cases in SVN,
    http://dev.eclipse.org/svnroot/rt/org.eclipse.persistence/trunk/foundation/eclipselink.core.test/src/org/eclipse/persistence/testing/tests/plsql/
    http://dev.eclipse.org/svnroot/rt/org.eclipse.persistence/trunk/foundation/eclipselink.core.test/src/org/eclipse/persistence/testing/tests/customsqlstoredprocedures/
    James : http://www.eclipselink.org

  • How can I create new carriforwarede and Brodforwarded wage types

    Hi Gurus
    We had one wage as special compensation.that has been done for to update in IT0014. 
    Now new requirement is came that special compesation was type they would like to update in IT0008.  I have all the necessary configuration. its working fine.  now client wants to create Brodfowarded and Carryforwarded wage types for this wage type.
    Pls let me know how can I create these.?
    And where should I have to map this?
    Is it scheema level job or not?
    pls asap.
    Regards
    suresh

    Hi Navya
    Thanks for your replay
    Can you pls some elobarate this.  becasue of I have not all done schema changes till now.  here we have been using IN00 schema.
    Can give some brief explanatation how can I do this.  I have been wiating for you valuable replay. pls
    Regards
    Suresh

  • Can I create a table with more than 40 columns ?

    Hello,
    I need to organize my work with a table and need about 66 columns. I am not very good with Numbers but I know a little bit of Pages. I cannot find a way to create a table with more than 40 columns... Is it hopeless ? (Pages '08 v. 3.0.3)
    Thank you all

    It's never too late to try to teach users that the Search feature is not only for helpers.
    The number of columns allowed in Numbers is not a relevant value when the question is about Pages '08 tables.
    I tried to copy a 256 columns Numbers table into a Pages '09 document.
    I didn't got a table but values separated by TABs.
    I tried to convert this text range in a table and got this clear message :
    If I remember well, in Pages '08, the limit is 40 columns.
    It seems that you are a specialist of inaccurate responses, but I'm not a moderator so I'm not allowed to urtge you to double check what you wrote before posting.
    Yvan KOENIG (VALLAURIS, France) vendredi 29 avril 2011 14:57:58
    Please :
    Search for questions similar to your own before submitting them to the community

  • Updating Object Type Columns with SQL

    Please note that is a re-post from a different forum. I thought I would try this forum as reading through it, it made more sense to post here. Problem:
    I am trying to update a column inside a Nested Table Type in my Table.
    This is what I got from some documentation I found from Oracle.
    UPDATE TABLE(SELECT PROGRAMS FROM TB_ITEM_MASTER WHERE ITEM_NO_ID =1748) IM
    SET IM.PROGRAM_ID = 1;
    WHERE IM.ITEM_NO_ID = 1748;
    Where PROGRAM_ID is a field from the nested table (ITEMS_IN_PROGRAMS_NT) and ITEM_NO_ID is the Primary Key in my TB_ITEM_MASTER table. When I run this it gives me an error of:
    ORA-22908: REFERENCE TO NULL TABLE VALUE
    I assume this is because PROGRAM_ID is currently NULL, and when it pulls the record back, I am pulling a NULL value. Currently all the values will be NULL in the table, but I would like to create a UPDATE Statement that I will call that will update that value, from NULL to whatever ID.
    Here are my def'n's of all my objects for this problem:
    --Object Type def'n
    CREATE OR REPLACE TYPE ITEMS_IN_PROGRAMS_TY AS OBJECT(
    PROGRAM_ID NUMBER(38));
    --Object Type def'n for Nested Table
    CREATE OR REPLACE TYPE ITEMS_IN_PROGRAMS_NT
    AS TABLE OF ITEMS_IN_PROGRAMS_TY;
    --Table def'n
    CREATE TABLE TB_ITEM_MASTER
    (ITEM_NO_ID NUMBER(38) NOT NULL,
    ITEM_NO VARCHAR2(75) NOT NULL,
    NOMENCLATURE VARCHAR2(100) NULL,
    PROGRAMS DMISDBA.ITEMS_IN_PROGRAMS_NT NULL);
    Can someone please help me....I am pulling my hair out on this problem!!! All I want to do is update the column inside a Nested Table. This can not be that hard!!!

    Save your hair...
    SQL> CREATE OR REPLACE TYPE items_in_programs_ty AS OBJECT(
      2  program_id NUMBER(38));
      3  /
    Type created.
    SQL> CREATE OR REPLACE TYPE items_in_programs_nt
      2  AS TABLE OF items_in_programs_ty;
      3  /
    Type created.
    SQL> CREATE TABLE tb_item_master
      2  (item_no_id number(38) not null,
      3  item_no varchar2(75) not null,
      4  nomenclature varchar2(100) null,
      5  programs items_in_programs_nt )
      6  NESTED TABLE programs STORE AS nested_programs
      7  /
    Table created.
    SQL>
    SQL> INSERT INTO tb_item_master (item_no_id, item_no, nomenclature)
      2  VALUES (1748, 'APC/1748', 'Gizmo')
      3  /
    1 row created.
    SQL> UPDATE tb_item_master tmi
      2  SET    tmi.programs =  items_in_programs_nt(items_in_programs_ty( 1))
      3  WHERE  tmi.item_no = 'APC/1748'
      4  /
    1 row updated.
    SQL>
    SQL> Cheers, APC

  • How can I create a buffer, array or pipeline that stores the last 5000 dates of a voltage measurement with PCI6036 & SCXI1104C and continously drops the last date and inserts the latest date (scanrate 200 or 2000Hz)?

    I develope a porgramm for continious monitoring. If the voltage of a channel exceeds or is lower than the upper or lower limit of tolerance the actual date must be stored and additionally the dates being stored 10sec before and after this event. Can somebody give some advice how to create the buffer to keep the dates 10s before the error event? Thank U.

    I've written you a quick array buffer vi. I'm not sure if it'll be fast enough though.. Try it and see! I've used the loop numbers in my array, but i'm sure you can feed in the dates instead.
    Attachments:
    Array_buffer.vi ‏26 KB

  • How can i create text elements in business object?

    is dis possible to crete text elements in business objects...if any body knows please give me the idea...

    Hello,
    are we talking about the BEx Text elements that are also available in the BEx Analyzer ? if so then this is right now only possible in Analysis, OLAP Edition and Analysis, Edition for Microsoft Office.
    Ingo

  • How can I create a single array from three arrays? Please Help!

    I have three arrays:
    Dates[2002-10-29 2002-10-30 2002-10-31 ...]
    OCodes[AC AD AE ...]
    LCodes[A01 A02 A03 ...]
    I would like to combine the above three arrays and write out to an array
    The new array would look like:
    NewArray[ 2002-10-29 AC A01, 2002-10-29 AC A02, 2002-10-29 AC A03,
    2002-10-29 AD A01, 2002-10-29 AD A02, 2002-10-29 AD A03,
    2002-10-29 AE A01, 2002-10-29 AE A02, 2002-10-29 AE A03 ......,
    2002-10-31 AC A01, 2002-10-31 AC A02, 2002-10-31 AC A03....,
    2002-10-31 AE A01, 2002-10-31 AE A02, 2002-10-31 AE A03...]
    Thanks in advance!

    String [ ] newArray = new String [Dates.length];
    for (int counter = 0; counter < Dates.length; ++ counter)
    StringBuffer buf = new String Buffer();
    buf.append(Dates[counter] + " ");
    buf.append(OCodes[counter] + " ");
    buf.append(LCodes[counter]);
    newArray[counter] = buf.toString(0;
    }

  • How can I create a message so when you type keywords in search my website and the info sjhow on page 1?

    I have a website and I need people to find it. How do I create the text blurb that pops up on a search so they can find my website on page 1?

    Google has tons of tools and articles to try. You could start here: http://support.google.com/webmasters/bin/answer.py?hl=en&answer=35769

  • Can I create a PDF with embedded Postscript Type 1 fonts when ordering?

    I have Adobe Acrobat Professional version and can set up a Postscript file to be distilled with the proper settings for print. I often do this for professional printers. Are there settings available for book orders, and if so, can I send my own PDF through the iPhoto application somehow? The books need to have a "Prairie/Arts & Crafts" look, and they look much better using some of Postscript fonts I have than anything that came with the system.
    PowerMac G5   Mac OS X (10.3.9)   iPhoto 6

    Anna;
    Unless you can add those fonts to your system via the Font book and then substitute them in iPhoto, you'll have to either user the available fonts or create your own pages, 8.5 x 11, in an image editor like Photoshop Elements and use them on pages that are one photo per page. Other's have done that with some success.
    If you has PS or PSE create an 8.5 x 11" canvas at 300 dpi. Then you can add your photos, add text (if PS can use the text), and create your own layout.
    Do you Twango?
    TIP: For insurance against the iPhoto database corruption that many users have experienced I recommend making a backup copy of the Library6.iPhoto database file and keep it current. If problems crop up where iPhoto suddenly can't see any photos or thinks there are no photos in the library, replacing the working Library6.iPhoto file with the backup will often get the library back. By keeping it current I mean backup after each import and/or any serious editing or work on books, slideshows, calendars, cards, etc. That insures that if a problem pops up and you do need to replace the database file, you'll retain all those efforts. It doesn't take long to make the backup and it's good insurance.
    I've written an Automator workflow application (requires Tiger), iPhoto dB File Backup, that will copy the selected Library6.iPhoto file from your iPhoto Library folder to the Pictures folder, replacing any previous version of it. You can download it at Toad's Cellar. Be sure to read the Read Me pdf file.

  • Can't create outboud delivery against new SO type

    Dear Experts,
    I created SO type via VOV8 & assign the item category via Sales & Distribution - Sales - Sales Document - Sales Document Item - Assign Item Category.
    Then I create a Sales Order via VA01 & then create Outbound Delivery via VL01N. Error getting when create outbound delivery.
    Error: Copying is not poss.because an entry is missing in Table TVCPL: YCF1 ZEF1 ZKB1
    Message no. VL473
    Message Text
    Copying is not poss.because an entry is missing in Table TVCPL: YCF1 ZEF1 ZKB1
    Technical Data
    Message type__________ E (Error)
    Message class_________ VL
    Message number________ 473
    Message variable 1____ YCF1
    Message variable 2____ ZEF1
    Message variable 3____ ZKB1
    Message variable 4____ 
    Message Attributes
    Level of detail_______ 
    Problem class_________ 2 (important)
    Sort criterion________ 
    Number________________ 1
    Environment Information
    Group_________________ 
    Sales Document________ 9
    Item (SD)_____________ 000010
    Schedule Line Number__ 
    Counter_______________ 02
    Group type____________ L
    Could anyone able to assist me to resolve thsi issue.
    TQ
    rgds,
    nantha

    Hi
    I hope, you have created your new Item category by copying the existing Item category in standard .
    I feel that , you have not copied the Item category properly.
    So, you need to delete the copied Item category and create a new one as below.
    Select the Item category you want to copy (VOV7).
    Choose "copy as" > rename the item category in the next screen > click enter.
    A pop-up will come,"is it relevant for coying" > click "yes".
    Now, you will get the message in the status bar that one item is copied.
    Here, do not leave the screen, it has not copied completely.
    In this screen click on "save" button and wait. You get a pop-up box "maintain table view" > click "continue" .
    Now only your Item category is correctly copied.
    From your postings, I feel , problem is in copying the Item category.
    If you have followed like above, then problem may be in copying control.

  • Can i create demand with respect to valuation type for a material in MRP

    hI,
       is ther any way to create demand for a material ith respect to vaulation type.
    tha means i want to give a demand for a material during a particular period
    saying that i want to produce the same material with this vaulation type 200 quantity and another valuation type 300 quantity. will the MRPplan separately.
    is ther any provesion for it
    thanks
    regards
    madan

    Dear Mr.Madan,
    This is not possible.
    MRP has nothing to do with Valuation type.
    Valuation class has the following functions
    Allows the stock values of materials of the same material type to be posted to different G/L accounts.
    Allows the stock values of materials of different material types to be posted to the same G/L account.
    Determines together with other factors the G/L accounts updated for a valuation-relevant transaction (such as a goods movement).
    MRP considers the demand given,MRP type,lot size,procurement type and the stocks available.
    But what do u want to capture exactly?
    Regards
    Mangal

Maybe you are looking for

  • Using a strongly typed ref cursor doesn't enforce data type

    I am trying to enforce the datatypes of the fields coming back from an oracle reference cursor by making it strongly typed. However, there seems to be no warning at compile time on the oracle side or exception in ODP.NET if the datatype coming back i

  • Ipad mail in ios 6  will not delete correctly from VIP mailbox

    After upgrading my ipad to ios 6, which added the VIP feature. I then added some of my contacts as VIP's, however when I attempt to delete the email after reading, the entire mail app crashes.

  • Deploying Sun Java - and controlling settings centrally

    Hello. We are trying to deploy Sun Java to corporate PCs (XPsp2) silently and also to ensure the settings are correct for our environment. Deploying silently is easy (documented here and using SMS). Some settings appear to be stored in the registry,

  • 4.6c - ecc 6.0 abap+java

    Hithere if my source system is 46c-> upgraded to ECC 6 Non Unicode-> Unicode export done-> now i have a ABAP export ....  , now i install a target system with Ecc 6.0 Unicode and import the ABAP export....but how can i have the Java component in the

  • What I've learnt so far and what I need to learn next.

    Hi, I've been struggling with Extension Builder 3 for 2 days and have made some head way with it but I've got a long way to go. If you are a novice like me, this post will could provide some useful info, if you are an extension builder guru, skip thi