How to insert data in nested ref table

hi i am having some problems i am trying to insert data into a table that has a ref and is nested can some one please help me.
Now this is the problem tring to insert data in manfs when it is already a ref and a nested table
Can someone please tell me the correct way to insert data
via Home>SQL>SQL Commands or another way if easier.
INSERT INTO TABLE (
SELECT c.CustName
FROM Customer_objtab c
WHERE c.CustName = 'Edward Teach'
VALUES (1,
BeerTableType(
BeerType2(‘pride’,’ale’,’yellow’),
below are the other tables i have created so far;
----------------------This is my tbale-------------------------
CREATE TYPE Customer_objtyp AS OBJECT (
CustNo NUMBER,
CustName VARCHAR2(200),
Address_obj Address_objtyp,
PhoneList_var PhoneList_vartyp,
) NOT FINAL;
------------------this is my subtype of customer----------------------
CREATE TYPE Corp_Customer_objtyp UNDER Customer_objtyp
(account_mgr_id NUMBER(6) ) NOT FINAL;
CREATE TYPE BeerType2 AS OBJECT (
nameCHAR(20),
kindCHAR(10),
colourCHAR(10));
CREATE TYPE BeerTableTypeAS
TABLE OF BeerType2;
CREATE TABLE manfs(
age number,
Cust_ref REF Customer_objtyp,
beers BeerTableType,
copy number)
NESTED TABLE beers STORE AS BeerTable;

Dear user!
Please modify your code like that:
CREATE TYPE Customer_objtyp AS OBJECT (
CustNo NUMBER,
CustName VARCHAR2(200),
Address_obj Address_objtyp,
PhoneList_var PhoneList_vartyp,
) NOT FINAL;
CREATE TYPE Corp_Customer_objtyp UNDER Customer_objtyp
(account_mgr_id NUMBER(6) ) NOT FINAL;
CREATE TYPE BeerType2 AS OBJECT (
name CHAR(20),
kind CHAR(10),
colour CHAR(10));
CREATE TYPE BeerTableTypeAS
TABLE OF BeerType2;
CREATE TABLE manfs(
age number,
Cust_ref REF Customer_objtyp,
beers BeerTableType,
copy number)
NESTED TABLE beers STORE AS BeerTable;
-- This is new --
CREATE TABLE Customer_objtyp_table OF Customer_objtyp;
-- Now try the following insert --
INSERT INTO manfs
VALUES (10,
        (SELECT REF(co) FROM Customer_objtyp_table co WHERE co.CustNo = 1),
        BeerTableType(BeerType2('pride','ale','yellow')),
        1)I hope this will give you an example of how to use REF and Nested tables.
Yours sincerely
Florian W.

Similar Messages

  • How to insert data into the mysql table by giving as a text file

    Hi,
    Any one know's how to insert data into the mysql table by giving as a text file as the input in JSP.Please respond ASAP.
    Thanks:)

    At least you can try StringTokenizer to parse your text files. Or download a text JDBC driver to parse your files, for instance, HXTT Text(www.hxtt.net) or StelsCSV(www.csv-jdbc.com).

  • How to insert  data from different internal  table  into a data base table

    hi all,
             I want to insert a particular field in an internal table to a field in a data base table.Note that the fields in the internal table and database table are not of the same name since i need to insert data from different internal tables.can some one tell me how to do this?
    in short i want to do something like the foll:
    INSERT  INTO ZMIS_CODES-CODE VALUE '1'.
    *INSERT INTO ZMIS_CODES-COL1 VALUE DATA_MTD-AUFNR .(zmis_codes is the db table and data_mtd is the int.table)

    REPORT  ZINSERT.
    tables kna1.
    data: itab LIKE KNA1.
    data lv_kUNAG LIKE KNA1-KUNNR.
    lv_kuNAG =  '0000010223'.
    ITAB-kuNNR = lv_kuNAG.
    ITAB-name1 = 'XYZ'.
    INSERT INTO KNA1 VALUES ITAB.
    IF SY-SUBRC = 0.
    WRITE:/ 'SUCCESS'.
    ELSE.
    WRITE:/ 'FAILED'.
    ENDIF.
    Here lv_kunag is ref to kna1 kunnr passed in different name
    In internal table .
    Try and let me know if this logic dint work.

  • How to insert data from file to table??

    I need to know that how can i insert data in multiple column through file. I can simply insert data in one column table but couldnt find out the way to put data in all column.
    My data store in a file
    ************************************************text.txt***************
    133, shailendra, nagina, 14/H, 45637, 9156729863
    **************************************************************my_data(table)**********
    trying to insert into below table...
    id, name, last_name, add, pin. mob
    Let me know if anything else needed..:)

    Hi Shailendra,
    Actually, in SQL Developer, you can open a connection to the target schema, right-click on the Tables node in the navigator tree view, select Import Data, then use the Data Import Wizard. It is extremely flexible. It looks like you have a comma separated variable file, so if you select Format: csv and Import Method: insert it will probably work just fine.
    To minimize the chance of errors during import, pick a preview limit value so the wizard can examine the size and data type of all columns in as many data rows as possible, then review the data type/size for each column in the next wizard page and override as necessary. For date columns it is also important to choose the appropriate format mask.
    Hope this helps,
    Gary
    SQL Developer Team

  • How to Insert data from notepad to Table

    Hi,
    I have one table with nodata.i need to insert data into table.but i have records in one notepad.if i enter manually
    like using insert statement it will take more time.
    Any one know insert data from notepad to table or i need sql script that will use for all the records.Here im using sqldeveloper.

    Hi dude,
    We can use below 2 types.
    1) Sql loader
    2) utl file
    SQL*Loader utility?
    One can load data into an Oracle database by using the sqlldr (sqlload on some platforms) utility. Invoke the utility without arguments to get a list of available parameters. Look at the following example:
    sqlldr username@server/password control=loader.ctl
    sqlldr username/password@server control=loader.ctlThis sample control file (loader.ctl) will load an external data file containing delimited data:
    load data
    infile 'c:\data\mydata.csv'
    into table emp
    fields terminated by "," optionally enclosed by '"'           
    ( empno, empname, sal, deptno )
    {code}
    The mydata.csv file may look like this:
    {code}
    10001,"Scott Tiger", 1000, 40
    10002,"Frank Naude", 500, 20
    {code}
    Optionally, you can work with tabulation delimited files by using one of the following syntaxes:
    {code}
    fields terminated by "\t"
    fields terminated by X'09'
    {code}
    Additionally, if your file was in Unicode, you could make the following addition.
    {code}
    load data
    CHARACTERSET UTF16
    infile 'c:\data\mydata.csv'
    into table emp
    fields terminated by "," optionally enclosed by '"'           
    ( empno, empname, sal, deptno )Another Sample control file with in-line data formatted as fix length records. The trick is to specify "*" as the name of the data file, and use BEGINDATA to start the data section in the control file:
    load data
    infile *
    replace
    into table departments
    (  dept     position (02:05) char(4),
        deptname position (08:27) char(20)
    begindata
    COSC  COMPUTER SCIENCE
    ENGL  ENGLISH LITERATURE
    MATH  MATHEMATICS
    POLY  POLITICAL SCIENCEPlease refer the below link.. it will useful for you.
    http://psoug.org/reference/sqlloader.html
    http://docs.oracle.com/cd/B10500_01/server.920/a96652/ch05.htm
    Regards,
    N.Senthil.

  • How to insert data in to database table depends on Indicator

    Hi All,
    I am working on Idoc to JDBC scenario. I am collecting & bundling(Using BPM) all the idocs and inserting the data in to the different database tables. Up to now my scenario is working fine. Now the problem is before inserting the data I have to check one of the Table field. If the field indicator is u201CYESu201D then only I have to insert data otherwise I have to wait up to the indicator field needs to be changed. Once indicator is u201CYESu201D then I have to insert all the collected idocs in to the database tables.
             Can you please let me know how can I achieve this?
    Thanks & Regards,
    Purushotham

    Hi,
    There are two ways you can achieve this.
    1. Instead of directly calling SQL statements write a stored procedure on database which will have first select query and then based on its result fire the insert query.For processing any logic like this stored procedure is the best approach. You can call SP from your jdbc receiver channel
    2. By using a BPM. In this case you have to first fire a select query in the database and based on the response from database, fire the insert statement from bpm only. basically you will be having 2 send steps to database. One with Select statement and another with insert statement. You need to handle your logic in BPOM in this case.
    Hope this answers your question.
    Thanks
    Amit

  • How  to  insert data into custom database table from an hcsf

    i want to insert data into database table that i have created from an hcsf.
    example :
    say i have created a table in oracle database and i hav created a hcsf file.now i want that when somebody fills in that hcsf and click submit ,i want that entries should be updated in my database table.
    plzzz reply ASAP(it's urgent)

    you'll need a bit of Java code... extract the data during a check-in filter, and insert it into the database.
    check out the "DataAccess" component in the HowToComponents for query-running examples, and the "DynamicPrefix" component for a check-in filter example.
    I have older copies here:
    http://bezzotech.com/library

  • How to insert data into the existin table dynamically

    Hi All....
    Iam creating the table dynamically(on the fly) if the the table already exist in the database then the data should be inserted. though the table is created dynamically we dont know the columns of the table.. how i can solve the issue.. pls help me

    This will create your table and also data will be inserted. Use execute immediate.
    CREATE TABLE Table_name AS <Query to fetch data>

  • How to fetch data from nested internal table

    Hi,
    Im using FM CRM_PRODUCT_GETDETAIL_API which is returning me work area (ES_PRODUCT_DATA) of type
    COMT_PRODUCT_MAINTAIN_API. This work area contains a table SHORT_TEXTS of type COMT_PR_SHTEXT_MAINTAIN_TAB
    whcih in turn contain a line type DATA of type COMT_PRSHTEXT_X. I need to fetch fields lying inside DATA. Can anybody please
    let me know how to achieve this. I would like to do this by not using nested loop structure.
    Rgds
    Sudhanshu Sharma

    Hi,
    Use field ES_PRODUCT_DATA-short_texts like any other internal table (without header line).
    E.g.:
    field-symbols: <text> type COMT_PRSHTEXT_X.
    loop at ES_PRODUCT_DATA-short_texts assigning <text>.
            write: <text>-short_text
    endloop.
    Regards, Gerd Rother

  • How to Insert Data in Ztable Using table Control

    Hi All,
      Please give some ideas of how to store the data from table control into the ztable database.
    There is a table control in which the end user enters the data manually and clicks the save button. Then, the data from the table control will go and store in the ztable.
    regards
    Vicky Kumar

    Hi Vicky,
    are you talking about ABAP transaction SE11 or about creating tables in the SAP HANA directly, i.e. in the HANA Modeler perspective?
    Cheers,
      Jasmin

  • How to insert date with timestamp into table values

    hi,
    I have a table
    create table abc1(dob date);
    insert into abc1 values (to_date(sysdate,'RRRR/MM/DD HH24:MI:SS'))
    but when i see in data base it shows as normal date without time stamp.
    Is it possible to insert into back end with timestamp.
    Thanks..

    First, SYSDATE is a DATE already, no need to convert it to a DATE using the TO_DATE() function.
    The date ALWAYS has a time component, whether or not it is displayed is up to your NLS settings. for example:
    SQL> CREATE TABLE ABC1(DOB DATE);
    Table created.
    SQL> ALTER SESSION SET NLS_DATE_FORMAT='MM/DD/YYYY';
    Session altered.
    SQL> INSERT INTO ABC1 VALUES(SYSDATE);
    1 row created.
    SQL> SELECT * FROM ABC1;
    DOB
    02/04/2010
    SQL> ALTER SESSION SET NLS_DATE_FORMAT='MM/DD/YYYY HH24:MI:SS';
    Session altered.
    SQL> SELECT * FROM ABC1;
    DOB
    02/04/2010 12:54:57
    SQL> DROP TABLE ABC1;
    Table dropped.

  • How to insert data in table UI elements

    Hi Guys,
    Here is my questions. How to insert data in table UI elements.
    Here i try to insert data by using Add button
    data:
        Node_Item                           type ref to If_Wd_Context_Node.
        Node_Item = wd_comp_controller->get_data_node( ).
      data:
        lr_table_line type ref to ITEM.
       lr_table_line = Node_Item->create_element( ).
      field-symbols:
        <ls_table> type any.
      assign lr_table_line->* to <ls_table>.
      Node_Item->bind_element(
        new_item             = <ls_table>
        set_initial_elements = abap_false
        index                = 1 ).
    But i got syntax error the result type of the function method cannot not be converted in to the type of lr_table_line.
    And i set cardinality and selection as 0.n.
    Pls, let me know for the soulutions
    Chandru
    Message was edited by:
            chandrasekar muthuvelraj

    Chadru, another option is for you to bind the table UI field to an internal table and to populate the internal table. Then, automatically, your Table UI field will be populated with the data from the internal table. Here is the code that does that and works for me.  Good luck!
    method FILL_DATA .
    DATA: node_level1 type ref to if_wd_context_node,
          node_level2 type ref to if_wd_context_node,
          node_items type ref to if_wd_context_node,
          stru_ResItems type BAPI2093_RES_ITEM,
          tab_ResItems TYPE TABLE OF BAPI2093_RES_ITEM,
          n type i.
    node_level1 = wd_context->get_child_node( name = 'BAPI_RESERVATION_CRE' ).
    node_level2 = node_level1->get_child_node( name = 'CHANGING' ).
    node_items = node_level2->get_child_node( name = 'RESERVATIONITEMS' ).
    n = 2.
      do n times.
        insert stru_ResItems into table tab_ResItems.
      enddo.
    node_items->bind_table( tab_ResItems ).
    endmethod.

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

  • *Urgent*How to insert data from MS SQL to the table that create at the adobe form?

    Hi,
    I'm using Adobe life cycle designer 8 to do my interactive form. I would like to ask how to insert data from MS SQL to the table that i have created in my adobe interactive form?
    I really need the information ASAP as i need to hand in my project by next week... i really appreciate any one who reply this post.
    Thanks

    Tou need to do a couple of things
    1. On the Essbase server, set up an odbc system connection to your MySQL database
    2. In the load rule , go to the file menu and select open SQL data source and in the data source put in your SQL statement . A couple of hints. Where it says Select, don't put in the word select and where it say from don't put in from. The system adds them for you. The easiest way ti enter a SQL statement is to do it all in the select area So if your SQL would normanlly say select * from mytable just enter the code as * from mytable in the select area
    The click ol/retrieve and enter in your connection info. Itshould bring data back into the load rule. Save the load rule and use it

  • 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

Maybe you are looking for