RECORDS AND TABLES

CAn any explain why records and tables are used in PL/SQL?

One thing I forgot to mention: If you're an 8i client, then in
8.1.6 you'll be able to use JPublisher to solve this problem,
since it'll generate these wrappers for you.
Pierre
Oracle Product Development Team wrote:
: Hi,
: The key issue is that no part of Oracle code except PL/SQL is
: aware of the PL/SQL Record types and PL/SQL "index-by" table
: types.
: So the only way to call a PL/SQL procedure with args of a
RECORD
: or "index-by" table types is from another PL/SQL routine.
: In most cases, it's possible to work-around this by wrappering
: your PL/SQL method with another which doesn't have this issue.
: For example, if you're trying to call procedure proc01 in:
: package pack01 is
: type rec01 is record(n1 number, d1 date);
: procedure proc01 (r rec01);
: end;
: you can create a wrapper method:
: package pack01_wrapper is
: procedure proc01_wrapper (n1 number, d1 date);
: end;
: package body pack01_wrapper is
: procedure proc01_wrapper (n1 number, d1 date) is
: r pack01.rec01;
: begin
: r.n1 := n1;
: r.d1 := d1;
: pack01.proc01;
: end;
: end;
: If you're a 7.3 client, that's about all you can do. The Fix
was
: introduced in 8.0, where new structured types (ADT's) and new
: table types (VARRAY's and Nested tables) were introduced. So
if
: you're an 8.0 client, your 'wrapper' package could use an ADT
: which has the same attributes as the record, rather than
: 'exploding' the record into its individual components as I
showed
: above.
: Hope this helps!
: Pierre
: Thomas Richardson (guest) wrote:
: : Has anyone used sqlj to to call procedures with records and
: : tables as IN, OUT, or INOUT as parameters? If so how do you
: : assign values to the IN parameter in the record/tables, and
get
: : values out of the record/table when it is passed back? Might
: : anyone have any syntax?
: Oracle Technology Network
: http://technet.oracle.com
Oracle Technology Network
http://technet.oracle.com
null

Similar Messages

  • SQLJ calling PL/SQL with records and tables as parameters

    Has anyone used sqlj to to call procedures with records and
    tables as IN, OUT, or INOUT as parameters? If so how do you
    assign values to the IN parameter in the record/tables, and get
    values out of the record/table when it is passed back? Might
    anyone have any syntax?
    null

    One thing I forgot to mention: If you're an 8i client, then in
    8.1.6 you'll be able to use JPublisher to solve this problem,
    since it'll generate these wrappers for you.
    Pierre
    Oracle Product Development Team wrote:
    : Hi,
    : The key issue is that no part of Oracle code except PL/SQL is
    : aware of the PL/SQL Record types and PL/SQL "index-by" table
    : types.
    : So the only way to call a PL/SQL procedure with args of a
    RECORD
    : or "index-by" table types is from another PL/SQL routine.
    : In most cases, it's possible to work-around this by wrappering
    : your PL/SQL method with another which doesn't have this issue.
    : For example, if you're trying to call procedure proc01 in:
    : package pack01 is
    : type rec01 is record(n1 number, d1 date);
    : procedure proc01 (r rec01);
    : end;
    : you can create a wrapper method:
    : package pack01_wrapper is
    : procedure proc01_wrapper (n1 number, d1 date);
    : end;
    : package body pack01_wrapper is
    : procedure proc01_wrapper (n1 number, d1 date) is
    : r pack01.rec01;
    : begin
    : r.n1 := n1;
    : r.d1 := d1;
    : pack01.proc01;
    : end;
    : end;
    : If you're a 7.3 client, that's about all you can do. The Fix
    was
    : introduced in 8.0, where new structured types (ADT's) and new
    : table types (VARRAY's and Nested tables) were introduced. So
    if
    : you're an 8.0 client, your 'wrapper' package could use an ADT
    : which has the same attributes as the record, rather than
    : 'exploding' the record into its individual components as I
    showed
    : above.
    : Hope this helps!
    : Pierre
    : Thomas Richardson (guest) wrote:
    : : Has anyone used sqlj to to call procedures with records and
    : : tables as IN, OUT, or INOUT as parameters? If so how do you
    : : assign values to the IN parameter in the record/tables, and
    get
    : : values out of the record/table when it is passed back? Might
    : : anyone have any syntax?
    : Oracle Technology Network
    : http://technet.oracle.com
    Oracle Technology Network
    http://technet.oracle.com
    null

  • Definitions of record and table type

    I’m confused with the definition of record and table type. Below is my understanding, Please correct me if anything wrong. Thanks in advance!
    Record type can only hold one record with multiple fields.
    Table type is an array (multiple records) with only one field
    Table type defined with %rowtype (table of records) is an array of multiple records with multiple fields.

    I am not sure that I understand what you are asking. I have not heard the term table type before.
    However, I think a record type is more closely aligned to the %rowtype declaration. Maybe a collection is what you are looking for with the term table type.
    From the Oracle 10g documentation:
    %ROWTYPE
    In PL/SQL, records are used to group data. A record consists of a number of related fields in which data values can be stored. The %ROWTYPE attribute provides a record type that represents a row in a table. The record can store an entire row of data selected from the table or fetched from a cursor or cursor variable.
    Columns in a row and corresponding fields in a record have the same names and datatypes. In the example below, you declare a record named dept_rec. Its fields have the same names and datatypes as the columns in the dept table.
    DECLARE
    dept_rec dept%ROWTYPE; -- declare record variable

  • Defining Record and Table Types

    Is there a good tutorial out there somewhere that provides good examples on how to define and work with Record and Table Types? How to define and work with an entire record or table as opposed to just a variable?
    For instance- I'd like to create a cursor of records from a table, loop through each record to examine variable values, and in some instances insert those entire records into another table.
    Thanks in advance for any suggestions.

    Oracle documentation is excellent (Lots of live examples that can be cutNpaste) place to start.
    http://download.oracle.com/docs/cd/B10501_01/appdev.920/a96624/05_colls.htm
    Is there any thing specific you are looking for?
    vr,
    Sudhakar B.

  • Calling Oracle Stored proc with record type and table Type

    I have a oracle SP which takes record type and table Type which are used for order management.
    Is there anay way to populate parameters with these datatypes and call the stored procedure using ODP.NET?
    Please help.
    Thanks in advance

    Hi,
    ODP supports associative arrays and REF Cursors. There is no support for PLSQL table of records.
    Jenny

  • How does a record type and table type works

    Hi,
    How a record type and table type work for the ref cursor,
    below i m giving an example but its giving me errors
    can any one help me for this?
    declare
    type empcurtyp is ref cursor;
    type rectype is record (veid t.emp_id%type, vename t.ename%type);
    TYPE tabtype IS TABLE OF rectype;
    empcv empcurtyp;
    vtab tabtype;
    begin
    open empcv for select emp_id,ename from t;
    loop
    fetch empcv into vtab;
         exit when empcv%notfound;
         dbms_output.put_line(vtab.vename||vtab.veid);
    end loop;
    close empcv;
    end;
    here we hav table t and i m taking only two fields of the table t which r emp_id and ename.

    Hi,
    What errors are you getting with this? From experience you don't need a loop to put the records into the ref cursor its usually done on block.
    HTHS
    L :-)

  • Condition records and tax code combination table

    CAn I know the table where both condition record and tax code stored.

    Hi Jose,
    I think you have quoted the tax procedure table.  There i have not found the tax codes. 
    My requirement is both condition records and tax codes combination table.
    I want to see for which condition type which tax code has been assigned.

  • I HAVE A SOURCE TABLE WITH 10 RECORDS AND TARGET TABLE 15 RECORDS. MY WUESTION IS USING WITH THE TABLE COMPARISON TRANSFORM I WANT TO DELETE UNMATCHED RECORDS FROM THE TARGET TABLE ??

    I HAVE A SOURCE TABLE WITH 10 RECORDS AND TARGET TABLE 15 RECORDS. MY QUESTION IS USING WITH THE TABLE COMPARISON TRANSFORM .I WANT TO DELETE UNMATCHED RECORDS FROM THE TARGET TABLE ?? HOW IT IS ??

    Hi Kishore,
    First identify deleted records by selecting "Detect deleted rows from comparison table" feature in Table Comparison
    Then Use Map Operation with Input row type as "delete" and output row type as "delete" to delete records from target table.

  • Unable to update and delete record in table

    Hello All,
    Kindly help me regarding the below mentioned issue plz
    When I want to update or delete record in table from form developed in 6i give no error message but no action and when I run same form on other system updation and deletion are successfully done.
    Any suggestion

    Hello
    More explanation is as under:
    1. I am working on only one table say A
    2. Wants to update only one row of Table A at one time in single user envoirment.
    3. My form is successfully update some rows as well but not on all rows on one PC while same form able to update all rows on other PC.
    4. I drop the table and re-create the table again but problem persist.
    Any advice plz.

  • How feed many record in table component and not use append command again

    hi master
    How I feed Multiple records in table component and not use append and save command again and again
    Same as oracle grid
    I give many record and save one time
    Please give me idea how I add Multiple record and save one time not use append and save command again and again
    Thank�s
    aamir

    Hi!
    appendRow() method just add temporal row. For add them to DB commitChanges() method should be used. So you can use appendRow() method several times, fill every new row and only then use commitChanges() method. In this case all new rows will be added to DB per one time.
    Thanks,
    Roman.

  • Comparing Two tables with 300k records and update one table

    Could you let me know how to compare two tables having 300k records and update one table.below is the scenario.
    Table Tabl_1 has columns A,B and Tabl_2 has columns B,new_column.
    Column B has same data in both the tables.
    I need to update Tabl_2 in new_column with Tabl_1 A column data by comparing B column in both tables.
    I m trying to do using PLSQL Tables.
    Any suggestion?
    Thanks.

    Hi,
    Whenever you have a problem, please post a little sample data (CREATE TABLE and INSERT statements, relevant columns only) from all tables involved, so that the people who want to help you can re-create the problem and test their ideas.
    Also post the results you want from that data, and an explanation of how you get those results from that data, with specific examples.
    If you're asking about a DML statement, such as UPDATE, the CREATE TABLE and INSERT statements should re-create the tables as they are before the DML, and the results  will be the contents of the changed table(s) when everything is finished.
    Always say which version of Oracle you're using (for example, 11.2.0.2.0).
    See the forum FAQ: https://forums.oracle.com/message/9362002
    ef2019c7-080c-4475-9cf4-2cf1b1057a41 wrote:
    Could you let me know how to compare two tables having 300k records and update one table.below is the scenario.
    Table Tabl_1 has columns A,B and Tabl_2 has columns B,new_column.
    Column B has same data in both the tables.
    I need to update Tabl_2 in new_column with Tabl_1 A column data by comparing B column in both tables.
    I m trying to do using PLSQL Tables.
    Any suggestion?
    Thanks.
    Why are you trying to use PL/SQL tables?  If tabl_1 and tabl_2 are regular database tables, it will be much simpler and faster just to use them.
    Depending on your requirements, you can do an UPDATE or MERGE, either in SQL or in PL/SQL.

  • Get value from table record and set Disabled property...

    Hi! I have table in my JSPX page. I search for records and then press on one of the records with right click, see: http://my.jetscreenshot.com/2677/20120203-fas1-30kb
    I set disabled property like this of my commandMenuItem:
    #{row.GenResGrupa != 'true'}But as You can see from my picture above, the disabled property do not work. Where I am wrong with my code:
    <af:commandMenuItem text="#{sampleBundle.pases}"
                                                  id="commandMenuItem1"
                                                  action="adfMenu_pasesDati"
                                                  actionListener="#{bindings.setCurrentRowWithKeyValue.execute}"
                                                  disabled="#{row.GenResGrupa != 'true'}"/> Please correct me! If You need some other information, please let me know.
    Best regards, Debuger!

    Dear fedor! Popup is in facet contextMenu. contentDelivery="lazyUncached" for my popup:
    <af:popup id="p1" contentDelivery="lazyUncached">
                            <af:menu text="menu 1" id="menu1">
                              <af:commandMenuItem text="#{sampleBundle.pases}"
                                                  id="commandMenuItem1"
                                                  action="adfMenu_pasesDati"
                                                  actionListener="#{bindings.setCurrentRowWithKeyValue.execute}"
                                                  disabled="#{row.bindings.GenResGrupa.inputValue != 'true'}"/>
                            </af:menu>
                          </af:popup>In my pageDef I have this code:
    <bindings>
        <tree IterBinding="LVAIMeklesanaIterator" id="LVAIMeklesana">
          <nodeDefinition DefName="kokaugi.model.view.LVAIMeklesana"
                          Name="LVAIMeklesana0">
            <AttrNames>
              <Item Value="Accename"/>
              <Item Value="LvaiKolekcijaPk"/>
              <Item Value="Accenumb"/>
              <Item Value="AvsGrupa"/>
              <Item Value="Cropname"/>
              <Item Value="EkspGrupa"/>
              <Item Value="GenResGrupa"/>
              <Item Value="Genus"/>
              <Item Value="Species"/>
              <Item Value="Sinonims"/>
            </AttrNames>
          </nodeDefinition>
        </tree>
        <action IterBinding="LVAIKolekcijaDatiIterator"
                id="setCurrentRowWithKeyValue"
                InstanceName="KokaugiModuleDataControl.LVAIKolekcijaDati"
                DataControl="KokaugiModuleDataControl" RequiresUpdateModel="false"
                Action="setCurrentRowWithKeyValue">
          <NamedData NDName="rowKey" NDValue="#{row.LvaiKolekcijaPk}"
                     NDType="java.lang.String"/>
        </action>
      </bindings>And disabled property is like this:
    disabled="#{row.bindings.GenResGrupa.inputValue != 'true'}"But it is still do not working. I am wrong somewhere? Maybe the only way to correct my problem is like Hohn said?
    Best regards, Debuger!

  • I need some working examples with pl/sql records and pl/sql tables.

    i am new to pl/sql tables and pl/sql records. i need some working examples on pl/sql records and pl/sql tables from basics to hoghlevel.how to use then procedures and functions and packages.

    i am new to pl/sql tables and pl/sql records. i need some working examples on pl/sql records and pl/sql tables from basics to hoghlevelThere is no such thing as PL/SQL "+tables+". This is a misnomer and creates the perception that a PL/SQL "table" is somewhat like a SQL table. Nothing can be further from the truth. The correct term is "+collection+" or "+associative array+". Compared to SQL tables, these are very primitive structures, very rigid structures, cannot scale, and can be quite expensive memory wise.
    That is not to say do not use an associative array or collection. These are very useful tools.. but only when applied correctly. Like using a collection for a bulk fetch to transfer more rows between the PL and SQL engines and thus decrease context switching.
    Unfortunately, quite often we see the row-by-row and slow-by-slow approach - where the developer uses SQL as an I/O only layer, pulls rows into expensive PL engine memory into record structures and arrays, and then process the rows there.
    So before looking at working example (even the wrong approach's code will compile and run and work in practice), make sure that you know the fundamentals of correctly using the PL engine and correctly using the SQL engine. And these fundamentals can be summed up into a very basic rule:
    Maximize SQL. Minimize PL/SQL+
    Get this rule right, and you will have a sound foundation for writing performant and scalable Oracle applications.

  • Difference between empty plsql record and null plsql record

    Hi there,
    I am kinda getting confused with empty plsql record and null plsql record.
    How do I assign plsql record to be empty and to be null?
    create type emp_obj as object (enum number, ename varchar2);
    CREATE OR REPLACE TYPE emp_type AS TABLE OF emp_obj;
    Thanks

    First of all, do not use term PL/SQL record in this context. Record type in PL/SQL is completely different from object type. Secondly, there are 2 states of a nested table:
    1. Unintialized:
    SQL> create or replace
      2    type emp_obj_type as object(enum number, ename varchar2(10));
      3  /
    Type created.
    SQL> create or replace
      2    type emp_tbl_type as table of emp_obj_type
      3  /
    Type created.
    SQL> declare
      2      v_emp_tbl emp_tbl_type;
      3  begin
      4      v_emp_tbl.extend;
      5  end;
      6  /
    declare
    ERROR at line 1:
    ORA-06531: Reference to uninitialized collection
    ORA-06512: at line 4
    SQL> 2 Empty:
    SQL> set serveroutput on
    SQL> declare
      2      v_emp_tbl emp_tbl_type := emp_tbl_type();
      3  begin
      4      dbms_output.put_line('Nested table v_emp_tbl has ' || v_emp_tbl.count || ' element(s).');
      5  end;
      6  /
    Nested table v_emp_tbl has 0 element(s).
    PL/SQL procedure successfully completed.
    SQL> NULL aplies to nested table element, not to nested table itself:
    SQL> declare
      2      v_emp_tbl emp_tbl_type := emp_tbl_type();
      3  begin
      4      v_emp_tbl.extend;
      5      if v_emp_tbl(1) is null
      6        then
      7          dbms_output.put_line('Nested table v_emp_tbl first element is NULL.');
      8      end if;
      9  end;
    10  /
    Nested table v_emp_tbl first element is NULL.
    PL/SQL procedure successfully completed.
    SQL> SY.

  • DB Connect DataSource PSA records and DSO records are not matching...

    Dear All,
    I'm working with SAP NetWeaver BW 7.3 and for the first time, I have loaded from Source System DB Connect. I have created a DataSource and pulled all records and found 8,136,559 records in PSA. When I designed and created DSO with Key Fields 0CALDAY, Item No and Company Code, it has transferred records about 8,136,559 and added records about 12,534 only. Similarly following InfoCube has about 12,534 records into its Fact table. When I tried to reconcile the data/records with source DBMS for a month, the records/data could not matched?
    1. What could be the reason behind the issue? why I am unable to load the records/data correctly?
    2. Have I not mentioned the Key Fields of DSO in a correct manner?
    3. Is it possible to load the records/data into DSO without giving any field as Key Fields?
    4. How should I resolve this issue?
    5. Is it could be of DSO Overwrite and summation function utilization if yes, then how to utilize it?
    Many thanks,
    Tariq Ashraf

    Dear Tariq,
    1. What could be the reason behind the issue? why I am unable to load the records/data correctly?
    Ans:  Check transformation once. Is there any start routine you have used or direct assignments. What kind of DTP settings you have done.
    Check the messages at the DTP monitor. You will surely find some clue. Any duplicate records are being detected or not check once if you are using semantic keys in your DTP.
    2. Have I not mentioned the Key Fields of DSO in a correct manner?
    Ans:  The transformation key and the DSo key are they same in your case?
    What kind of DSO is it? Like for sales order DSO you take Order number as a key field., So you have to define the key fields according to business semantics I suppose. Do you agree?
    3. Is it possible to load the records/data into DSO without giving any field as Key Fields?
    Ans:  I dont think so as the keys you defined will help in having unique data records isnot it?
    4. How should I resolve this issue?
    Ans: Please check the above as in Ans:1 please share your observation.
    5. Is it could be of DSO Overwrite and summation function utilization if yes, then how to utilize it?
    Ans: DSO overwriting of key figures is useful when you have full loads in picture. Are you always going to perform full loads ?
    For reference would you like to check this thread:  Data fileds and key fields in DSO
    Lets see what experts give their inputs.
    Thank You...

Maybe you are looking for

  • Please help! Restarted iTunes, all music gone and my backup won't work ...

    Hi, please can anybody help me... I am using iTunes 5.0.1.4 on Windows XP with service pack 2. Today I restarted iTunes and the library is empty. All music gone, all playlists gone. I checked the FAQs and older articles and tried everything (reloadin

  • Error when opening the HFR reports in Studio

    Hi when i am trying to open HFR reports I am getting the Error as '' component 'threed32.ocx' or one of its dependencies not correctly registered:a file is missing or invalid." please help me regarding this. thanks in advance.

  • Updating control record from EXIT_SAPLVEDF_001

    My ultimate goal is to update SNDPRN of the control record with identifier based on the org structure in an IDoc for outbound invoices. Our organizations share the same sold-to records so our EDI subsystem needs a way to distinguish between organizat

  • How to access PL/SQL data types through JDBC

    Hi, We have stored procedures written in PL/SQL. These stored procs take both IN and OUT parameters. The parameter types are both regular datatypes like NUMBER, VARCHAR etc. So far so good. I know how to handle these data types. Some of the stored pr

  • Extremely slow typing in DW8

    Sometimes in Design view, DW 8.0.1 takes almost two seconds to accept each typed character in a 180kB document. I can hardly type a word. How can I make it faster, please?