Insert data into nested tables

Hi,
Can someone please advice how can I insert data into nested tables using APEX.
I have a table "employee" and a column addresses of type address_table_type object which has address1, address2, address3 columns. I want to create form in APEX that will collect address1, address2, address3. I wonder how to do this? should the item be based in database item? if yes then how can I point to the column of address_table_type
Thanks
--Aali                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                           

Can you post your tabB type, sample data, and your exact insert statement?
Is it overwriting or not commiting the inserts?
Have you traced your session to see what is happening?

Similar Messages

  • Inserting Data into nested table

    I am exploring the differences between OBJECT & RECORD.
    As i am still in process of learning, I found that both are structures which basically groups elements of different datatypes or columns of different datatypes, one is used in SQL and other is used in PL/SQL, please correct me if I am wrong in my understanding.
    Below i am trying to insert data into an table of type object but i am unsuccessful can you please help.
    CREATE OR REPLACE type sam as OBJECT
    v1 NUMBER,
    v2 VARCHAR2(20 CHAR)
    ---Nested Table---
    create or replace type t_sam as table of sam;
    --Inserting data----
    insert into table(t_sam) values(sam(10,'Dsouza'));
    Error Message:
    Error starting at line 22 in command:
    insert into table(t_sam) values(sam(10,'Dsouza'))
    Error at Command Line:22 Column:13
    Error report:
    SQL Error: ORA-00903: invalid table name
    00903. 00000 -  "invalid table name"
    *Cause:   
    *Action:

    Ariean wrote:
    So only purpose of equivalent SQL types concept of nested tables is to use them as one of the data types while defining an actual table?
    Sort of - you can definitely use them for more than just "defining an actual table". (I'm fairly certain you could pass a nested table into a procedure, for example - try it, though - I'm not 100% sure on that - it just "makes sense". If you can define a type, you can use it, pass it around, whatever.).
    Ariean wrote:
    And that nested table could be a record in SQL or an Object in PLSQL or just simple datatype(number,varchar etc)?
    Nested tables are just like any other custom data type. You can create a nested table of other data types. You can create a custom data type of nested tables.
    It could get stupidly .. er, stupid O_0
    CREATE TYPE o_myobj1 AS object ( id1   number, cdate1  date );
    CREATE TYPE t_mytype1 AS table of o_myobj1;
    CREATE TYPE o_myobj2 AS object ( id2   number,  dumb  t_mytype1 );
    CREATE TYPE t_dumber AS table of o_myobj2;
    O_0
    Ok, my brain's starting to hurt - I hope you get the idea
    Ariean wrote:
    Secondly is my understanding correct about OBJECT & RECORD?
    I can't think of any benefit of describing it another way.

  • How to insert data into a table only when data has changed its value (when compared to the previous inserted value)

    I wish to insert data into a table only when the value of the inserted data has changed. Thus, in a time series, if the value of the data at time, t-1, is 206 then if the data to be inserted at time t is 206, then it is skipped (not entered).
    If the value of the data at time t+1 is 206, it is skipped also; until the value changes, so if the value at t+1 was 205, then that would be inserted, and if at time t+2 the data is 206, it would be inserted too.
    What is the best way to do it without increasing overheads?

    This view works:
    SELECT
    i.IDNO,i.[Date],i.[Level]
    FROM
    mytable i
    INNER
    JOIN mytable
    d
    ON
    d.IDNO
    = i.IDNO-1
    WHERE
    i.[Level]
    <> d.[Level]
    on this mytable below.  A trigger could be quite useful here although I am cautious using them. However I wish to avoid the overhead by not having a temp table (which could be sizable).  mytable below
    should give 3 lines. The IDNO is an identity column.
    IDNO
    Item
    Date
    Level
    1
    X24
    12/23/13 10:41
    22996
    2
    X24
    12/23/13 10:41
    22996
    3
    X24
    12/23/13 9:21
    23256
    4
    X24
    12/23/13 9:21
    23256
    5
    X24
    12/23/13 9:22
    23256
    6
    X24
    12/23/13 9:22
    23256
    7
    X24
    12/23/13 9:22
    22916

  • How to insert data into a table from an xml document

    using the XmlSql Utility, how do I insert data into a table from an xml document, using the sqlplus prompt.
    if i use the xmlgen.insertXML(....)
    requires a CLOB file, which i dont have, only the xml doc.
    Cant i insert directly from the doc to the table?
    the xmlgen examples I have seen first convert a table to a CLOB xmlString and then insert it into another table.
    Isnt there any other way?

    Your question is little perplexing.
    If you're using XML SQL Utility from
    the commandline, just use putXML.
    java OracleXML putXML
    null

  • How do I run a database procedure that inserts data into a table from withi

    How do I run a database procedure that inserts data into a table from within a Crystal report?
    I'm using CR 2008 with an Oracle 10i database containing a number of database tables, procedures and packages that provide the data for the reports I'm developing for my department.  However, I'd like to know when a particular report is run and by whom.  To do this I have created a database table called Report_Log and an associated procedure called prc_Insert_Entry that inserts a new line in the table each time it's called.  The procedure has 2 imput parameters (Report_Name & Username), the report name is just text and I'd like the username to be the account name of the person logged onto the PC.  How can I call this procedure from within a report when it's run and provide it with the 2 parameters?  I know the procedure works, I just can't figure out how to call it from with a report.
    I'd be grateful for any help.
    Colin

    Hi Colin, 
    Just so I'm clear about what you want: 
    You have a Stored procedure in your report.  When the report runs, you want that same procedure to write to a table called Report_Log. 
    If this is what you want the simple answer is cannot be done.  Crystal's fundamental prupose is to read only, not write.  That being said, there are ways around this. 
    One way is to have a trigger in your database that updates the Report_Log table when the Stored Procedure is executed.  This would be the most efficient.
    The other way would be to have an application run the report and manage the entry. 
    Good luck,
    Brian

  • Error while inserting data into a table.

    Hi All,
      I created a table.While inserting data into the table i am getting an error.Its telling "Create data Processing Function Module".Can any one help me regarding this?
    Thanx in advance
    anirudh

    Hi Anirudh,
      Seems there is already an entry in the Table with the same Primary Key.
    INSERT Statement will give short dump if you try to insert data with same key.
    Why dont you use MODIFY statement to achieve the same.
    Reward points if this Helps.
    Manish

  • Its very urgent:how to insert data into database tables

    Hi All,
    I am very new to oaf.
    I have one requirement data insert into database tables.
    here createPG having data that data insert into one custom table.
    but i dont know how to insert data into database tables.
    i wrote the code in am,co as follows.
    in am i wrote the code:
    public void NewoperationManagerLogic()
    ManagerCustomTableVOImpl vo1=getManagerCustomTableVO1();
    OADBTransaction oadbt=getOADBTransaction();
    if(!vo1.isPreparedForExecution())
    vo1.executeQuery();
    Row row=vo1.createRow();
    vo1.insertRow(row);
    in createPG processrequest co:
    public void processRequest(OAPageContext pageContext, OAWebBean webBean)
    super.processRequest(pageContext, webBean);
    ManagerInformationAMImpl am=(ManagerInformationAMImpl)pageContext.getApplicationModule(webBean);
    am.NewoperationManagerLogic();
    process form request:
    public void processFormRequest(OAPageContext pageContext, OAWebBean webBean)
    super.processFormRequest(pageContext, webBean);
    if(pageContext.getParameter("Submit")!=null)
    ManagerInformationAMImpl am=(ManagerInformationAMImpl)pageContext.getApplicationModule(webBean);
    am.getOADBTransaction().commit();
    please help with an example(sample code).
    its very urgent.
    thanks in advance
    Seshu
    Edited by: its urgent on Dec 25, 2011 9:31 PM

    Hi ,
    1.)You must have to create a EO based on custom table and then VO based on this EO eventually to save the values in DB
    2.) the row.setNewRowState(Row.STATUS_INITIALIZED); is used to set the the status of row as inialized ,this is must required.
    3.) When u will create the VO based on EO the viewattributes will be created in VO which will be assigned to the fields to take care the db handling .
    You must go thtough the lab excercise shipped with you Jdeveloper ,there is a example of Create Employee page ,that will solve your number of doubts.
    Thanks
    Pratap

  • Insert data into multiple tables

    Hi all,
    I've a requirement where i need to insert data into multiple tables using PL/SQL procedure
    Procedure should have two parameters
    1. Table Name (parameter1)
    2. Data (parameter2)
    Based on these two parameters i need to insert data into table (parameter1) using data (parameter2)
    ex:
    Procedure insert_data (p_table  IN VARCHAR2
                          ,p_data   IN -- what should be the datatype?
    IS
    l_statement VARCHAR2(2000);
    BEGIN
    -- insert data into tables
    INSERT INTO p_table
    values (....);
    END insert_data;Thanks in advance!!

    BEDE wrote:
    Amen to that!
    So, I believe a better approach would be the following...
    Suppose you have N datafiles with the same structure, and you wish to insert into the database the data from all those files.
    For that, you should have a single table, named, say incoming_file_data, which should be structured more or less like below:
    create table incoming_file_data (
    filename varchar2(250) not null -- name of the file inserted from
    ,file_time timestamp -- timestamp when the data was inserted
    ,... -- the columns of meaningful data contained in the lines of those files
    );And you will insert the data from all those files in this table, having normally one transaction for each file processed, for otherwise, when shit happens, some file may only get to be partially inserted into the table...
    Maybe one good approach would be to create dynamically an external table for the file to be loaded, and then execute dynamically insert select into the table I said, so that you will have only one insert select for one file instead of using utl_file... RTM on that.If the file structures are the same, and it's just the filename that's changing, I would have a single external table definition, and use the alter table ... location ... statement (through execute immediate) to change the filename(s) as appropriate before querying the data. Of course that's not scalable if there are multiple users intenting to use this, but generally when we talk about importing multiple files, it's a one-user/one-off/once-a-day type of scenario, so multi-user isn't a consideration.

  • Insert data into fact table from source database tables

    here i try to insert data into fact table from source database tables here is the query 
    ALTER procedure [dbo].[facttable]
    as
    insert into [pp dw].dbo.Dimfact(Prod_ID,Production_ID,Material_ID,Equip_ID,WC_ID,Recipe_ID,Quantity,costprice)
    select Products.[Product ID],[Production ID],Materials.[Material ID],[Equipment ID],[Work Centre ID],[Recipy ID],Quantity,[cost price]
    from
    [PRODUCTION PLANNING 2].dbo.[Products],
    [PRODUCTION PLANNING 2].dbo.[Production Detail],
    [PRODUCTION PLANNING 2].dbo.[Material category],
    [PRODUCTION PLANNING 2].dbo.[Materials],
    [PRODUCTION PLANNING 2].dbo.[Equipment],
    [PRODUCTION PLANNING 2].dbo.[Working Centre] ,
    [PRODUCTION PLANNING 2].dbo.[Recipies]
    where
    Products.[Product ID] in (13, 14, 15, 16, 17) and
    [Production Detail].[Production ID] in (1, 2, 3) and
    [Materials].[Material ID] in (1, 2, 3, 4, 5) and
    [Equipment].[Equipment ID] in (1, 2, 3, 4) and
    [Working Centre].[Work Centre ID] in (1, 2, 3) and
    [Recipies].[Recipy ID] in (1, 2, 3) and
    [Material category].[Category ID] in (8, 9, 10, 11, 12, 13)
    and when i execute query it shows me error 
    The INSERT statement conflicted with the FOREIGN KEY constraint "FK_Dimfact_Dimproduct". The conflict occurred in database "pp dw", table "dbo.Dimproduct", column 'Prod_ID'.
    ERD IS
    HOW TO SOLVE THIS PROBLEM?

    I cant see any join conditions in your query posted. Whats the purpose of the query above. It will just bring you a cartesian product (cross join) of tables involved subjected to filters. Are you sure this is the correct query?
    The error you're getting may be because you've not yet populated DimProduct or may be because of logic you used in popultaing DimProduct causing it to miss some records which is what query is referring to in above case.
    Please Mark This As Answer if it solved your issue
    Please Mark This As Helpful if it helps to solve your issue
    Visakh
    My MSDN Page
    My Personal Blog
    My Facebook Page

  • Insert data into linked table

    Problem when you try to insert data into linked table.
    I made the view with all linked table columns (field1 is PK, field2, field3......) plus new primary key field "field1_PK" for tabular form wizard primary key field definition. After submit data on tabular form appears:
    "Error in mru internal routine:ORA-2001:Error in MRU: row=1,ORA-00957: duplicate column name ORA-02063:preciding line from "SHEMA_NAME", insert into "field1","field1_PK","field3",........) values (:b1,:b2,:b3.........)
    Error Unable to process update.
    Is it bug too?

    Hi,
    Have you tried to do your updates using an INSTEAD OF TRIGGER on your view? An INSTEAD OF TRIGGER allows you to update a non-updateable view.
    The following book contains an excellent introduction to this topic.
    "Oracle PL/SQL for Dummies"
    written by Rosenblum and Dorsey
    published by Wiley Publishing Inc.
    The following book is also excellant reference that deals with INSTEAD OF TRIGGERS.
    "Oracle PL/SQL programming
    written by Steven Feuerstein
    published by O'Reilly
    Hope this helps.
    Cheers,
    Patrick Cimolini

  • Insert data into oracle table from XML file

    I need to insert data into oracle table from XML file
    If anybody handled this type of scenario, Please let me know how to insert data into oracle table from XML file
    Thanks in advance

    The XML DB forum provides the best support for XML topics related to Oracle.
    Here's the FAQ on that forum:
    XML DB FAQ
    where there are plenty of examples of shredding XML into Oracle tables and such like. ;)

  • How to insert data into two tables at once using XSJS

    Hello Experts,
    My requirement is to insert data into two tables at once. I have a XS JS app and want to update these tables via xsjs. How can I do this ?
    Is there any mechanism like sql 'transactions' also in Hana ? If yes, how can I call it via xsjs ? If not, what are the ways to populate two different tables at once.
    Please advice. Any help is really appreciated.
    Thanks !

    There is nothing special about inserting into two tables at once in XSJS. Just issue two separate SQL Statements.  Don't execute the COMMIT until after both commands.  That way they are all one transaction.

  • Inserting data into multiple tables in jdbc

    I am doing on file to jdbc. Now I got a requirement to insert data into multiple tables on the receiver side. How can I do this ?

    Hi,
    you are going to insert data into 4 tables in a sequence one after another , I see three options.
    1) Stored procedure and 2) creating 4 statement data structure (one for each table)
    The third option is writing a SQL with join for the 4 tables and use action command = SQL_DML. Example as follows....
    Write SQL code and place it in access tag. Pass values for the columns using key tag...
    <stmt>
        <Customers action="SQL_DML">
          <access> UPDATE Customers SET CompanyName=u2019$NAME$u2019, Address=u2019$ADDRESS$' WHERE CustomerID='$KEYFIELD$u2019
          </access>
          <key>
            <NAME>name</NAME>
            <ADDRESS>add </ADDRESS>
            <KEYFIELD>1</KEYFIELD>
          </key>
        </Customers>
      </stmt>
    Refer this http://help.sap.com/saphelp_nwpi71/helpdata/en/44/7b7855fde93673e10000000a114a6b/content.htm
    Hope this helps ....

  • How to insert date into a table by selecting form sysdate

    Hi
    My Table format is like this
    SQL>desc log;
    Name Null? Type
    EMP_ID VARCHAR2(30)
    LOGIN DATE
    LOGOUT DATE
    now when ever an employee logs in i w'd like to insert date into the table.
    i put up the following query
    SQL> insert into log(emp_id,login)
    2 values
    3 ('Ed_01',
    4 select
    5 sysdate
    6 from dual
    7 );
    select
    ERROR at line 4:
    ORA-00936: missing expression
    I got the above error how can i rectify that plz suggest me very urgently as i have to submit my project very early to my boss.

    try this :
    insert into log(emp_id,login) values ('Ed_01', sysdate);

  • Insert data into a table without identity column

    Hi,
    I need to insert data into a table using data flow task. Unfortunately this table's priamry key column (integer column) is not identity column.  I am looking a way to get the primary key value for the new records. Please advice. Thanks

    Phil has a great post on generating surrogate keys in SSIS: http://www.ssistalk.com/2007/02/20/generating-surrogate-keys/

Maybe you are looking for