Break table into multiple tables
I have a table with 700000 records and I need this data for calculating a value in excel using one of the third-party add-ins and then import all the data back into Oracle table. Since excel can only hold about 65000 records, I will have to break the oracle table into about 11 excel files each holding about 65000 records and then run my function and then import the calculated data back into Oracle. My question is how do I split the oracle table into 11 tables with each having 65000 records. There is no unique field in the table.
Format of table is like this;
num1 num2 cdat
12 43
12 34
45 65
32 45
I will need to use excel and calculate cdat column and then import it back to excel with cdat column calculated.
num1 num2 cdat
12 43 232
12 34 543
45 65 343
32 45 244
Any tips to guide me would be helpful.
No, I cannot do that because I have a third-party add-in that is installed in excel and it accesses its own proprietary database to peform some calculation and then gives the calculated number in excel. I cannot access this thirdparty database in oracle and I do not know the algorithm it uses to give me the desired number. The only option I have for now, is to get the data from oracle into excel, do my calculations and then import it back into oracle.
Similar Messages
-
Breaking down SQL table into Multiple tables on the web using struts
I have a SQL table with business names and products. I am trying to display tables on a webpage for each individual business and their products. So one table is for each business and each business table lists all the products for that business. I'm not really sure how to do this. I sorted by the business names so all the related records are next to each other. I did try two nested iterate statements but received an error about missing a getter. Any suggestions would be helpful. I am writing this code in a JSP file and can use most struts commands (bean, html, nested commands). Sorry if this topics isn't very related to JSP but couldn't really find a better spot.Thanks
You are missing the position parameter:
set echo on
drop table t1;
drop table t2;
drop table t3;
create table t1 (fld1 varchar2(5), fld2 varchar2(10), fld3 varchar2(10),
fld4 varchar2(10) );
create table t2 (fld1 varchar2(5), fld2 varchar2(10), fld3 varchar2(10),
fld4 number );
create table t3 (fld1 varchar2(5), fld2 varchar2(10), fld3 varchar2(10),
fld4 varchar2(10), fld5 varchar2(10) );
load data
infile *
append
into table mpowel01.t1
when (fld1 = 'T1' )
( fld1 terminated by ',',
fld2 terminated by ',',
fld3 terminated by ',',
fld4 terminated by whitespace)
into table mpowel01.t2
when (fld1 = 'T2' )
( fld1 position(1) terminated by ',',
fld2 terminated by ',',
fld3 terminated by ',',
fld4 terminated by whitespace)
into table mpowel01.t3
when (fld1 = 'T3' )
TRAILING NULLCOLS
( fld1 position(1) terminated by ',',
fld2 terminated by ',',
fld3 terminated by ',',
fld4 terminated by ',',
fld5 terminated by whitespace)
BEGINDATA
T1,one,one,one
T2,two,two,2
T3,three,three,three,three
UT1 > select * from t3;
FLD1 FLD2 FLD3 FLD4 FLD5
T3 three three three three
UT1 > select * from t2;
FLD1 FLD2 FLD3 FLD4
T2 two two 2
UT1 > select * from t1;
FLD1 FLD2 FLD3 FLD4
T1 one one one
HTH -- Mark D Powell -- -
Split a large table into multiple packages - R3load/MIGMON
Hello,
We are in the process of reducing the export and import downtime for the UNICODE migration/Conversion.
In this process, we have identified couple of large tables which were taking long time to export and import by a single R3load process.
Step 1:> We ran the System Copy --> Export Preparation
Step 2:> System Copy --> Table Splitting Preparation
We have created a file with the large tables which are required to split into multiple packages and where able to create a total of 3 WHR files for the following table under DATA directory of main EXPORT directory.
SplitTables.txt (Name of the file used in the SAPINST)
CATF%2
E071%2
Which means, we would like each of the above large tables to be exported using 2 R3load processes.
Step 3:> System Copy --> Database and Central Instance Export
During the SAPInst process at Split STR files screen , we have selected the option 'Split Predefined Tables' and select the file which has predefined tables.
Filename: SplitTable.txt
CATF
E071
When we started the export process, we haven't seen the above tables been processed by mutiple R3load processes.
They were exported by a Single R3load processes.
In the order_by.txt file, we have found the following entries...
order_by.txt----
# generated by SAPinst at: Sat Feb 24 08:33:39 GMT-0700 (Mountain
Standard Time) 2007
default package order: by name
CATF
D010TAB
DD03L
DOKCLU
E071
GLOSSARY
REPOSRC
SAP0000
SAPAPPL0_1
SAPAPPL0_2
We have selected a total of 20 parallel jobs.
Here my questions are:
a> what are we doing wrong here?
b> Is there a different way to specify/define a large table into multiple packages, so that they get exported by multiple R3load processes?
I really appreciate your response.
Thank you,
NikeeHi Haleem,
As for your queries are concerned -
1. With R3ta , you will split large tables using WHERE clause. WHR files get generated. If you have mentioned CDCLS%2 in the input file for table splitting, then it generates 2~3 WHR files CDCLS-1, CDCLS-2 & CDCLS-3 (depending upon WHERE conditions)
2. While using MIGMON ( for sequencial / parallel export-import process), you have the choice of Package Order in th e properties file.
E.g : For Import - In the import_monitor_cmd.properties, specify
Package order: name | size | file with package names
orderBy=/upgexp/SOURCE/pkg_imp_order.txt
And in the pkg_imp_txt, I have specified the import package order as
BSIS-7
CDCLS-3
SAPAPPL1_184
SAPAPPL1_72
CDCLS-2
SAPAPPL2_2
CDCLS-1
Similarly , you can specify the Export package order as well in the export properties file ...
I hope this clarifies your doubt
Warm Regards,
SANUP.V -
Efficient Way of Inserting records into multiple tables
Hello everyone,
Im creating an employee application using struts framework. One of the functions of the application is to create new employees. This will involve using one web form. Upon submitting this form, a record will be inserted into two separate tables. Im using a JavaBean (Not given here) between the JSP page and the Java file (Which is partly given below). Now this Java file does work (i.e. it does insert a record into two seperate tables).
My question is, is there a more efficient way of doing the insert into multiple tables (in terms of performance) rather than the way I've done it as shown below? Please note, I am using database pooling and MySQL db. I thought about Batch processing but was having problems writing the code for it below.
Any help would be appreciated.
Assad
package com.erp.ems.db;
import com.erp.ems.entity.Employee;
import java.sql.Connection;
import java.sql.PreparedStatement;
import java.sql.ResultSet;
import java.sql.SQLException;
import java.util.Collection;
import java.util.ArrayList;
public class EmployeeDAO {
private Connection con;
public EmployeeDAO(Connection con) {
this.con = con;
// METHOD FOR CREATING (INSERTING) A NEW EMPLOYEE
public void create(Employee employee) throws CreateException {
PreparedStatement psemployee = null;
PreparedStatement psscheduleresource = null;
String sqlemployee = "INSERT INTO employee (FIRSTNAME,SURNAME,GENDER) VALUES (?,?,?)";
String sqlscheduleresource = "INSERT INTO scheduleresource (ITBCRATE,SKILLS) VALUES (?,?)";
try {
if (con.isClosed()) {
throw new IllegalStateException("error.unexpected");
// Insert into employee table
psemployee = con.prepareStatement(sqlemployee);
psemployee.setString(1,employee.getFirstName());
psemployee.setString(2,employee.getSurname());
psemployee.setString(3,employee.getGender());
// Insert into scheduleresource table
psscheduleresource = con.prepareStatement(sqlscheduleresource);
psscheduleresource.setDouble(1,employee.getItbcRate());
psscheduleresource.setString(2,employee.getSkills());
if (psemployee.executeUpdate() != 1 && psscheduleresource.executeUpdate() != 1) {
throw new CreateException("error.create.employee");
} catch (SQLException e) {
e.printStackTrace();
throw new RuntimeException("error.unexpected");
} finally {
try {
if (psemployee != null && psscheduleresource != null)
psemployee.close();
psscheduleresource.close();
} catch (SQLException e) {
e.printStackTrace();
throw new RuntimeException("error.unexpected");
}Hi ,
U can use
set Auto Commit function here ..
let it be false first
and when u do with u r all queries ..
make it true
this function take boolean values
i e helful when u want record to be inserted in all or not at all..
Hope it helps -
Insert into multiple table view
I have a view with multiple table query and and INSTEAD OF trigger on the view that inserts into multiple tables. When I attempt to do a commit out of a ADF Creation Form, I get the following error: ORA-01779: cannot modify a column which maps to a non key-preserved table ORA-06512: at line 1.
Has anyone had success inserting into multiple tables via a view that has more than one table?
Thanks,
LisaLisa,
Sounds like your instead-of trigger may not be being called and you are trying to insert directly into the view.
I did write a [url http://stegemanoracle.wordpress.com/2006/03/15/using-updatable-views-with-adf/]blog entry about using a view with instead-of triggers last year.
John -
Importing CSV files into Multiple Tables in One Database
I have a web based solution using Microsoft SharePoint and SQL Server that is created to centralize dat collection and reporting of program metrics used in montly reviews.
A person from each program enters dat manual or by pushing the data using automated data import tools. The user then is able to generate reports and provide presentations to their stakeholders.
There are are programs that are located in US and 2 that are located in Japan. All, including programs in Japan use the MS Project with a plug-in tool that allows them to auto input data. When the user click the "Send To.." button, the data goes
in to multiple tables in one database.
Everything is set up exactly the same for every program; however, we have discovered becase of a firewall, along with some of the different settings that the MS Project has over in Japan, the 2 program users are not able to auto import their data.
The suggestion is to have the program users export the MS Project file into a CSV and email it. I will then take it and convert the data, such as the dates and place them on a Network Drive. There will be 2 folders, one for each program.
I feel it will be an easy process just to load the data from the Network Drive into the same tables that are created for auto import.
My Concerns/Questions:
1. Should I create 1 SSIS package or should there be 2, one for each program?
2. US and Japan program users send their data once a month. The converted files are going to be saved in the location marked with a date (ex:201402). How can i have it to where SSIS will automatically load the data every time i place new files in the designated
folders or when i update an exsisting file?
Can you provide an example with your suggestion please?
I greatly appreciate the assistance!
Y_TylerHello Vikash,
Thank you! This will help me get started.
There will be 2 folders, one with files with Program A data and the other with files with Program B data. All will have the same fields, just coming from different programs. You stated that I will be able to to load both in one package. Would there be two
paths since there will be two separate folders?
Using the example you provided, i am confident that I can create the package using one path into one table but not sure how to get the files from 2 paths (if there is) into multiple tables.
Can you help clarify this for me?
Thank you!
Y_Tyler -
Insert data into multiple tables
Hi all,
I've a requirement where i need to insert data into multiple tables using PL/SQL procedure
Procedure should have two parameters
1. Table Name (parameter1)
2. Data (parameter2)
Based on these two parameters i need to insert data into table (parameter1) using data (parameter2)
ex:
Procedure insert_data (p_table IN VARCHAR2
,p_data IN -- what should be the datatype?
IS
l_statement VARCHAR2(2000);
BEGIN
-- insert data into tables
INSERT INTO p_table
values (....);
END insert_data;Thanks in advance!!BEDE wrote:
Amen to that!
So, I believe a better approach would be the following...
Suppose you have N datafiles with the same structure, and you wish to insert into the database the data from all those files.
For that, you should have a single table, named, say incoming_file_data, which should be structured more or less like below:
create table incoming_file_data (
filename varchar2(250) not null -- name of the file inserted from
,file_time timestamp -- timestamp when the data was inserted
,... -- the columns of meaningful data contained in the lines of those files
);And you will insert the data from all those files in this table, having normally one transaction for each file processed, for otherwise, when shit happens, some file may only get to be partially inserted into the table...
Maybe one good approach would be to create dynamically an external table for the file to be loaded, and then execute dynamically insert select into the table I said, so that you will have only one insert select for one file instead of using utl_file... RTM on that.If the file structures are the same, and it's just the filename that's changing, I would have a single external table definition, and use the alter table ... location ... statement (through execute immediate) to change the filename(s) as appropriate before querying the data. Of course that's not scalable if there are multiple users intenting to use this, but generally when we talk about importing multiple files, it's a one-user/one-off/once-a-day type of scenario, so multi-user isn't a consideration. -
Inserting into multiple tables on one form using UIX
We are developing an application using struts and UIX. We would like to be able to insert into three tables on one form(view). How can we accomplish this?
This is more of an ADF question, you'll need to set up view object, than just drag it from the data control palette like normal.
If it's not already set up as a view in the db (split into multiple tables), you'll need to create a view object that includes all the fields you want, based on multiple entity objects. -
How to insert one table data into multiple tables by using procedure?
How to insert one table data into multiple tables by using procedure?
Below is the simple procedure. Try the below
CREATE OR REPLACE PROCEDURE test_proc
AS
BEGIN
INSERT ALL
INTO emp_test1
INTO emp_test2
SELECT * FROM emp;
END;
If you want more examples you can refer below link
multi-table inserts in oracle 9i
Message was edited by: 000000 -
This is my first thread so I hope I have formatted my request appropriately...
If I have a simple XML doc with several records (see below) what is the best / easiest way to insert the data into multiple tables (Oracle 10g Release 1)?
For example 3 tables:
PATIENT table (CLAIMID, FNAME, LNAME, HEALTHNUM)
ADDRESS table (CLAIMID, STREET, CITY, PROVINCE)
SERVICE table (CLAIMID, SERVICE, ADMITDATE, DEPARTDATE)
<?xml version="1.0"?>
<CLAIMS>
<CLAIM>
<CLAIMID>1</CLAIMID>
<FNAME>Oscar</FNAME>
<LNAME>Grouch</LNAME>
<HEALTHNUM>1234657890</HEALTHNUM>
<STREET>123 Sesame Street</STREET>
<CITY>Sesameville</CITY>
<PROVINCE>ON</PROVINCE>
<SERVICE>Heart Surgery</SERVICE>
<ADMITDATE>2007-06-05</ADMITDATE>
<DEPARTDATE>2007-06-11</DEPARTDATE>
</CLAIM>
<CLAIM>
<CLAIMID>2</CLAIMID>
<FNAME>Poppa</FNAME>
<LNAME>Smurf</LNAME>
<HEALTHNUM>0987654321</HEALTHNUM>
<STREET>44 Blue Street</STREET>
<CITY>Smurfville</CITY>
<PROVINCE>ON</PROVINCE>
<SERVICE>Lung Transplant</SERVICE>
<ADMITDATE>2007-05-28</ADMITDATE>
<DEPARTDATE>2007-06-04</DEPARTDATE>
</CLAIM>
...more <CLAIM> records
</CLAIMS>
I can import the XML document into an XMLType column but don't know where to go from there...
The extractValue method seems to work only when there is a single claim record in the XML document but a typical document will contain several hundred claims.
Thanks in advance,
M KentUse the Oracle Berkeley DB XML to store the XML document in a embedded xml database. To store in the Oracle 10g database use XSU. With XSU an XML document may also be stored in multiple tables.
http://download-east.oracle.com/docs/cd/A97329_03/web.902/a88894/adx07xsu.htm#1016732 -
XML document into multiple tables
How to insert a xml document into multiple tables. Eg. Purchase Order having multiple line items. I have to insert xml document into Parent as well as child with different sets of columns.
I created the tables using the create_ch14_tables.sql. I call it using java -classpath .;C:\commerceone\xpc\lib\xmlparserv2.jar;C:\commerceone\xpc\lib\classes12.zip;C:\commerceone\xpc\lib\xsu12.jar XMLLoader -file deptempdepend.xml -connName default -transform deptempdepend.xsl. The code doesn't seem to like the "<xsl:for-each select="Department">" tags. If I remove them, the insDoc.getDocumentElement().getFirstChild() will find the element, but it still doesn't insert anything into the database.
Thank You,
Dave -
Inserting data into multiple tables in jdbc
I am doing on file to jdbc. Now I got a requirement to insert data into multiple tables on the receiver side. How can I do this ?
Hi,
you are going to insert data into 4 tables in a sequence one after another , I see three options.
1) Stored procedure and 2) creating 4 statement data structure (one for each table)
The third option is writing a SQL with join for the 4 tables and use action command = SQL_DML. Example as follows....
Write SQL code and place it in access tag. Pass values for the columns using key tag...
<stmt>
<Customers action="SQL_DML">
<access> UPDATE Customers SET CompanyName=u2019$NAME$u2019, Address=u2019$ADDRESS$' WHERE CustomerID='$KEYFIELD$u2019
</access>
<key>
<NAME>name</NAME>
<ADDRESS>add </ADDRESS>
<KEYFIELD>1</KEYFIELD>
</key>
</Customers>
</stmt>
Refer this http://help.sap.com/saphelp_nwpi71/helpdata/en/44/7b7855fde93673e10000000a114a6b/content.htm
Hope this helps .... -
BizTalk 2013 R2 - Oracle client (Insert into Multiple tables) CompositE Transaction
I know there is Composite Transaction of inserting into multiple tables in SQL.
Is there a way where we can have inserts into multiple table at once ? If yes, can anyone please provide step by step procedure to achieve this
MBHHere is a link on using Oracle DB w/ composite operations:
Performing Composite Operations on Oracle Database by Using BizTalk Server
Rachit
Please mark as answer or vote as helpful if my reply does -
Insert internal table into datbase table
Hi,
I want to insert internal table into database table.
i have use following code
loop at it_header.
INSERT ZTAB from table it_header accepting duplicate keys.
endloop.
but above code insert only first line not multipal.
Thanks in Advance.
SamHi SAM,
Creating a SingleRecord -
>>>>
INSERT INSERT INTO <dbtab> VALUES <wa>.
Eg. DATAwa_spfliTYPEspfli.
wa_spfli-carrid = 'LH'.
wa_spfli-connid = '0007'.
wa_spfli-cityto = 'SINGAPORE'.
INSERT INTO spfli VALUES wa_spfli.
Fsy-subrc NE 0.
Creating Several Records---->>>>
INSERT <dbtab> FROM TABLE <itab>.
Eg.
DATA:it_spfli TYPE STANDARD TABLE OF spfli,
wa_itab LIKE LINE OF it_spfli.
wa_itab-carrid= 'LH'.
wa_itab-connid= '0009'.
wa_itab-cityto= 'HONGKONG'.
APPEND wa_itab TO it_spfli.
APPEND wa_itab TO it_spfli.
INSERT spfli FROM TABLE it_spfli.
IFsy-subrc NE 0. -
How to join THREE different tables into internal table using one select statement .
How to join THREE different tables into internal table using one select statement .
Hi experts,
I would like to request your guidance in solving the problem of joining the data from three different database tables into one internal table
Scenario:
Database tables:
SPFLI
SFLIGHT
SBOOK.
Table Fields:
SPFLI - CARRID CONNID COUNTRYFR CITYFRM COUNTRYTO CITYTO
SFLIGHT - CARRID CONNID FLDATE SEATSMAX SEATSOCC SEATSMAX_C
SEATSOCC_C SEATSMAX_F SEATSOCC_F
SBOOK - CARRID CONNID CLASS
MY INTERNAL TABLE IS IT_XX.
Your help much appreciated.
Thanks in advance.
Pawan.Hi Pawan,
please check below codes. hope it can help you.
TYPES: BEGIN OF ty_xx,
carrid TYPE spfli-carrid ,
connid TYPE spfli-connid ,
countryfr TYPE spfli-countryfr,
cityfrom TYPE spfli-cityfrom ,
countryto TYPE spfli-countryto,
cityto TYPE spfli-cityto ,
fldate TYPE sflight-fldate ,
seatsmax TYPE sflight-seatsmax ,
seatsocc TYPE sflight-seatsocc ,
seatsmax_b TYPE sflight-seatsmax_b,
seatsocc_b TYPE sflight-seatsocc_b,
seatsmax_f TYPE sflight-seatsmax_f,
seatsocc_f TYPE sflight-seatsocc_f,
class TYPE sbook-class,
END OF ty_xx,
t_xx TYPE STANDARD TABLE OF ty_xx.
DATA: it_xx TYPE t_xx.
SELECT spfli~carrid
spfli~connid
spfli~countryfr
spfli~cityfrom
spfli~countryto
spfli~cityto
sflight~fldate
sflight~seatsmax
sflight~seatsocc
sflight~seatsmax_b
sflight~seatsocc_b
sflight~seatsmax_f
sflight~seatsocc_f
sbook~class
INTO TABLE it_xx
FROM spfli INNER JOIN sflight
ON spfli~carrid = sflight~carrid
AND spfli~connid = sflight~connid
INNER JOIN sbook
ON spfli~carrid = sbook~carrid
AND spfli~connid = sbook~connid.
Thanks,
Yawa
Maybe you are looking for
-
Java ME 3.0 is not running on Window-7 OS (64-bit)
HI there! My laptop cant handle this issue with the WTK, I have a 64 bit Windows 7 Platform, and I just installed WTK and running my Proyect I always get this: CAN ANYBODY HELP ME WITH THIS ? java.lang.UnsatisfiedLinkError: C:\WTK2.5.2_01\bin\sublime
-
I currently have a PC based WiFi network and am about to buy a MacBook Pro. I have 250 gb iTunes library and 100+ gb of photos. What I was going to get is the 120gb MacBook and run an external drive to store the iTunes library and photos. For intensi
-
When i create a portlet using JDeveloper 10.1.3.2 or 9.0 + portlet extension when i deploy it to Liferay Portal all versions and when i add the portlet somewhere the portal console prints me infinitive stacktrace... and the portlet never viewed i thi
-
[SOLVED] jack2dbus is running but I can't seem to use Qtractor/Ardour
Hello, Earlier I had alsa installed together with jack2 and both worked fine - I could record my songs in Qtractor without any problems. But I reecently bought GuitarPro software for Linux which needs a pulseaudio to work. So I installed the pulseaud
-
Connecting TV and Computer Speakers at the same t
Hi, I have a SB Li've Value and I wanted to connect my regular computer speakers as well as my TV to it. I am using a mono plug to hook my computer speakers and my TV currently. Whenever I want output on my TV I have to unhook my computer speakers fr