insertion of records in multiple tables
Hope someone can keep me on the right track here.My current database structure is:
I think that's all this from back to me - it is in fact only all your networking / lookup tables. so I now have the following tables:
Candidates
---------------
Candidate_ID (AutoNumber)
Name (text)
...
1, Iain
2, fi
3, Rob
Job offers
--------------
Vacancy_ID (AutoNumber)
Holiday (text)
...
1, cartographer
2, gardener
3, OT
4, Web Designer
5, recruitment manager
Profiles of school boards
-----------
Profile_ID (AutoNumber)
Profile (text)
...
1, card making
2, Web design
3, gardening
4, hand therapy
5, recruitment
6, aviation
7, sport
8, travel
VacancyProfiles
----------------------
Vacancy_ID (number)
Profile_ID (number)
...
1.1
1, 2
4.2
2, 3
3, 4
5.5
5, 6
CandidateProfiles
--------------------
Candidate_ID (number)
Vacancy_ID (number)
...
1.1
1, 2
1.7
1.8
2, 3
2, 4
2.8
3.5
3.6
3.7
and created two queries
CandidatesQuery
--------------------
SELECT Candidates.Candidate_ID, Candidates.Name, Profiles.Profile_ID, Profiles.Profile
Profiles of JOIN IN-HOUSE (candidates INNER JOIN CandidateProfiles ON Candidates.Candidate_ID = CandidateProfiles.Candidate_ID) ON Profiles.Profile_ID = CandidateProfiles.ProfileID;
1, Iain, 1, card making
1, Iain, 2, Web design
1, Iain, 7, Sport
1, Iain, 8, travel
Fi, 2, 3, gardening
2, fi, 4, hand therapy
Fi, 2, 8, travel
3, Rob, 5, recruitment
3, Rob, 6, Aviation
3, Rob, 7, Sport
and
Vacancies_Query
-------------------
SELECT Vacancies.Vacancy_ID, Vacancies.Vacancy, Profiles.Profile_ID, Profiles.Profile
Profiles of JOIN IN-HOUSE (vacant posts INNER JOIN VacancyProfiles ON Vacancies.Vacancy_ID = VacancyProfiles.VacancyID) ON Profiles.Profile_ID = VacancyProfiles.ProfileID;
...
1, cartographer, 1, card making
1, cartographer, 2, Web design
Gardener, 2, 3, gardening
3, OT, 4, hand therapy
4, web designer, Web design 2
5, recruitment manager, 5, recruitment
5, recruitment manager, 6, Aviation
-----------
But I'm a little shaky on how to make my insert (and modify) the pages of documents. Simple, it is enough if I just want to add a new candidate or vacation - just add a record in a table.
But ideally, I would like to add profiles associated with each new candidate or vacation at the same time - which probably would add records for the CandidatesProfile and VacanciesProfiles tables too.
Is this possible and if yes how do I configure?
Or should it be a two steps process, IE adding records to the table of candidates and then add records to the table of CandidatesProfiles?
What I am used to doing in MS Access forms would be something like the use of sub forms, but really don't know how to reproduce it in a web page.
Pointers appreciated.
See you soon,.
Iain
Well, I think I got in the way which it - I'm going to mark this as replied and start a new thread, as I narrowed down it to something more specific I need to do. Basically it adding a new candidate and goes to a page of profiles add-on that uses checkboxes for each profile.
When I select all profiles, it adds them to the table of Candidateprofile, but not with the newly added candidate candidateID, but with a 0 candidateID - so I need to figure out how to pass the CandidateID candidate newly added page AddCandidate page AddProfiles...
Iain
Tags: Dreamweaver
Similar Questions
-
Use with need to collect in bulk to insert records from multiple tables
Hello
I plsql record type with several tables with multiple columns. so when I used bulk collect with education for ALL. I want to insert records in multiple tables.
Please give me suggestions.
ForAll is designed to be used with a single DML statement, which may include dynamic SQL statements. However, I do not know what advantage this will give you your list iteration save several times, one for each table - especially since there is an air show with SQL dynamic.
Example 1 (dynamic SQL):
begin
...
forall i in vRecList.First..vRecList.Last
execute immediate '
begin
insert into Table1 (Col1, Col2, Col3) values (:1, :2, :3);
insert into Table2 (Col1, Col2, Col3) values (:1, :2, :3);
end;' using vRecList(i).Col1, vRecList(i).Col2, vRecList(i).Col3;
end;Another approach that I should work (but not tested) is using to insert all the Scriptures and based record inserts, but you need to try on your version of Oracle forall has changed between the versions. In this case vRecList must be compatible with the Table % ROWTYPE and Table2% ROWTYPE type.
Example 2 (insert all):
begin
...
forall i in vRecList.First..vRecList.Last
insert all
into Table1 values vRecList(i)
into Table2 values vRecList(i)
select 1 from dual;
end; -
Insert the record of one table to another with the help of the cursor
Help, please!
the tables are - 1. countries (country_id pk, country_name, region_id)
2A (country_id, country_name, region_id)
table data are
1 to 1
2 b 2
3 C 3
NULL d 4
5 e 5
6 f 6
7 g 7
-----------------------
Insert the record in the table a country table with the help of the cursor, insert all the non-null records.
This procedure does not correct result
-----------------------
create or replace
Amit procedure as
cursor c1 is select * from a;
RW a % rowtype;
Start
Open c1;
Fetch c1 into rw.
While (C1% found)
loop
insert into countries values (rw.country_id, rw.country_name, rw.region_id);
commit;
Fetch c1 into rw.
If rw.country_id is null then
Fetch c1 into rw.
end if;
end loop;
Close c1;
exception
while others then
dbms_output.put_line ('exception = name ' |) RW.country_name);
end;You don't need cursor at all;
create or replace procedure amit as begin insert into countries (Country_ID, Country_Name, Region_ID) (select a.Country_ID ,a.Country_Name ,a.Region_ID from a ); dbms_output.put_line('Rows inserted : ' || sql%rowcount); commit; end; /
-
How to find inserted last record in the table.
Version: Oracle 10g
I have a table called 'Manufacturing' and 3 columns as mfno, itemname, quantity.
How to find inserted last record in the table 'manufacturing '.
As I got to know that the Rowid is not a result perfect result. Please provide your inputs.user13416294 wrote:
Version: Oracle 10gThis is not a version. It's a product name. A version is 10.1.0.2 or 10.2.0.4, etc.
I have a table called 'Manufacturing' and 3 columns as mfno, itemname, quantity.
How to find inserted last record in the table 'manufacturing '.Not possible as your data model do not answer for him. As simple as that.
If there is a need to determine an order or associate some time to an entity, then that should be part of the data model - and a relationship, or one or several attributes are necessary to represent this information. Your data model in this case is therefore unable to meet your requirements.
If the requirements are valid, set the data model. In other words - your question has nothing to do with Oracle and nothing to do with the other pseudo columns in Oracle, the rowscn or the rowid. It is a question of pure data modeling. Nothing more.
-
How to insert huge records in the table for the practice.
Hello
I created a new database in my personal inbox. Now, I want some specimen for different practical feature of oracle 10g. I need at least 1,00,000 records with different lines and columns.
any buddy tell me of any request or package that can create the table and insert unique records in this table.
Looking for valuable advice.
Thank youCan be dbms_random.string, dbms_random.value and dbms_random.random can help.
-
Delete query to delete records from multiple tables
All,
I need a delete query that will delete the records from the tables. Please see the structure of the table & below
Now, I need to delete the records in these tables where the ID is '2000' by using a single delete query. Is this possible? This may be a newbie question. Help, please.CREATE TABLE TEMP1 (ID NUMBER(10),NAME VARCHAR2(40),CLASS VARCHAR2(40),COLLEGE VARCHAR2(40)); CREATE TABLE TEMP2 (ID NUMBER(10),CITY VARCHAR2(40),STATE(40)); INSERT INTO TEMP1 (ID, NAME,CLASS,COLLEGE) VALUES (1000,'SAM','CS','UNIV_1'); INSERT INTO TEMP1 (ID, NAME,CLASS,COLLEGE) VALUES (2000,'RIO','CS','UNIV_1'); INSERT INTO TEMP1 (ID, NAME,CLASS,COLLEGE) VALUES (3000,'CHRIS','CS','UNIV_1'); INSERT INTO TEMP1 (ID, NAME,CLASS,COLLEGE) VALUES (4000,'ALEX','CS','UNIV_1'); INSERT INTO TEMP2 (ID, CITY,STATE) VALUES (1000,'Auburn','NY'); INSERT INTO TEMP2 (ID, CITY,STATE) VALUES (2000,'Ithaca','NY'); INSERT INTO TEMP2 (ID, CITY,STATE) VALUES (3000,'Mount Vernon','NY'); INSERT INTO TEMP2 (ID, CITY,STATE) VALUES (4000,'Port Jervis','NY');
"using a single request deletion. Is this possible?
Nope.
You can insert into multiple tables by using a single query, INSERT ALL job, but you cannot delete more than one table using a single query. -
ADF Mobile: Insert a record into a table by WS - DC method
It's something that is very basic and I could not know.
There is this method of 'create' base on the service project to insert a single record in a table.
I created a WS - DC on my mobile project. I see my createItem on the list method. But what I have this XItem.xsd.
So when I get the ValueExpression binding, I don't know how to set the attribute values...
ValueExpression ve = AdfmfJavaUtilities.getValueExpression ("#{bindings.xItemView1.inputValue}", Object.class);
PS: GenericType does not work.Your service must expose a method create and then you drag this method to your page and call it with an object as a parameter.
Should be similar to the way in which an update is done here:
https://blogs.Oracle.com/Shay/entry/adf_mobile_update_through_web -
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
-Vinodare 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.
-
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 TysonPublished by: Tyson Janet on June 23, 2011 10:48
-
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
-
Insert the records of 2 tables in tables.
Hi all
I have 3 tables as below
SQL > desc a1
Name Null? Type
----------------------------------------- -------- ----------------------------
COL1 NUMBER (20)
COL2 VARCHAR2 (10)
SQL > desc a2
Name Null? Type
----------------------------------------- -------- ----------------------------
COL1 NUMBER (20)
COL2 VARCHAR2 (10)
SQL > c1 desc;
Name Null? Type
----------------------------------------- -------- ----------------------------
COL1 NUMBER (20)
COL2 VARCHAR2 (10)
Now, I want to insert records from a1 and a2 in c1 with the help of a unique sql. Please can someone give me the sql statement.
Thank you...Hello
Example:
insert into tab3 select * from tab2 union all select * from tab1;
Bartek
-
To load multiple records in multiple tables from target
I have read several records as a set of a file flat source unique and load in the different target tables.
I have to read 3 discs as a game and load different targets in 3 tables and read another 3 disks as a game and load in the previous tables 3 target and it will
until all of the records from flat file are loaded.
The structure of the file is as follows:
Header record
Record line
Record distribution
Header record
Record line
Record distribution
....
....
... ...
Read the header record and load into the target table
Record line to read and load in the target B table
Record Distribution to read and load in the target C table
-Repeat the same steps until all records are read and loaded into the target tables.
I would be grateful if anyone can suggest the best approach to the design of interface/package and error conditions to manage?
Thank you
RAMHello
in this case you must create the data store depending on a model "Flat file".
For example, create 3 store data with the same resource (file), but change the column definition
Usually on the first column, set the 'model' for each specific format "variable code.You create 3 interfaces and load your target (for example database table)
Concerning
Stéphane
-
Update trigger that inserts the record in another table
I searched the forum and the web for an example like this and I can not find a:
A field is updated in the TABLE_A and it triggers a single record TABLE_B insert that has the old and the new value of the field.
I write a lot of complex data warehouse SQL-based reports, but very rarely do much PL/SQL, any help would be appreciated.
Thanks in advance.Hello
You can specify that the trigger should fire only when certain columns are referenced, like this:
create or replace trigger test_fund_trig before update OF FUNDING on table_a ...
If you do this, the trigger will not draw on statements such as:
UPDATE table_a SET mod_date = SYSDATE;
You should always use an IF statement, as I mentioned earlier, if you do not want to follow the updates where the value of this column has not really changed.
-
Hi all
I created a table with two columns method. I am assigned two values to variable recordtype.
When inserting the record in the table, a compiler error is to be there.
ERROR on line 11:Create table emp_info(empno number(5),ename varchar2(30)); DECLARE l_rec emp_info%rowtype; BEGIN l_rec.empno := 101; l_rec.ename := 'KING'; insert into emp_info(empno,ename) values(l_rec); commit; END;
ORA-06550: line 10, column 35:
PL/SQL: ORA-00947: not enough values
ORA-06550: line 10, column 1:
PL/SQL: SQL statement ignored
Can I insert with output Recordtype variables indicating the column names. Can someone help me?Do not list of columns. Do not put brackets in the record variable:
SQL> DECLARE 2 l_rec emp_info%rowtype; 3 BEGIN 4 l_rec.empno := 101; 5 l_rec.ename := 'KING'; 6 insert 7 into emp_info 8 values l_rec; 9 commit; 10 END; 11 / PL/SQL procedure successfully completed. SQL>
SY.
-
Count records in different tables with a condition
Hello
I would like to ask for your help. I want to count the records from multiple tables at the same time. These tables have a common column with them with a date data type. The output I want is to see the records in the tables with a condition of the column_date < (specified date).
as of:
Select count (*) from (the_tables) where (column_date), (specific_date)
Your help would be much appreciated.Hello
|| ' WHERE ITEMDATE <= 8/1/2008;';
With the Frank remark about the mistake, another good practice would be to use a connection variable:
script_sql := 'SELECT COUNT (*) FROM ' || r_1.owner || '.' || r_1.table_name || ' WHERE ITEMDATE <= :1'; ... EXECUTE IMMEDIATE script_sql INTO this_cnt USING to_date('08/01/2008','DD/MM/YYYY');
Maybe you are looking for
-
Refresh/reload page button - where is it?
I've just updated (but downgraded...) to 40 FF. Where is the button "refresh/reload the page", and where can I get one from?
-
How can I set up my new Officejet Pro 8600 more printing on paper photo 4 x 6?
How can I set up my new Officejet Pro 8600 more printing on paper photo 4 x 6? I'm running on Windows 7 64 bit.
-
Windows 8 ceased to recognize the external hard drive.
Original title: Windows 8 Windows 8 stopped recognizing my Seagate more 1 TB external hard drive. It worked fine for months and just stopped to acknowledge, also my Adobe Reader XI stop working. I get "internal error" when I try to use Adobe PDF. Mor
-
difference between two dates in the year/month/day in Obiee
Hi gurus,I know this question have been asked and answered several times but I have a requirement that is a little different, then the previous ones.I want to calculate the difference between two dates in OBIEE10g in year/month/day format similar to
-
The problem of unavailable fonts...
Hi allI'm unable to print the book because the chapter is cause of unavailable fonts.How can I find the text or paragraph that uses fonts not available?It is the only document on the page and I reapplied paragraph tags all the lines, but I was not ab