SQL & PL/SQL :: How To Insert 100 Records Into Different Tables

Apr 28, 2011

i have 100 records in table1,like as we have more 15 tables without data. the issue is how can i insert above table1 data(100 records) into different 15 tables in single sql command.

View 22 Replies


ADVERTISEMENT

SQL & PL/SQL :: Insert Multiple Records In Different Tables At A Time (Using Single Query)

Jun 8, 2010

I want to insert multiple record in diff. table by using single query...

how can i di it suppose i hv 3 table table1, table2, table3 i want to insert 2 record on each table respectively..

But i want to do this task by using single query....how can i do it?

View 4 Replies View Related

SQL & PL/SQL :: Differences Among Records Tables And Tables Of Records

Sep 16, 2010

In Oracle database pl/sql 11.2: describe the differences between :

records,
tables, and
tables of records.

View 11 Replies View Related

SQL & PL/SQL :: Insert 10 Records From Table A To B?

Jul 18, 2012

I want to insert 10 records from table a to table b. If i m using statement level trigger how many record insert?In row level trigger how many record inserted?

View 2 Replies View Related

Forms :: How To Insert Records Manually

Aug 30, 2013

I have a form with a datablock displaying 3 text item fields.But the actual oracle table have 8 columns.When ever I insert new data and save it, only the three records are being stored in backend whereas remaining column stores with null value.That is the basic function of the form.

I placed an another list item field in a control block which is non-database item.Now I want to store the list item value into a column along with the 3 columns.In a simple way, how to insert record manually along with the other records?

View 14 Replies View Related

SQL & PL/SQL :: Insert 999999 Records In Table

Feb 1, 2013

I need to insert 999999 records into one table, Already I wrote the below query

DECLARE
TYPE tt_type IS TABLE OF table_name.no%TYPE
INDEX BY BINARY_INTEGER;

tt_type_no tt_type;
rec_count NUMBER;
BEGIN
[code]...

But It took 5 mins to execute... Is there any other way there to insert fastly.

View 7 Replies View Related

Forms :: Insert Records Which Are Checked

Jul 7, 2011

I am working on form builder 6i. I have multi record datablock 't1'.' I have 'Submit' Button, which contains 'commit_form'. I am able to insert records.

Now i have a check box in data block, i want to insert records which are checked. I followed below thing to achieve that.

ON-INSERT Trigger:

If check_box ='Y' THEN
INSERT_RECORD
end if.

SUBMIT BUTTON: commit_form.

Let us say, i have 5 records, 2 records are checked, after clicking SUBMIT button, it's inserting 2 records only. But in console window, it's showing '5 transactions are saved'. I want see '2 transactions are saved' message in console window.

How to get it or any other solution which will insert records which are checked and show correct message in console window.

View 11 Replies View Related

SQL & PL/SQL :: Insert Multiple Records In Table

Jul 18, 2013

Insert multiple record in table. I have a table of customers . It has column cus_name, cus_fruit, cus_date, cus_qty.

Select * from customers;
cus_name cus_fruit cus_date cus_qty
Maria Anders Apple 18-July-2013 10
Maria Anders Apricot 18-July-2013 20
Maria Anders Asparagus 18-July-2013 100
Maria Anders Avocado 18-July-2013 5
Ana Trujillo Apple 18-July-2013 10
Ana Trujillo Apricot 18-July-2013 20
Ana Trujillo Asparagus 18-July-2013 100
Ana Trujillo Avocado 18-July-2013 5

how I can insert record in one time in table. All table data same only change the cus_name.

Thomas Hardy Apple 18-July-2013 10
Thomas Hardy Apricot 18-July-2013 20
Thomas Hardy Asparagus 18-July-2013 100
Thomas Hardy Avocado 18-July-2013 5

After Insert record result.
Select * from customers;

cus_name cus_fruit cus_date cus_qty
Maria Anders Apple 18-July-2013 10
Maria Anders Apricot 18-July-2013 20
Maria Anders Asparagus 18-July-2013 100
Maria Anders Avocado 18-July-2013 5
Ana Trujillo Apple 18-July-2013 10
Ana Trujillo Apricot 18-July-2013 20
Ana Trujillo Asparagus 18-July-2013 100
Ana Trujillo Avocado 18-July-2013 5
Thomas Hardy Apple 18-July-2013 10
Thomas Hardy Apricot 18-July-2013 20
Thomas Hardy Asparagus 18-July-2013 100
Thomas Hardy Avocado 18-July-2013 5

