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


ADVERTISEMENT

Data Warehouse - How To Insert / Access Data In The Tables

May 30, 2011

I created a data warehouse in oracle 10g n with three Dimension and one cube after that it crates 4 tables . How to use an insert sql statement to insert data in those tables n how to access them.

View 7 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 Data In Three Tables From Three CSV Files Simultaneously?

Jun 12, 2013

I am trying to insert data in three tables from three csv files simultaneously. This is what I have so far:

---insert all data from three csv files
DECLARE
--zenobject
F UTL_FILE.FILE_TYPE;

[Code]....

View 5 Replies View Related

SQL & PL/SQL :: Select Data From 2 Tables And Insert Into Another Table

Apr 25, 2013

I want to select data from different tables and insert this into one table based on some conditions:

SELECT *
FROM welltest_msr
WHERE well_s = 3419740
AND check_ind = 1

[Code]....

So I tried doing this with selecting the data and looping through it to do the insert.

DECLARE
--
-- WELLS
--
CURSOR c_well

[code].....

View 6 Replies View Related

SQL & PL/SQL :: Procedure To Update Or Insert Data In Multiple Tables

Apr 9, 2011

I'm writing a Procedure which Updates or Inserts data in Multiple tables. Selected fields of 10 tables need to be updated or Inserted. For this I created a table which comprises of fields related to all 10 tables. Then I write Procedure. Under this I create a Cursor which uploads the data from the newly created table which contains different fields of 10 tables. Then I write Update and Insert statements one by one for all 10 tables.

Sample Procedure below.
-------------------------------------------
Create or replace procedure p_proc as
spidm spriden.spriden_pidm%type;
cursor mycur is select * from mytable;
begin
for rec in mycur
[code]......
----------

Note: I created table on my server because data is coming from different server. They will upload the data in the table from there I pick and update the tables. Is updating or Inserting data in different tables one by one is correct?

View 15 Replies View Related

Server Utilities :: Insert Data Without Writing Insert Statement In Oracle?

May 15, 2010

how to insert data in oracle table without writing insert statement in oracle 9i or above. i am not going to write insert all, merge, sqlloder and import data.

View 2 Replies View Related

Forms :: When Insert Detail The Data Insert Twice Time

Feb 27, 2012

when i tried to insert the details from oracle froms..the data inserts twice to the DB..

my table structure:

create table app_sri
(a_id integer primary key,
p_first_name varchar2(30),
p_last_name varchar2(20),
p_age number(3)
);

here a_id can be genarated through simple sequence(pid_seq)...
trigger on app_sri
create or replace trigger pid_trg

[Code]....

form insertion code..

Begin
insert into app_sri(null,'robo','Big',100);
commit
End;

the data inserted...but twice

what is the reason behind the double insertion?

View 8 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 :: 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 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

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

Maintain Large Tables / Cleanup Data From Our Tables

May 18, 2011

I have to cleanup data from our tables (Production Environment) that contain millions of rows. The question is apart from the solution of the partitioned tables what alternative recommended solution suggests Oracle?

To delete these tables by using a cursor PL/SQL block or to import all the database and in the tables that we want to remove the old rows to use the QUERY option of the data pump utility.

I have used both ways and i have to admit that datapump solution is much much faster than the deletion that suffers from I/O disk.The question again is which method from these two is more reliable and less risky for the health of the database.

View 5 Replies View Related

Implementation Where Data From DB2 Tables Are Moved To Oracle Tables

Sep 3, 2012

I came across an implementation where data from DB2 tables are moved to Oracle tables, for BI solutioning, using some oracle procedures called from MS SQL DTS packages which are scheduled jobs.Just being curious, can this be done using OWB or ODI rather than the above detour. I suppose there are some changes being done in those procedures before the data is being loaded into Oracle tables, can't this be done using OWB/ODI? Can it be scheduled too as jobs using OWB/ODI?

View 1 Replies View Related

SQL & PL/SQL :: Search In Nested Tables And Insert Result Into New?

Mar 15, 2011

How can I search in Nested Tables ex: (pr_travel_date_range,pr_bo_arr) using the SQL below and insert the result into a new Nested Table: ex:g_splited_range_arr.

Here are the DDL and DML SQLs;*Don't worry about the NUMBER( 8 )*

CREATE OR REPLACE TYPE DATE_RANGE IS OBJECT ( start_date NUMBER( 8 ), end_date NUMBER( 8 ) );
CREATE OR REPLACE TYPE DATE_RANGE_ARR IS TABLE OF DATE_RANGE;
DECLARE
g_splited_range_arr DATE_RANGE_ARR := DATE_RANGE_ARR( );

[code]...

Or can I create a VIEW with parameters of Nested Tables in it so I can simply call

SELECT *
BULK COLLECT INTO g_splited_range_arr
FROM view_split_date(g_travel_range,g_bo_arr);

View 7 Replies View Related

SQL & PL/SQL :: FORALL INSERT Not Supported On Remote Tables?

Nov 4, 2012

how to transfer a large amount of data from remote table by db link into the local table.

I try to do that by plsq below but I got error:

PLS-00739: FORALL INSERT/UPDATE/DELETE not supported on remote tables

DECLARE
type t_varchar is table of varchar2(100);
l_data t_varchar ;
CURSOR r IS
SELECT id
FROM TMP_MAPE_WEB_ID;
BEGIN

[code]....

View 6 Replies View Related

Get All Tables That A User Can Select / Insert / Update Or Delete

Dec 17, 2010

How to get all the name of tables that a user can select, insert, update or delete?

View 2 Replies View Related

Server Utilities :: Insert Rows In Two Tables Using Sql Loader?

