Load Multiple Table using SQLLDR
Hi,
We are trying to Load Multiple Table using SQLLDR in same loading session.
Here's a snippet of our script:
LOAD DATA INFILE '/u07/dd/yyyy_mm_dd.dat'
append INTO TABLE table1
WHEN STORE_NO != ' '
STORE_NO position(1:5) ,
TR_DATE position(6:27) DATE "mm/dd/yy
truncate INTO TABLE table2
WHEN STORE_NO != ' '
STORE_NO position(1:5) ,
TR_DATE position(6:27) DATE "mm/dd/yy
Now upon execution this gives an error saying truncate shouldn't be present before 2nd INTO Clause. The script runs fine if we do same operation say Append / Replcae / Truncate on both tables. My Question here is can we have SQLLDR perform two diff operations (Append & Truncate in our case) in one session?
Thanks
Chinmay
PS: Referred to http://www.orafaq.com/wiki/SQL*Loader_FAQ#Can_one_load_data_from_multiple_files.2F_into_multiple_tables_at_once.3F already
No.
did you read the syntax diagram and the paragraph below:
"When you are loading a table, you can use the INTO TABLE clause to specify a table-specific loading method (INSERT, APPEND, REPLACE, or TRUNCATE) that applies only to that table. That method overrides the global table-loading method. The global table-loading method is INSERT, by default, unless a different method was specified before any INTO TABLE clauses."
Similar Messages
-
SQL Loader : Loading multiple tables using same ctl file
Hi ,
We tried loading multiple tables using the same ctl file but the data was not loaded and no errors were thrown.
The ctl file content is summarised below :
LOAD DATA
APPEND INTO TABLE TABLE_ONE
when record_type ='EVENT'
TRAILING NULLCOLS
record_type char TERMINATED BY ',' ,
EVENT_SOURCE_FIELD CHAR TERMINATED BY ',' ENCLOSED BY '"',
EVENT_DATE DATE "YYYY-MM-DD HH24:MI:SS" TERMINATED BY ',' ENCLOSED BY '"',
EVENT_COST INTEGER EXTERNAL TERMINATED BY ',' ENCLOSED BY '"',
EVENT_ATTRIB_1 CHAR TERMINATED BY ',' ENCLOSED BY '"',
VAT_STATUS INTEGER EXTERNAL TERMINATED BY ',' ENCLOSED BY '"',
ACCOUNT_REFERENCE CONSTANT 'XXX',
bill_date "to_date('02-'||to_char(sysdate,'mm-yyyy'),'dd-mm-yyyy')",
data_date "trunc(sysdate)",
load_date_time "sysdate"
INTO TABLE TABLE_TWO
when record_type ='BILLSUMMARYRECORD'
TRAILING NULLCOLS
RECORD_TYPE char TERMINATED BY ',' ,
NET_TOTAL INTEGER EXTERNAL TERMINATED BY ',' ENCLOSED BY '"',
LOAD_DATE_TIME "sysdate"
INTO TABLE BILL_BKP_ADJUSTMENTS
when record_type ='ADJUSTMENTS'
TRAILING NULLCOLS
RECORD_TYPE char TERMINATED BY ',' ,
ADJUSTMENT_NAME CHAR TERMINATED BY ',' ENCLOSED BY '"',
LOAD_DATE_TIME "sysdate"
INTO TABLE BILL_BKP_CUSTOMERRECORD
when record_type ='CUSTOMERRECORD'
TRAILING NULLCOLS
RECORD_TYPE char TERMINATED BY ',' ,
GENEVA_CUSTOMER_REF CHAR TERMINATED BY ',' ENCLOSED BY '"',
LOAD_DATE_TIME "sysdate"
INTO TABLE TABLE_THREE
when record_type ='PRODUCTCHARGE'
TRAILING NULLCOLS
RECORD_TYPE char TERMINATED BY ',' ,
PROD_ATTRIB_1_CHRG_DESC CHAR TERMINATED BY ',' ENCLOSED BY '"',
LOAD_DATE_TIME "sysdate"
Has anyone faced similar errors or are we going wrong somewhere ?
Regards,
SandipanThis is the info on the discard in the log file :
Record 1: Discarded - failed all WHEN clauses.
Record 638864: Discarded - failed all WHEN clauses.
While some of the records were loaded for one table.
Regards,
Sandipan -
SQL Loader to Load Multiple Tables from Multiple Files
Hi
I wish to create a control file to load multiple tables from multiple files
viz.Emp.dat into emp table and Dept.dat into Dept table and so on
How could I do it?
Can I create a control file like this:
OPTIONS(DIRECT=TRUE,
SKIP_UNUSABLE_INDEXES=TRUE,
SKIP_INDEX_MAINTENANCE=TRUE)
UNRECOVERABLE
LOAD DATA
INFILE 'EMP.dat'
INFILE 'DEPT.dat'
INTO TABLE emp TRUNCATE
FIELDS TERMINATED BY "|" OPTIONALLY ENCLOSED BY '"'
(empno,
ename,
deptno)
INTO TABLE dept TRUNCATE
FIELDS TERMINATED BY "|" OPTIONALLY ENCLOSED BY '"'
(deptno,
dname,
dloc)
Appreciate a Quick Reply
mailto:[email protected]Which operating system? ("Command Prompt" sounds like Windows)
UNIX/Linux: a shell script with multiple calls to sqlldr run in the background with "&" (and possibly nohup)
Windows: A batch file using "start" to launch multiple copies of sqlldr.
http://www.pctools.com/forum/showthread.php?42285-background-a-process-in-batch-%28W2K%29
http://www.microsoft.com/resources/documentation/windows/xp/all/proddocs/en-us/start.mspx?mfr=true
Edited by: Brian Bontrager on May 31, 2013 4:04 PM -
Loading multiple tables with SQL Loader
Hi,
I want to load multiple tables from a single data file using SQL Loader.
Here's the basic idea of what I want. Let's say I have two tables, table =T1
and table T2:
SQL> desc T1;
COL1 VARCHAR2(20)
COL2 VARCHAR2(20)
SQL> desc T2;
COL1 VARCHAR2(20)
COL2 VARCHAR2(20)
COL3 VARCHAR2(20)
My data file, test.dat, looks like this:
AAA|KBA
BBR|BBCC|CCC
NNN|BBBN|NNA
I want to load the first record into T1, and the second and third record load into T2. How do I set up my control file to do that?
Thank!Tough Job
LOAD DATA
truncate
INTO table t1
when col3 = 'dummy'
FIELDS TERMINATED BY '|'
TRAILING NULLCOLS
(col1,col2,col3 filler char nullif col3='dummy')
INTO table t2
when col3 != 'dummy'
FIELDS TERMINATED BY '|'
(col1,col2,col3 nullif col3='dummy')
This will load t2 tbl but not t1.
T1 Filler col3 is not accepting nullif. Its diff to compare columns have null using when condition. If i find something i will let you know.
Can you seperate records into 2 file. Will a UNIX command work for you which will seperate 2col and 3col record types for you. and then you can execute 2 controlfiles on it.
Thanks,
http://www.askyogesh.com -
Adding data to multiple tables using one form in Access 2010?
Hi All,
I have a access database with two tables and I want to create a single form to enter data into that tables.
How to adding data to multiple tables using one form in Access 2010?
I don't have to much knowledge of access database?
Please help me
Thanks
BalajiYou really don't enter identical data into 2 tables. You enter dat into one single table, and then you have an unique identifier that maps to another table (you have a unique relationship between two tables).
Maybe you need to read this.
http://office.microsoft.com/en-001/access-help/database-design-basics-HA001224247.aspx
Think about it this way... What is you update data in 2 tables, and then the data in one of those tables changes, but the data in the other table does NOT change. WHOOPS!! Now, you've got a BIG problem. For instance, you have a customer
named Bill Gates. In one Table you update Bill's address to 1835 73rd Ave NE, Medina, WA 98039 and in the other table you accidentally update Bill's address to 183 73rd Ave NE, Medina, WA 98039. Now you have 2 addresses for Bill. Why would
you want that??? Which is right? No one knows. If you have one address, you just have to update one address and if there is a mistake, you just have to update one address, but you don't have to waste time trying to figure out which is right
and which is wong...and then update the one that is wrong.
Post back with specific questions.
Knowledge is the only thing that I can give you, and still retain, and we are both better off for it. -
Load multiple files using the same data load location
has anybody tried loading multiple files using the same load locations. I need to do this as the data in these multiple files will need to be exported from FDM as a single export file. the problem i am facing is more user related. since these files will be received at different points of time, users will need a way to tell them what has been loaded and what is yet to be loaded.
is it possible to throw a window on the web broser with OK and Cancel buttons from an event script?
any pointers to possible solutions will be helpfulwas able to resolve this. the implementation method is as follows
take a back up of previously imported data in the befcleardata event script. then in the beffileimport event append the data to the import file. there are many other intricacies but this is the broad implementation logic. it allowed my users to load multiple files without worrying about append or replace import type choices -
ORA-00054 error when loading Oracle table using Data Services
Hello,
we are facing ORA-00054 error when loading Oracle table using BO Data services
(Oracle 10g database, BODS Xi 3.2 SP3)
Test Job performs
1- truncate table
2- load table (tested in standard and bulk load modes)
Scenario when issue happens is:
1- Run loading Job
2- Job end in error for any Oracle data base error
3- When re-running the same Job, Job fails with following error
ORA-00054: resource busy and acquire with NOWAIT specified
It seems after first failure, Oracle session for loading the table stays active and locks the table.
To be able to rerun the Job, we are forced need to kill Oracle session manually to be able to run the Job again.
Expected behaviour would be : on error rollback modifications made on table and BODS stops Oracle session in a clean way.
Can somebody tell me / or point me to any BODS best practice about Oracle error handling to prevent such case?
Thanks in advance
Paul-Mariethe ora-0054 can occure depending how the job failed before. If this occures you will need the DBA to release the lock on the table in question
Or
AL_Engine.exe on The server it creates the Lock. Need to Kill Them. Or stop it..
This Problem Occurs when we select The Bulkloading Option in orclae We also faced the same issue,Our admin has Killed the session. Then everything alright. -
Code to update a table using sqlldr
Hi all,
can anybody give the code to update a table using sqlldr with an example
thank youYou want add the new line and modified the existing line (based on empno) from file e:\scripts\sql\emp2_ext.dat into table emp2 :
7782,CLARK,MANAGER,7839,09/06/81,80000,,10
8000,ORACLE,DATABASE,,11/02/07,99999,,20Then :
SQL> conn system/mypwd
Connected.
SQL>
SQL> create directory my_dir as 'e:\scripts\sql';
Directory created.
SQL>
SQL> grant read,write on directory my_dir to scott;
Grant succeeded.
SQL>
SQL> conn scott/mypwd
Connected.
SQL> create table emp2_ext
2 (EMPNO NUMBER(4),
3 ENAME VARCHAR2(10),
4 JOB VARCHAR2(9),
5 MGR NUMBER(4),
6 HIREDATE DATE,
7 SAL NUMBER(7,2),
8 COMM NUMBER(7,2),
9 DEPTNO NUMBER(2)
10 )
11 ORGANIZATION EXTERNAL
12 ( TYPE ORACLE_LOADER
13 DEFAULT DIRECTORY my_dir
14 ACCESS PARAMETERS
15 ( records delimited by newline
16 badfile my_dir:'emp2_ext.bad'
17 logfile my_dir:'emp2_ext.log'
18 fields terminated by ','
19 missing field values are null
20 ( empno, ename, job, mgr, hiredate char date_format date mask "dd/mm/yy",
21 sal, comm, deptno
22 )
23 ) LOCATION ('emp2_ext.dat')
24 ) ;
Table created.
SQL>
SQL> select * from emp2_ext;
EMPNO ENAME JOB MGR HIREDATE SAL COMM DEPTNO
7782 CLARK MANAGER 7839 09/06/81 80000 10
8000 ORACLE DATABASE 11/02/07 99999 20
SQL> select * from emp2;
EMPNO ENAME JOB MGR HIREDATE SAL COMM DEPTNO
7782 CLARK MANAGER 7839 09/06/81 24500 10
7839 KING PRESIDENT 17/11/81 50000 10
7934 MILLER CLERK 7782 23/01/82 13000 10
SQL> merge into emp2 a
2 using (select * from emp2_ext) b
3 on (a.empno=b.empno)
4 when matched then update set a.ename=b.ename,
5 a.job=b.job,
6 a.mgr=b.mgr,
7 a.hiredate=b.hiredate,
8 a.sal=b.sal,
9 a.comm=b.comm,
10 a.deptno=b.deptno
11 when not matched then insert (a.empno, a.ename, a.job, a.mgr, a.hiredate, a.sal, a.comm, a.deptno)
12 values (b.empno, b.ename, b.job, b.mgr, b.hiredate, b.sal, b.comm, b.deptno);
2 rows merged.
SQL>
SQL> select * from emp2;
EMPNO ENAME JOB MGR HIREDATE SAL COMM DEPTNO
7782 CLARK MANAGER 7839 09/06/81 80000 10 --modified line
7839 KING PRESIDENT 17/11/81 50000 10
7934 MILLER CLERK 7782 23/01/82 13000 10
8000 ORACLE DATABASE 11/02/07 99999 20 --added line
SQL> HTH,
Nicolas.
Well, Hans has already give good explanation with docs links...
Message was edited by:
N. Gasparotto -
Updating multiple tables using JDBC Adapter
Hi,
I am trying to insert/update multiple tables using one message via JDBC adapter. The following is the message being posted. However, only the first statement was executed. Anything wrong?
Thanks in advance!
Hart
<?xml version="1.0" encoding="UTF-8"?>
<ns0:DeliveryDBUpdate xmlns:ns0="http://test.com/r3_integration"><DeliveryData><DelHeader action="UPDATE_INSERT"><table>DelHeader</table><access><DelNo>0080000230</DelNo><DelType>LF</DelType><XOverwrite>X</XOverwrite><ShipTo>0000000026</ShipTo><SoldTo>0000000026</SoldTo><Priority>00</Priority><DocDate>02/17/2007</DocDate><GText>CIF Test</GText><DelDate>02/20/2007</DelDate><PickDate>02/20/2007</PickDate><ShipPoint>NO02</ShipPoint><PackCount>00000</PackCount></access><key><DelNo>0080000230</DelNo></key></DelHeader>
<DelItem action="INSERT"><table>DelItem</table><access><DelNo>0080000230</DelNo><ItemNo>000010</ItemNo><GText>10# GRAN-GREAT VALUE</GText><Material>G04410G611</Material><Plant>6005</Plant><SLoc>6005</SLoc><RefDoc>mmenon32</RefDoc><RefItem>00000000</RefItem><DelQty>5.000</DelQty><UOM>BL</UOM></access><access><DelNo>0080000230</DelNo><ItemNo>000020</ItemNo><GText>25# GRAN- GREAT VALUE</GText><Material>G04025G611</Material><Plant>6005</Plant><SLoc>6005</SLoc><RefDoc>mmenon32</RefDoc><RefItem>00000000</RefItem><DelQty>5.000</DelQty><UOM>BG</UOM></access></DelItem></DeliveryData></ns0:DeliveryDBUpdate>Hi,
You need 2 STATEMENT level tags,
<?xml version="1.0" encoding="UTF-8"?>
<ns0:DeliveryDBUpdate xmlns:ns0="http://test.com/r3_integration">
<b><DeliveryData1></b>
<DelHeader action="UPDATE_INSERT">
<table>DelHeader</table>
<access>
<DelNo>0080000230</DelNo>
<DelType>LF</DelType>
<XOverwrite>X</XOverwrite>
<ShipTo>0000000026</ShipTo>
<SoldTo>0000000026</SoldTo>
<Priority>00</Priority>
<DocDate>02/17/2007</DocDate>
<GText>CIF est</GText>
<DelDate>02/20/2007</DelDate>
<PickDate>02/20/2007</PickDate>
<ShipPoint>NO02</ShipPoint>
<PackCount>00000</PackCount>
</access>
<key>
<DelNo>0080000230</DelNo>
</key>
</DelHeader>
<b><DeliveryData1></b>
<b><DeliveryData2></b>
<DelItem action="INSERT">
<table>DelItem</table>
<access>
<DelNo>0080000230</DelNo>
<ItemNo>000010</ItemNo>
<GText>10# GRAN-GREAT VALUE</GText>
<Material>G04410G611</Material>
<Plant>6005</Plant>
<SLoc>6005</SLoc>
<RefDoc>mmenon32</RefDoc>
<RefItem>00000000</RefItem>
<DelQty>5.000</DelQty>
<UOM>BL</UOM>
</access>
<access>
<DelNo>0080000230</DelNo>
<ItemNo>000020</ItemNo>
<GText>25# GRAN- GREAT VALUE</GText>
<Material>G04025G611</Material>
<Plant>6005</Plant>
<SLoc>6005</SLoc>
<RefDoc>mmenon32</RefDoc>
<RefItem>00000000</RefItem>
<DelQty>5.000</DelQty>
<UOM>BG</UOM>
</access>
</DelItem>
<b></DeliveryData2></b>
</ns0:DeliveryDBUpdate>
Try with such a strcuture and let us know if it works.
Regards
Bhavesh -
Load Multiple Images using link in Crystal Report
Hi Guys,
I am currently in need of developing a new requirement for our company's client. We have to load multiple images using just link in Crystal Report. Let's say that the images are stored in a folder (e.g., C:\Datafolder\Images\) and i have to fetch two images to show in crystal report (say, C:\Datafolder\Images\imageval1 and C:\Datafolder\Images\imageval2). These are actually dynamically created and therefore the number of images are not known and so i have to iterate through the list of image links.
Is it possible using merely crystal report and how?. Please take note that we're also using C# in developing our software applications.
Thanks and best regards.
---CHITO--Hi Chito,
You cannot load multiple images dynamically. Using the 'graphic location' formula for the OLE Object, you can only point to a location that can load one image.
For the second image, you'll need to manually insert another OLE Object and point the formula to the next image's location.
You can try posting to the SAP Crystal Reports, version for Visual Studio space to find out whether this can be done using CR SDK.
-Abhilash -
Loading data into multiple tables using sqlloader
Hi,
I am using sql loader to load the data from flat file into the data base
my file structure is as below
====================
101,john,mobile@@fax@@home@@office@@email,1234@@3425@@1232@@2345@@[email protected],1234.40
102,smith,mobile@@fax@@home,1234@@345@@234,123.40
103,adams,fax@@mobile@@office@@others,1234@@1233@@1234@@3456,2345.40
in file first columns are empno,ename,comm_mode(multiple values terminated by '@@'),comm_no_txt(multiple values terminated by '@@'), sal
the comm_mode and comm_no_text needs to be inserted into the separate table (emp_comm) like below
emp
empno ename sal
101 john 1234.40
102 smith 123.40
103 adams 2345.40
emp_comm
empno comm_mode comm_no_text
101 mobile 1234
101 fax 3425
101 home 1232
101 office 2345
101 email [email protected]
102 mobile 1234
102 fax 345
102 home 234
103 fax 1234
like this needs to insert the data using sql loader
my table structures
===============
emp
empno number(5)
ename varchar2(15)
sal number(10,2)
emp_comm
empno number(5) reference the empno of the emp table
comm_mode varchar2(10)
Comm_no_text varchar2(35)
now i want insert the file data into the specified structues
please help me out to achieve this using sql loader
(we are not using external tables for this)
Thanks & Regards.
Bala Sake
Edited by: 954925 on Aug 25, 2012 12:24 AMPl post OS and database details
You will need to split up the datafile in order to load into separate tables. The process is documented
http://docs.oracle.com/cd/E11882_01/server.112/e22490/ldr_control_file.htm#autoId72
HTH
Srini -
Getting ORA-22805 when trying to load XML file using SQLLDR
I'm trying to learn the basics of XML since we'll be getting XML files in the near future. I'm using one of the sample schemas that comes with XMLSPY. I loaded this schema into an 11g Oracle DB using XMLSPY:
<?xml version="1.0" encoding="UTF-8"?>
<!-- edited with XML Spy v4.0 NT beta 1 build Jun 13 2001 (http://www.xmlspy.com) by Alexander Falk (Altova, Inc.) -->
<schema xmlns="http://www.w3.org/2001/XMLSchema" xmlns:ipo="http://www.altova.com/IPO" targetNamespace="http://www.altova.com/IPO" elementFormDefault="unqualified" attributeFormDefault="unqualified">
<annotation>
<documentation>
International Purchase order schema for Example.com
Copyright 2000 Example.com. All rights reserved.
</documentation>
</annotation>
<!-- include address constructs -->
<include schemaLocation="address.xsd"/>
<element name="purchaseOrder" type="ipo:PurchaseOrderType"/>
<element name="comment" type="string"/>
<complexType name="PurchaseOrderType">
<sequence>
<element name="shipTo" type="ipo:Address"/>
<element name="billTo" type="ipo:Address"/>
<element ref="ipo:comment" minOccurs="0"/>
<element name="Items" type="ipo:Items"/>
</sequence>
<attribute name="orderDate" type="date"/>
</complexType>
<complexType name="Items">
<sequence>
<element name="item" minOccurs="0" maxOccurs="unbounded">
<complexType>
<sequence>
<element name="productName" type="string"/>
<element name="quantity">
<simpleType>
<restriction base="positiveInteger">
<maxExclusive value="100"/>
</restriction>
</simpleType>
</element>
<element name="price" type="decimal"/>
<element ref="ipo:comment" minOccurs="0"/>
<element name="shipDate" type="date" minOccurs="0"/>
</sequence>
<attribute name="partNum" type="ipo:Sku"/>
</complexType>
</element>
</sequence>
</complexType>
<simpleType name="Sku">
<restriction base="string">
<pattern value="\d{3}-[A-Z]{2}"/>
</restriction>
</simpleType>
</schema>
Then I created an XMLType table:
CREATE TABLE purchaseOrder OF XMLType
XMLSCHEMA "ipo.xsd" ELEMENT "purchaseOrder"
I'm trying to load the sample XML file ipo.xml into purchaseOrder using SQLLDR. This is ipo.xml:
<?xml version="1.0"?>
<!-- edited with XMLSPY v2004 rel. 4 U (http://www.xmlspy.com) by Mr. Nobody (Altova GmbH) -->
<ipo:purchaseOrder xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:ipo="http://www.altova.com/IPO" orderDate="1999-12-01" xsi:schemaLocation="http://www.altova.com/IPO
ipo.xsd">
<shipTo export-code="1" xsi:type="ipo:EU-Address">
<ipo:name>Helen Zoe</ipo:name>
<ipo:street>47 Eden Street</ipo:street>
<ipo:city>Cambridge</ipo:city>
<ipo:postcode>126</ipo:postcode>
</shipTo>
<billTo xsi:type="ipo:US-Address">
<ipo:name>Robert Smith</ipo:name>
<ipo:street>8 Oak Avenue</ipo:street>
<ipo:city>Old Town</ipo:city>
<ipo:state>AK</ipo:state>
<ipo:zip>95819</ipo:zip>
</billTo>
<Items>
<item partNum="833-AA">
<productName>Lapis necklace</productName>
<quantity>2</quantity>
<price>99.95</price>
<ipo:comment>Need this for the holidays!</ipo:comment>
<shipDate>1999-12-05</shipDate>
</item>
<item partNum="748-OT">
<productName>Diamond heart</productName>
<quantity>1</quantity>
<price>248.90</price>
<ipo:comment>Valentine's day packaging.</ipo:comment>
<shipDate>2000-02-14</shipDate>
</item>
<item partNum="783-KL">
<productName>Uncut diamond</productName>
<quantity>7</quantity>
<price>79.90</price>
<shipDate>2000-01-07</shipDate>
</item>
<item partNum="238-KK">
<productName>Amber ring</productName>
<quantity>3</quantity>
<price>89.90</price>
<ipo:comment>With no inclusions, please.</ipo:comment>
<shipDate>2000-01-07</shipDate>
</item>
<item partNum="229-OB">
<productName>Pearl necklace</productName>
<quantity>1</quantity>
<price>4879.00</price>
<shipDate>1999-12-05</shipDate>
</item>
<item partNum="128-UL">
<productName>Jade earring</productName>
<quantity>5</quantity>
<price>179.90</price>
<shipDate>2000-02-14</shipDate>
</item>
</Items>
</ipo:purchaseOrder>
This is what's in the control file:
LOAD DATA
INFILE *
INTO TABLE purchaseOrder TRUNCATE
xmltype(xmldata)
FIELDS
xmldata LOBFILE (CONSTANT ipo.xml)
BEGINDATA
0
The load fails with:
Record 1: Rejected - Error on table PURCHASEORDER.
ORA-22805: cannot insert NULL object into object tables or nested tables
Another question I have is, how do we know how many records (0's) to specify in the control file? In this case there's only one but when real files are used we won't know how many are in the file.
Thanks for your help!The concept was "Don't use SQL*Loader to parse XML".
You can use SQL*Loader to load an entire XML document into the DB. That is fine. You can do the same via BFILENAME to read in files from disk as well.
If you want to parse XML, do that from within Oracle via PL/SQL and/or SQL. The solution depends upon your version of Oracle and what is good enough for you in terms of performance.
So the basics are
a) How am I getting the information?
b) How am I getting in into Oracle?
c) How do I want to parse it?
As I see the schema, it only allows for one ipo:purchaseOrder node in the document, since that is the root node. If you have multiple in the incoming file, you no longer have valid XML, both per the schema and because you have no single root node. You have an XML fragment, which must be treated different.
Just trying to understand the question since I now realize it does not agree with what the schema in your initial example shows. -
Load Multiple Tables (schemas) from same XML file
Hi,
This is first time i am working XML files.
I have one XML file with two tables (schema). I need to load those two tables into two different Target tables.
This is the startegy to choose tables.
<Entry type="full"> --Table 1
<Entry type="short">--Table 2
I am try to find the tables like this using condition split (Type == "Full" ) but tables are not splitting as expected, is am i going with wrong approach??
Can anyone suggest me to process multiples tables from same XML file??Hi Naveen,
After the issue in my environment, the package works well that the data in the XML file load to two destination tables based on one column values. The screenshot is for your reference:
To troubleshoot this issue, could you please check the values in the type column? Verify the values have exactly the same characters, case sensitivity. It seems that you haven’t write correct values in the Conditional Split Transformation. They should be like
below:
If there are any other questions, please feel free to ask.
Thanks,
Katherine Xiong
If you have any feedback on our support, please click
here.
Katherine Xiong
TechNet Community Support -
How to update multiple tables using results from query
I'm a bit rusty on this stuff and am hoping for some help.
Table 1 is:
location_id, location_name
Table 2 is
location_id, employee_id and misc. other columns
Then there are multiple tables with associated data, keys being location_id and employee_id.
There are no established relationships.
Trying to come up with a process to change location_id for all employees assigned to a particular location.
It seems to me that the basics are
select employee_id from Table2 where location_id='xxxxxx'
Then take each employee_id returned and change their location_id in each of the other tables
I'm not clear on how to load the returned employee id's as variables and then loop through them.
ThanksThanks for the welcome. I'll read up on the rules now.
Below is the DDL for a couple of the tables.
Version = 11g
I would query the users table for all users with a certain site_id and then use them to update the site_id in the users table (and other tables)
-- DDL for Table USERS
CREATE TABLE "USERS"
( "USERID" VARCHAR2(8 BYTE),
"PASSWORD" VARCHAR2(50 BYTE),
"FIRST_NAME" VARCHAR2(50 BYTE),
"LAST_NAME" VARCHAR2(50 BYTE),
"SITE_ID" VARCHAR2(5 BYTE),
"ROLE_ID" VARCHAR2(1 BYTE)
) SEGMENT CREATION IMMEDIATE
PCTFREE 10 PCTUSED 40 INITRANS 1 MAXTRANS 255 NOCOMPRESS LOGGING
STORAGE(INITIAL 65536 NEXT 1048576 MINEXTENTS 1 MAXEXTENTS 2147483645
PCTINCREASE 0 FREELISTS 1 FREELIST GROUPS 1 BUFFER_POOL DEFAULT FLASH_CACHE DEFAULT CELL_FLASH_CACHE DEFAULT)
TABLESPACE "SITES_DATA_TS"
CACHE ;
-- DDL for Table EMPLOYEE_PROFILE
CREATE TABLE "EMPLOYEE_PROFILE"
( "EMPLOYEEID" VARCHAR2(9 BYTE),
"PROGRAM" NUMBER,
"REQUIREMENT" NUMBER,
"JOBNUM" VARCHAR2(50 BYTE),
"STATUS" VARCHAR2(50 BYTE),
"PROGRAM_TYPE" VARCHAR2(50 BYTE),
"SITE_ID" VARCHAR2(5 BYTE),
"NUM_QUAL_TEST_ATTEMPTS" NUMBER(7,0)
) SEGMENT CREATION IMMEDIATE
PCTFREE 10 PCTUSED 40 INITRANS 1 MAXTRANS 255 NOCOMPRESS LOGGING
STORAGE(INITIAL 65536 NEXT 1048576 MINEXTENTS 1 MAXEXTENTS 2147483645
PCTINCREASE 0 FREELISTS 1 FREELIST GROUPS 1 BUFFER_POOL DEFAULT FLASH_CACHE DEFAULT CELL_FLASH_CACHE DEFAULT)
TABLESPACE "SITES_DATA_TS"
CACHE ; -
Best Practice to load multiple Tables
Hi,
Am trying to load around 9-10 tables in sql server.all these belong to a single project.
table loads are just select * into destination table,using some joins.
Is it good to have 1 stored proc to load all these tables or individual stored procs to load.
All these tables are independent to each other.
Appreciate your help !If you are using SQL Server 2008 and onwards take a look into this link (Minimal logging)
http://blogs.msdn.com/sqlserverstorageengine/archive/2008/03/23/minimal-logging-changes-in-sql-server-2008-part-1.aspx
http://blogs.msdn.com/sqlserverstorageengine/archive/2008/03/23/minimal-logging-changes-in-sql-server-2008-part-2.aspx
Best Regards,Uri Dimant SQL Server MVP,
http://sqlblog.com/blogs/uri_dimant/
MS SQL optimization: MS SQL Development and Optimization
MS SQL Consulting:
Large scale of database and data cleansing
Remote DBA Services:
Improves MS SQL Database Performance
SQL Server Integration Services:
Business Intelligence
Maybe you are looking for
-
Data source for a planning area
Hi Experts, I have created a data source 9AZDP_APAP for my planning area ZDP_APAP. When I'm creating this data source, SAP itself prefixing my datasource name with '9A'. I'm wondering is this ( Starting the data sorce name with '9A') with in our syst
-
AT user command in interactive list(basic) is not calling smartform
Hi, I am facing a problem, which will be strange for all i think. in a basic list (not ALV) simple interactive report i am using a at user-command. my concern is to collect the checked box in the first output report display and store it into the inte
-
Condition types - A few from idoc and a few from Inforecords
Hi Experts!! I need to create a purchase order. Normally the pricing for each line item will be picked from inforecords and the pricing procedure (functional configuration) and then will be calculated and displayed. Now I have a requirement in such a
-
Where can I buy a iPhone 1st. Generation?
Hello I want to buy a cheap, old iPhone.
-
RE: email is jammed sending pictures
I was sending photos from my iphone through email and the phone has jammed and can't send them. I have deleated the files but the still says sending, but nothing is happening.