View 9 Replies View Related

Forms :: Unable To Insert Records

Oct 7, 2012

I am getting this error FRM 40508 in inserting data to any table through forms 11g.

eg:

my test table having two columns : id and name

i wrote a simple insert statement insert into test values (:id, :name);
commit;

when i run the application and insert the values, it shows the above error.

when I use the display errors , it shows that there is a violation : ora - 00001 (duplicate values)

however, there is no such value in the database.

The same scenario is repeating with every table I have.

I thing more, when I use the commit_form only without using any manual insert statement, then everything goes well. But with manual insert it all fails.

View 3 Replies View Related

PL/SQL :: Insert 3 Shp_id Records With Same Ord_id

Jul 6, 2012

I have data like this,

sample data,

ord_id shp_id
121 12,13,14

now i want to insert 3 shp_id records with same ord_id.

View 4 Replies View Related

PL/SQL :: How To Insert 3 Million Records From One Table To Another

Aug 13, 2013

I want to know how we can insert more than 3 million records from one table to another table. Can we use Bulk collect and forall to insert the all data.Can we use create table tableB as select * from tableA; From the above which is one is performance wise good.

View 16 Replies View Related

Two Object Tables - Row Will Not Insert

Jun 14, 2007

I have 2 object tables. Location and a department. Department references a location Object. But this wont insert. I get "0 rows created".

CREATE OR REPLACE TYPE location_objtyp AS OBJECT
(
locationID NUMBER,
name VARCHAR2(48)
);
/
CREATE OR REPLACE TYPE dept_objtyp AS OBJECT
(
deptID NUMBER,
name VARCHAR2(48),
locationID_ref REF location_objtyp
);
[code]...

This does not insert. I get no error. Only - "0 rows created".

View 3 Replies View Related

SQL & PL/SQL :: Insert Data Into Tables

Aug 2, 2010

i have source table having 1000 records, i want insert first 100 rows in table1,second 200 rows in table2 and remaining row in table3.

View 12 Replies View Related

SQL & PL/SQL :: Insert From 3 Different Files In 3 Tables

Jun 12, 2013

I am trying to insert from 3 different files in 3 tables and I am finding that the same id is being inserted for each row.

DECLARE

F UTL_FILE.FILE_TYPE;
V_LINE VARCHAR2 (1000);
V_Name varchar2(512 char);
V_ParentUID raw(16);
V_Path varchar2(1024 char);
[code]...

View 5 Replies View Related

Insert Data In Two Tables

Jun 27, 2007

I have a form which has three detail portions. I want that when I press SAVE, it should insert data in two tables & then run the specific code & then insert data in other two tables.

I am using Developer 6i. Couldn't find out the proper trigger or related thing.

View 2 Replies View Related

SQL & PL/SQL :: Insert Or Update Records Into Target Table

Dec 21, 2012

I am trying to insert rec into target table if those rec are not existing and trying to update those rec if they already exists from three source tables.I had seen in posts that merge cannot be used with cursor.

SQL> create or replace
2 PACKAGE sis_l_cpl_sis_reb_pgm_hist_pkg
3 IS
4 /********************************************************************
******************
5 PACKAGE: sis_load_cpl_sis_reb_pgm_hist
6 PURPOSE: Load CMPLY_SIS_REB_PGM_HIST with data from cmply_sis_p
h_dtl,cmply_sis_sls_dtl,
7 cmply_sis_excl_dtl(intial load)
8 *********************************************************************
******************/
[code].......

Package created.

