Insert some values into multiple tables. One of the tables has a complex primary key.

Hello, I am using Jdeveloper version 11.1.2.3.0

I have a FORM_TYPE table and another table Str. The table of Str is used to translate the strings from the name of the table which are read from another program from the database and used to generate forms...

The FORM_TYPE table has a relationship with the table of STR via formtype.title_str_id = str.str_id.

STR. table has a primary key which is based on the mf_language and str_id. columns I generated the entity for the table of STR, but impossible to insert new values of add-on application for some reason any... It is said that recording invalidates its own entity...

I am trying to create a table that will be editable and will have the column Description, name, cdes in English, Str in French etc...

To create a Form_Type and at the same time insert new values for each language. But can not do the inserts of the new work of STR...

Also the FormType.TITLE_STR_ID already has a lot of null values in the database.

SELECT FormType.DESCRIPTION,

FormType.FORM_TYPE_ID,

FormType.NAME,

FormType.PAPER_REPORT_FORMAT,

FormType.PAPER_REPORT_NAME,

FormType.TITLE_STR_ID,

in. En_str str,

in. STR_ID,

en.object_name en_object_name,

Fr. Str,

Fr. STR_ID,

Fr.object_name,

of the. Str,

of the. STR_ID,

du.object_name,

BG.Str,

BG. STR_ID,

BG.object_name

OF FORM_TYPE FormType.

(select str.str_id, str.mf_language_id, str.str, str.object_name

of mf_language ml, str

where ml.mf_language_id = str.mf_language_id

and ml.code = 'fr') en

(select str.str_id, str.str, str.object_name

of mf_language ml, str

where ml.mf_language_id = str.mf_language_id

and ml.code = 'fr') en,.

(select str.str_id, str.str, str.object_name

of mf_language ml, str

where ml.mf_language_id = str.mf_language_id

and ml.code = 'from'),

(select str.str_id, str.str, str.object_name

of mf_language ml, str

where ml.mf_language_id = str.mf_language_id

and ml.code = 'bg') bg

WHERE

FormType.title_str_id = en.str_id and

FormType.title_str_id = fr.str_id and

FormType.title_str_id = du.str_id and

FormType.title_str_id = bg.str_id

Each table that you want to update must have its own entity object. You need to connect it to an another VO/OS using the associations/view links

Tags: Java