Aug 7, 2012

I am trying to insert rows in two tables using sql loader.

I have two tables in database as

SQL> desc name
Name Null? Type
---------------------- -------- ------------
ID NUMBER
NAME VARCHAR2(20)
BD DATE

SQL> desc name3
Name Null? Type
--------------------- ----------- -------------
ID NUMBER
NAME VARCHAR2(20)
BD DATE

I created controlfiles as

[oracle@DBTEST sqldri]$ cat datafile.ctl
options (direct=true)
load data
INFILE *
into table name truncate
when id='1'

[code]....

when i run sql loader as

[oracle@DBTEST sqldri]$ sqlldr hr/hr control=/u01/sqldri/datafile.ctl
SQL*Loader: Release 10.2.0.1.0 - Production on Tue Aug 7 23:30:07 2012
Copyright (c) 1982, 2005, Oracle. All rights reserved.
Load completed - logical record count 2.

no rows is inserted..the log file contain entries as

[oracle@DBTEST sqldri]$ cat datafile.log
SQL*Loader: Release 10.2.0.1.0 - Production on Tue Aug 7 23:30:07 2012
Copyright (c) 1982, 2005, Oracle. All rights reserved.
Control File: /u01/sqldri/datafile.ctl
Data File: /u01/sqldri/datafile.ctl
Bad File: /u01/sqldri/datafile.bad

[code]....

View 7 Replies View Related

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

Oracle Data Pump - Export Data From Schemas Or Tables

Oct 11, 2012

I need to export only the data from schemas or tables, how to do that with Oracle Data Pump? when we use schemas parameter this export all schema, not only the data right?

View 7 Replies View Related

SQL & PL/SQL :: INSERT Data Into Database

Nov 22, 2011

I have a question how to do this.

I'm using JAVA class. I'm try to put "data" to database(INSERT data to database - PL/SQL).

I have simple JDBC problem:

Steps.
1) SELECT table_seq.NEXTVAL FROM DUAL;
(Question: How can I make sequence to table ? I see lot of examples on google but all is just to create sequence but not for table. Maybe sequence can be put on table ?)

2) INSERT table_seq.....

3) INSERT table (values) values ('data')

Tables look like this:

table1 [Where I need to take `id`]
------------
id .....
------------

table2 [Where I need this sequence to be taken]
------------
seq_id .....
------------

table2 [Where I need to put `seq_id` into table2.id and data]
------------
id data
------------

I don't get it why can't I just do this ?:
INSERT table2 (data) values ("this is data");

View 6 Replies View Related

SQL & PL/SQL :: Insert Data Into View

Mar 27, 2010

I have created a view in that the primary key column is not included,so that we cannot insert data into that view,but i want to insert data into that view without using Instead of Triggers.

CM: swapped version and title so they're the right way round.

View 12 Replies View Related

Insert Or Fetch  XML Data

Jan 21, 2013

I have the following XML structure .

I am new to using XML .

Any simplest and fastest way to extract or insert data from the below structure and insert in to oracle tables .

<id>
<id1> 123</id1>
<fe>
<fe1>1</fe1>
<fe2>1</fe2>
</fe>

[Code]....

View 2 Replies View Related

SQL & PL/SQL :: To Insert Data Into A Table

Mar 25, 2010

I'm trying to insert data into a table, but can't seem to get the actual code right, when I put it in, Here is the code I have that is giving me the error:

INSERT INTO Orders VALUES('00001', 'c001', 'ca01', '20.5', TO_DATE('12032009', 'DDMMYYYY');

View 4 Replies View Related

Data Insert In Database

Jul 12, 2013

I have a database rac with two nodes. While inserting a row in the database, I am getting the following error: Error starting at line 1 in command:

INSERT INTO DocMeta(dID,xComments,xExternalDataSet,xIdcProfile,xPartitionId,xWebFlag,xStorageRule,xCpdIsTemplateEnabled,.........,xPageID,xNDDate) VALUES(7897,'','','WebStyle','','','default',0,.........,'',null)

Error report:SQL Error: ORA-29875: failed in the execution of the ODCIINDEXINSERT routineORA-20000: Oracle Text error:DRG-50857: oracle error in textindexmethods.ODCIIndexInsertORA-00604:

error occurred at recursive SQL level 1ORA-01950: no privileges on tablespace 'SYSAUX'ORA-06512: at "CTXSYS.DRUE", line 160ORA-06512: at "CTXSYS.TEXTINDEXMETHODS", line 75129875. 00000 -  "failed in the execution of the ODCIINDEXINSERT routine"*Cause:   

Failed to successfully execute the ODCIIndexInsert routine.*Action:   Check to see if the routine has been coded correctly. If I try inserting in the nodes individually, sometimes it gets inserted in one node. The other node gives above error. And at times, both nodes give the same error.

View 0 Replies View Related

PL/SQL :: Insert Data Into One Table From Other?

Oct 7, 2012

i have one table name called TRXN with 43gb data with primary key...i have other table named TRXN_P with 15gb data...some of the records of TRXN_P are already there in TRXN table....i want to insert that remaining data in TRXN_P into TRXN table?

how can i insert ?

View 6 Replies View Related

Insert Data In Table

May 4, 2013

i created and inserted data to my database using SQL plus. all tables has been created sucsefully and i can see them in OUI. but all tables rows shown empety(it means under the rows, column is empety not 0). now how can see the data which i inserted to tables ? can i see them in OUI?(web interface)

View 12 Replies View Related

How To Insert A New Record In A Data Block

Sep 18, 2012

How do I insert a new record in a Data Block, and the standard is always insert a line below, you could add a record above?

View 1 Replies View Related







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