SQL> create or replace
2 PACKAGE BODY
sis_l_cpl_sis_reb_pgm_hist_pkg
3 IS
4 /**********************************************************************
******************
5 PACKAGE: sis_l_cpl_sis_reb_pgm_hist_pkg
6 PURPOSE: Load CMPLY_SIS_REB_PGM_HIST with data from cmply_sis_pur
h_dtl,cmply_sis_sls_dtl,
7 cmply_sis_excl_dtl(intial load)
[code].......

Warning: Package Body created with compilation errors.

SQL> sho err
Errors for PACKAGE BODY SIS_L_CPL_SIS_REB_PGM_HIST_PKG:

LINE/COL ERROR
-------- -----------------------------------------------------------------
67/7 PL/SQL: SQL Statement ignored
75/19 PL/SQL: ORA-00926: missing VALUES keyword

View 10 Replies View Related

SQL & PL/SQL :: DBLink Insert - How To Recover Lost Records

Jun 20, 2010

I am inserting data into database_A table from database_b using dblink,

INSERT INTO database_A@database_B SELECT * FROM student;

while inserting if we loss some records how can we recover those records.

View 11 Replies View Related

Forms :: Update / Insert Records From One User To Other

May 29, 2010

I want to update / insert records from one user to other user therefore I write this code in my form but it gives me error.

REPORT_DETAILS is a detail table of REPORT_PARAM, given code is working fine at master tables.

Form always goes in TOO_MANY_ROWS exception.

Correct my code, my requirement is: if data found then update else insert new record.

declare
cursor c1 is select * from factory_data.report_details order by rd_rp_id;
rec c1%rowtype;
v_check varchar2(1) := null;
begin
for rec in c1 loop
[code].......

View 7 Replies View Related

PL/SQL :: Get Records Count Of All Tables

Sep 26, 2012

I am trying to get the record count of all tables using dynamic query. I don't know how to put the value in placeholder. I tried the below code.

SET SERVEROUTPUT ON SIZE 1000000
DECLARE
CURSOR table_list
IS
select OBJECT_NAME from user_objects
where object_type in ('TABLE')
[code].......          

View 4 Replies View Related

SQL & PL/SQL :: Retrieving Records From Tables

Mar 27, 2010

I want to retrieve the data from ex.tables. How to get this.

table1:

Account_No, Account_sub_No
1234 1
1234 2
1234 3
2345 4
2345 5
2345 6
2345 7
2345 8
................
Account_no is the primary key

table2:

Account_sub_No, Description
1 Hello
2 Hi
3 No.1
4 great
5 people
.................
8 world
..........................
Account_sub_No is primary key.

Out put:

I want the data like Account_no who is having more than 3 Account_sub_no values.

But in my case need to join these two tables with other tables. join field is Account_no from table1. there are no other fields to join.

View 5 Replies View Related

SQL & PL/SQL :: Join In Insert - Multiple Tables

May 20, 2013

I am trying to insert records in multiple tables. I know how to view data using joinig, but unable to understand how to insert records in multiple tables using Joining. I searched it on net, but didn't find much. I have also tried to write a code, but it is not working, I have seen some examples on different websites where people are using SELECT in INSERT statement for joining. What is the correct Syntax to INSERT record in Multiple tables.

Insert into library_users, library_users_info
(library_users.username, library_users.password, library_users_info.address, library_users_info.phone_no) VALUES (...)

View 2 Replies View Related

SQL & PL/SQL :: Dynamic Insert From Multiple Tables?

May 29, 2013

We get data from our customers which we load into temporary tables.The goal is to consolidate this data into one single table.

Following are the rules:

1) final table should have all the columns from all the tables. If there are common column(s) then add only one column with that name.

2) the join would be based on all the common columns

3) if there is a common row, we merge the row into one (example, the row with DOMAIN = ACME.COM)

4) There could be 'N' number of tables

Following is the most realistic data.

1) T1/T2/T3 has the sample data which cover most of our test cases

2) We are expected to transform the data from T1/T2/T3 as depicted in table T4.

3) we might have more than 3 tables in our production environment, so the query should work for N tables.

4) I have given the explanation of how each row should be derived to be inserted in T4

5) the only information we have to work with is the TABLE_NAME(s) and its metadata from USER_TAB_COLUMNS

DROP TABLE T1;
DROP TABLE T2;
DROP TABLE T3;
DROP TABLE T4;

[code].....

Explanation for each row:

row1) This row comes from T1 and T2 (not T3 because HOSTNAME would not match)
row2) This row comes from T1 and T3 (not T2 because HOSTNAME would not match)
row3) This row comes from T1 and T3
row4) This row comes from T2 and T3
row5) This row comes from T3

View 5 Replies View Related

SQL & PL/SQL :: How To Insert BLOB Files Into Tables

Dec 4, 2011

I created a music database, and I'm having trouble inserting the audio, video, and lyrics (.doc) into their respective tables. I searched through the forums and found some example code, but I'm not sure how to modify it to fit my purposes.

What I need is a procedure that can insert a complete record into the track table (including an .mp3 file for each row), one that can insert a record into the lyrics table (including .doc file for each row), and a procedure that can insert a single record into the Video table (including an .mv4 file).

Here's the DDL:

CREATE TABLE Artist(
artist_id number(9),
artist_name varchar(30),
country char(2),
num_albums number(3),
num_songs number(5)
);

[Code]....

View 39 Replies View Related

Forms :: Unable To Insert Checkbox Checked Records?

May 23, 2011

I have a multi-record block with a check box(:B_ASTHEAD.CB_CHECK) for each record. user can select the record by clicking on the check box. when checked, value is 'Y' and when unchecked, value is 'N'.

when user clicks on 'OK' button (when button pressed trigger), the records which are selected(Checkbox) must be posted to the database table.

L_last_Rec number;
L_first_Rec number;
L_AST COP_DETL.AST%TYPE;
BEGIN

[Code]....

The issue here is , check box selected records are not getting inserted into table when OK button is clicked and i could see that all checked checkboxes become unchecked immediately . But if i comment the --"if :B_ASTHEAD.CB_CHECK = 'Y' then " part, then insert works , but inserts all record.

Insert only checkbox selected records.

View 11 Replies View Related

SQL & PL/SQL :: How To Commit After 1000 Records In Simple Insert Statement

Oct 10, 2011

I am using Oracle 11g Release 11.2.0.1.0

OS: windows

I am taking an example of EMP table in a scott schema.

EMP_1 is also a same structure of EMP.

Here is the Insert statement used.(i might get where clauses etc in the real scenario i am taking a simple example here)

INSERT INTO SCOTT.EMP_1(JOB,ENAME,EMPNO) SELECT JOB,ENAME,EMPNO FROM SCOTT.EMP

table EMP is having around 25 million records.

i would like to do a commit after every 1000 records. as my redo log is getting full if i use a single commit at the end.

Quote:pls note: Increasing of redo log is not possible as of now

is there anyway i can acheive this without cursor bulk collect.

View 7 Replies View Related

Client Tools :: Insert 50 Million Records At A Time?

Jan 4, 2011

How can i insert 50 million records at a time

View 1 Replies View Related

SQL & PL/SQL :: Insert Records From A Select Query Into Temporary Table?

Mar 21, 2013

We are trying insert records from a select query into temporary table, some of the records is missing in the temporary table. The select statement is having multiple joins and union all which it little complex query. In simple terms the script contains 2 part 1st Part Insert in to temporary table 2nd part Select query with multiple joins, inline sub queries, unions and group by classes and conditions Eg. If we execute select statement alone it returns some count for example => 60000 After inserting into the temp table, in temp table the count is around 42000 why is the difference?

It is simple bulk inserts... insert in to temp table select * from xxx. also, there is no commit in between. The problem is all the records populated by the select statement are not inserted in to temp table. some records are not inserted.

Also, we had some other observation. It only happens in its 2nd execution and not its first run. Hope there might be some cache problem Even, we also did not believe that. We are wondering. In TOAD, we tested however at times it happens. In application jar file, after "insert in to temp select * from xxx" we take the i. record count of temp table and ii. record count of "select * from xxx" separately but both doesn't match. Match only at 1st time.

View 16 Replies View Related

PL/SQL :: Insert Multiple Records On A Database Using Stored Procedure

Mar 25, 2013

I want to insert multiple records on a database using a stored procedure.

View 11 Replies View Related

Querying Records From Temporary Tables

Feb 2, 2011

I have a temporary table (with on commit preserve rows property) which is populated thru insert into command from a procedure. After which, i need to query the records from the populated temp table.

However, my query returns nothing. My procedure works fine cause i tried executing it to populate a regular table and it is ok. However, it shows no output in the temp table cause probably it is creating another session. How do i select the rows from the temp table after populating it from a procedure.

View 3 Replies View Related

How To Display Unmatched Records In Two Tables

Feb 28, 2008

I want to display all records from table 1 (even the null values) that do not match records in Table 2. Below I am creating both tables and I am posting the result query I need.

------------------------------------
CREATE TABLE temp_table1
(
name VARCHAR2(12 BYTE),
last_name VARCHAR2(12 BYTE),
STATE VARCHAR2(2 BYTE),
BIRTH_DATE DATE
);

CREATE TABLE temp_table2
(
name VARCHAR2(12 BYTE),
last_name VARCHAR2(12 BYTE),
STATE VARCHAR2(2 BYTE),
BIRTH_DATE DATE
);

[code].....

The result query need to have 5 rows as shown below

NAME LAST_NAME STATE BIRTH_DATE
------------ ------------ ----- ---------------------
john smith MA 12/1/1979
null null AZ null
null null CT null
null null MA null
null null CT null

View 5 Replies View Related







Copyrights 2005-15 www.BigResource.com, All rights reserved