Similar Questions

  • Insert some values into the database of field boxes




    I had a similar probem and error when you use the drop-down list instead of a checkbox. It was solved by putting the SELECT name = "CarMake in the menu dropdown.

    But in the box, I don't know?
    I seem that the problem is the action page has the Form.carmake, but the page does not work. What Miss me and where should I put in the entry below page.


    The main objective is to have checked checkboxes to insert some values into the database field carmake based on what is checked.


    If the Honda checkbox is checked then
    It inserts into the carmake field value Honda.

    If the Toyota checkbox is checked then
    It inserts into the carmake field the value of Toyota.

    If both are true then 2 rows are inserted two values
    Honda and Toyota.

    Ditto for the last option.

    Thanks for your help


    Here's the error again

    error:
    Error occurred while processing request
    CARMAKE element is not defined in the FORM.

    12:21:50.050 - term Exception - in C:\CFusionMX7\wwwroot\Author\CarAddAction.cfm: line 16
    CARMAKE element is not defined in the FORM.

    line 16 is:
    "#Trim (Form.carmake), #
    Join the Code


    <! - Here is the form - >
    < html >
    < head >
    < / head >

    < body >


    < h1 > < / h1 >

    < table >
    < action = "CarAddAction.cfm cfform" method = "POST" > "
    < b >
    < td > Honda: < table >
    < td > < Center > < input type = "checkbox" name = "HONDA_MODEL" value = "HONDA" checked > < / center > < table >
    < /tr >
    < b >
    < td > Toyota: < table >
    < td > < Center > < input type = "checkbox" name = "Toyota_MODEL" value = "Toyota" Unchecked > < / center > < table >
    < /tr >
    < b >
    < td > SUBARU: < table >
    < td > < Center > < input type = "checkbox" name = "SUBARU_MODEL" value = "SUBARU" unchecked > < / center > < table >
    < /tr >



    < Tr > < td > < table > Honda model
    < td >
    < input type = "Text".
    name = "Honda_Model".
    Value =""
    size = "22".
    MaxLength = "20" >
    < table >
    < tr > < /tr >
    < Tr > < td > < table > Toyota model
    < td >
    < input type = "Text".
    name = "Toyota_Model".
    Value =""
    size = "22" >
    < table >
    < tr > < /tr >
    < Tr > < td > < table > Subaru model
    < td >
    < input type = "Text".
    name = "Subaru_Model".
    Value =""
    size = "22" >
    < table >
    < tr > < /tr >
    < td > < table >
    < td >
    < input type is 'submit' value is "Take Add to database" >
    < table >
    < /tr >

    < / cfform >
    < /table >

    < / body >
    < / html >



    <!-action page
    --------->
    < cfdump var = "#form #" >
    < name cfquery = "InsertCarInfo."
    DataSource = "#request. MainDSN #">"
    INSERT INTO Car_tab)
    car_Make,
    Honda_Model,
    Toyota_Model,
    Subaru_Model

    )
    VALUES)

    "#Trim (Form.carmake), #
    "#Trim (Form.Honda_Model), #
    "#Trim (Form.Toyota_Model), #
    "#Trim (Form.Subaru_Model) #
    )
    < / cfquery >

    You check in one or more of the boxes before continuing? Remember what I said about the form field box existing only on the page of treatment at least 1 or more checkboxes are checked on your form. Make sure you use to avoid this problem.

    What happens when you take a look at the output of your dump of form? Your fields are present?

  • Insert some values into the type defined by the user in the table column?

    Hello

    I've created a type

    CREATE TYPE COURSE_OBJ1 AS OBJECT)
    course_code char (8),
    course_name varchar (35)
    );

    Then set up a table with the type as one of the columns

    CREATE TABLE NEW_COURSE1)
    course COURSE_OBJ1,
    date of course_date,
    course_instructor varchar (35),
    course_location varchar (20)
    );

    Now, it makes me error: column not allowed here

    INSERT INTO NEW_COURSE1 (courses, course_date, course_instructor, course_location)
    VALUES (course ('DBA12345', '101 S/n'), October 3, 2005, "Phung',"Kaanapali")

    Can someone show me please the correct way to insert these data? He's not from another table. This is a file txt nothing else than values.

    Thank you

    You created type COURSE_OBJ1, but in the instructions wrote courses("DBA12345",'s / n 101')
    (1) course replace ('DBA12345', '101 S/n') COURSE_OBJ1 ('DBA12345','s / n 101')
    (2) add citations to 3 October 2005 or replace to 'to_date('03-OCT-2005','dd-mon-yyyy') '.

    INSERT INTO NEW_COURSE1(course, course_date, course_instructor, course_location)
    VALUES(COURSE_OBJ1('DBA12345', 'DBA 101'), to_date('03-OCT-2005','dd-mon-yyyy'), 'Phung', 'Kaanapali');
    

    Kind regards
    Sayan M.

  • The most effective way to insert form data into multiple tables and w/autonum

    Hi all, this is my first post here. I am new to APEX and PL/SQL. I have ColdFusion and SQL, and I'm used to perform CRUD operations in my CF Tags application files. From what I've read so far, so if this is accurate, it seems that it is more efficient to perform most of the CRUD operations on the database side, I hope that for advice on the best way to accomplish what I ask - even if I'm trying to do is better off in my new APEX application I am open to this information as well.

    I have a form whose data must reside in two tables. Table A is a one-to-one relationship table and stores General information for each request. Table B is a table of one-to-many observations and should store unique records for each type of comment entered on the form, of which there are 3 comment fields on the form, I'd end up with 3 disks in table B for 1 in table A. I am generating an AutoNumber for table A with a sequence and relaxation. I want to do is take the AutoNumber I just created and use it for insertion in the Table B each insertion I have to do. This is where I am stuck.

    I would like to comment on 1) where I should put all these operations and 2) how best to go about what I want to do coding. In ColdFusion, it is as simple as inserting the record in Table A, immediately asking to table A more recent recording and storing (auto) ID in a variable and then using this var for any other table insertions, I had to do. I know it must be at least a little easier in the Oracle world, I just need a nudge in the right direction. Thank you!

    OraclePledge,

    You're pretty close to not having worked with oracle a lot.

    This section is backwards:

    insert into sch.tbl_main(cust_lname,cust_fname,acct_num)
    values(:P3_CUST_LNAME,:P3_CUST_FNAME,:P3_ACCT_NUM);
    
    select "SCH"."TBL_MAIN_SEQ".currval
          into
          v_ID
          from dual;
    

    Even if it will work if you only have a single user, it's a potential bug with two or more users. First select the key (if it's first use nextval rather than currval) can use it in the insert statement.

    See you soon,.
    Janet Tyson

    Published by: Tyson Janet on June 23, 2011 10:48

  • table has index of primary key twice?

    I have the same column with the same name in the index twice on a table.  How can this be?

    SQL > select TABLE_name, COLUMN_NAME, INDEX_NAME and dba_ind_columns position_colonne

    2 where table_name = 'CLM_DET_FLD_ERR '.

    3 order of position_colonne;

    COLUMN_NAME POSITION_COLONNE INDEX_NAME TABLE_NAME

    ------------------------------ ------------------------------ ------------------------- ---------------

    CLM_DET_FLD_ERR PK_CLM_DET_FLD_ERR CLM_DET_FLD_ERR_SID 1

    CLM_DET_FLD_ERR PK_CLM_DET_FLD_ERR CLM_DET_FLD_ERR_SID 1

    CLM_DET_FLD_ERR N01_CLM_DET_FLD_ERR ERR_CD 1

    Select dba_indexes table_name, index_name, UNIQUENESS, LAST_ANALYZED

    where table_name = 'CLM_DET_FLD_ERR ';

    INDEX_NAME UNIQUENES STATUS LAST_ANALYZED

    ------------------------------ --------- -------- --------------------

    PK_CLM_DET_FLD_ERR UNIQUE VALID March 29, 2009 09:37:50

    PK_CLM_DET_FLD_ERR UNIQUE VALID March 26, 2015 19:54:38

    Non-UNIQUE N01_CLM_DET_FLD_ERR VALID March 26, 2015 19:54:38

    Probably because there is more than ONE user with this table in the schema.

    Add INDEX_OWNER and TABLE_OWNER this request and see who HAS these columns.

  • Gears - error when you try to insert values into a table with multiple columns

    Hello

    I started playing with the gears and SQlLite today and I get an error when I try to insert values into a table with multiple columns.

    I have:

    var db = google.gears.factory.create('beta.database');
        db.open('developerSet');
        db.execute('create table if not exists Developers (DeveloperName text, DeveloperAge int)');
    
        var devName = "Davy"
        var devAge = 32;
    
        try {
            db.execute('insert into Developers values (?, ?)', [devName, devAge]);
            alert('success');
        }
        catch (e) {
            alert(e);
        }
    

    I get the error:

    net.rim.device.api.database.DatabaseException; insert into developers values (?,?): SQL logic error or missing database.

    I use this reference: http://code.google.com/apis/gears/api_database.html

    Everything works if I have only one field as:

    var db = google.gears.factory.create('beta.database');
        db.open('developerSet');
        db.execute('create table if not exists Developers (DeveloperName text)');
    
        var devName = "Davy"
        var devAge = 32;
    
        try {
            db.execute('insert into Developers values (?)', [devName]);
            alert('success');
        }
        catch (e) {
            alert(e);
        }
    

    I use the plug-in Visual Studio 2.0 for 2008 that are running Windows XP SP and Simulator 2.13.0.56

    Thank you

    Davy

    Yes, a SQLite database will persist between battery pulls.  The database is registered either to internal MEM or removable media (not the device memory), depending on which is available on your device.

    In general, its not considered a best practice to remove your table as soon as it is empty and re - create it again when you want to add data.  This adds extra overhead fresh for the final, delete and insert first for a given table.  Instead, define and finalize your drawing before you create your table.  Once created, review the static schema.

    That being said, for development purposes, it may be easier to provide an easy way to drop your tables while you develop your schema.

    See you soon,.

    Adam

  • table name not valid error when inserting values into a table

    I use the following statement to insert values into a table:

    curs. Execute ("INSERT INTO _ * '%s' * _ VALUES ((SELECT MAX (REC_ID) + 1 OF GSAP_MSG_IN), (SELECT MAX (gsap_msg_id) + 1 OF GSAP_MSG_IN), 'SHELLSAP', sysdate, '%s', EMPTY_BLOB(), 1, SYSDATE, EMPTY_BLOB (), SYSDATE)" %(*table_name*,file_extension)) ")

    whence table_name the following statement

    table_name = ' config.staging_db_tablesNames ['in_msgs]

    as I created a configuration file for all parameters that can change. The value of the table in the audit using a print command is correctly, but when put in the query above to run the insert statement gives an error. The following is the summary of comprehensive performance where you can see the table name as

    $ python gsapscnr.py
    Vote for the data files in/home/mh/inbox /...

    GSAP_MSG_IN
    Traceback (most recent call changed):
    File "gsapscnr.py", line 147, in it?
    poll_for_data()
    File "gsapscnr.py", line 86, in poll_for_data
    Sorter = load_details_first)
    File "gsapscnr.py", line 42, survey
    curs. Execute ("INSERT INTO '%s' VALUES ((SELECT MAX (REC_ID) + 1 OF GSAP_MSG_IN), (SELECT MAX (gsap_msg_id) + 1 OF GSAP_MSG_IN), 'SHELLSAP', sysdate, '%s', EMPTY_BLOB(), 1, SYSDATE, EMPTY_BLOB (), SYSDATE)" %(table_name,file_extension)) ")
    cx_Oracle.DatabaseError: ORA-00903: invalid table name

    Can anyone help with this problem please. I'm passing the value of the table in a bad way. Also if anyone can suggest a good tutorial for paythong programming using cx_Oracle.

    Concerning

    Print the SQL string that you establish, cut and paste it this output in SQL * more and see if it runs. This may show you that you should remove the single quotes around the name of the table %s in the Python file.

  • Impossible to insert a record into a table

    Hello

    I was working on a procedure in which I had to insert 1,00,000 records each in 3 tables. But the process stopped after inserting 56000 records.
    After that I ran the query again, but now it is not insert a single record.

    I just created a fictitious table

    create the table vinod1 (no number);

    and I tried to insert a value by using

    insert into vinod1 values (100);

    But to my surprised the query has executed since the past 10 years and has not inserted a line.

    I also tried on SQLPLUS and I use oracle 10g


    Can you please help me and explain why I'm unable to insert the same if I am able to create the table.


    Thank you
    -Vinod

    are you using an option can be REPLICATED in your session, also what is the quota given to the user on the tablespace. The storage space that you used to create the table.

  • Could not use DB function call to insert a row into a table OBIEE

    Hello

    At the prompt of the OBIEE report, I create a DB function in a variable column of the guest, so whenever I'm in the dropdown variable ob column call the function DB call.

    The function call is insert a row into a table in the database. However, it seems impossible to insert the row into the table.

    I have test the function in the sqlplus and it works, if the function has no problem. The problem is OBIEE failed to insert something in the datebase, it can only read from it.

    Any ideas on how I could fix it?

    Thank you!

    Hello
    Use your Evaluate function and the variable correctly. In the case where u called this function evaluate in the report in a column, and he has 100 files it contains, it will call db 100 times.

    Kind regards
    Anitha.B

  • How to load the values into a table?

    In my jspx page, I have a combo and a table... Based on the values of the drop-down list, when I click on a button, I want to load the values into a table... The data in the table are from 5 database tables. I created a viewObject readonly... What to do to load the values from the table, I click on a button?

    Ensure that you have defined a variable to bind your view object.

    Read-only or not, this is what would make the Execute with action of parameters available.

    John

  • HP Officejet 4500 G510g: "at least one of the cartridges has a problem"

    My printer has been works well, but all of a sudden last week the message came saying "at least one of the cartridges has a problem", so I took the two cartridges to fill them. I discovered they were already full so it wasn't the problem. I was instructed to turn off and unplug the printer, I did several times and still nothing. I bought new cartridges today and that did not help either.  All the suggestions that I could try running just to buy a new printer?

    Hello

    Please click HERE to access the procedure which should solve the problem.

  • Photosmart D110a. Error message: at least one of the cartridges has a problem.

    Photosmart D110a, Windows 7 32-bit, error message: at least one of the cartridges has a problem. Will print black if the deleted color cartridge. New cartridges does not solve the problem. Everything suggests not tried twice, cleaning, disconnect, etc..

    There is a document with the right information on how to help solve this problem located here.

    It seems that you have already made certain steps to help with this. If the printer is under warranty, then you may want to contact the HP Support on this device.

    Let me know if it helps.

  • How to specify the tablespace for a India primary key in create table statement

    How to specify the storage space for a primary key index in a create table statement?
    Does the following statement is true?
    CREATE TABLE 'GPS'||TO_CHAR(SYSDATE+1,'YYYYMMDD')
                ("ID" NUMBER(10,0) NOT NULL ENABLE, 
                "IP_ADDRESS" VARCHAR2(32 BYTE), 
                "EQUIPMENT_ID" VARCHAR2(32 BYTE), 
                "PACKET_DT" DATE, 
                "PACKET" VARCHAR2(255 BYTE), 
                "PACKET_FORMAT" VARCHAR2(32 BYTE), 
                "SAVED_TIME" DATE DEFAULT CURRENT_TIMESTAMP, 
                 CONSTRAINT "UDP_LOG_PK" PRIMARY KEY ("ID") TABLESPACE "INDEX_DATA"
                 )            
                 TABLESPACE "SBM_DATA";   
    Thank you

    Published by: qkc November 9, 2009 13:42

    As orafad noted, you can use the documentation using ESCALATION clause, i.e.

    SQL> ed
    Wrote file afiedt.buf
    
      1  CREATE TABLE GPS
      2              ("ID" NUMBER(10,0) NOT NULL ENABLE,
      3              "IP_ADDRESS" VARCHAR2(32 BYTE),
      4              "EQUIPMENT_ID" VARCHAR2(32 BYTE),
      5              "PACKET_DT" DATE,
      6              "PACKET" VARCHAR2(255 BYTE),
      7              "PACKET_FORMAT" VARCHAR2(32 BYTE),
      8              "SAVED_TIME" DATE DEFAULT CURRENT_TIMESTAMP,
      9               CONSTRAINT "UDP_LOG_PK" PRIMARY KEY ("ID") USING INDEX TABLESP
    ACE "USERS"
     10               )
     11*              TABLESPACE "USERS"
    SQL> /
    
    Table created.
    

    Justin

  • SQL script to insert values into a table based on the type of user

    Hello

    I have a requirement where I need to insert (username, groupname) in a table based on the user name.

    We have two types of user accounts:

    (1) user name, which starts with "DV" example: "DVPATM."

    regular user 2) example: 'PATM '.

    If the user name begins with "DV" under instruction insert should kick in

    insert into < tablename > (username, groupname) VALUES (< username > ' < groupname1 >).

    otherwise below insert statement should kick in

    insert into < tablename > (username, groupname) VALUES (< username > ' < groupname2 >).

    I need to use SQL or stored only procedure.

    Please suggest

    Thanks in advance

    All things being constant, you could use decode/case just for groupname by examining the first character t the user name, for example

    insert into (username, groupname) VALUES (, (substr ( , 1, 2) the case when "DV" then else end));

    Fixed edit: value for OTHERS, as noted by Frank

  • insert into multiple tables by using select in stored procedure

    I use oracle 10g R2. I want to insert records in two tables by using a select query (insert into tablename select...) in a stored procedure. How can I insert records into a table two at the same time using a select statement?

    My second question is also related to the first... can I use mechanism clustering here because the two tables are based on the same structure and data? One contains data from 24 hours and there are records of 10 days.

    Thank you.

    If you find the answer of Aman as useful/correct, please mark her answer respectively and close the debate. I think his answer is correct as always / a lot of time.

    Concerning
    Girish Sharma

Maybe you are looking for

  • A full justification and display two pages do not work correctly on iOS 10

    I have installed iOS 10 yesterday on my iPad 2 Air but have found that the two functions do not work correctly in iBooks. First of all, full justification does not work when the font size is brought to a certain level. In other words, a complete just

  • Damaged product

    Hello Apple sold me a seal inch MAC BOOK AIR 13 including wifi receiver does not work properly, the wifi disconnects automatically. Apple Service Center confirmed the same thing and now apple will not replace my product!  I want to say why should I b

  • Satellite L10 - 333 poster machine trouble error

    Can anyone help with this you problem? I tried to use the standard drive re format the computer, but having this error problem 'bad Machine '.I tried searching and tried the "2) CD-ROM BOOT METHOD of INSTALLATION. When I ran the CD after restarting W

  • Need QUICK help with XP Recovery Console

    My computer has rejected the slightest error and says to insert disk at startup to enter R for repair through the repair console and windows (he said I was missing a windows / file fat32.) I followed these instructions and it took me to the recovery

  • Vista black screen of death

    Hi, I have recently started to the top of my desk and all of a sudden, it was a black screen with only the cursor. There is nothing I can do, can not enter the Manager tasks or anything like that. I tried to switch when starting and tried restoring t