Date fromats loading using SQL * Loader
Hello
I have the data to load into an Oracle DB using sqlldr below
333. 789. 6 ||| 01-08-2013 | 2014-08-01 |
334. 789. 6 ||| 01-08-2013 | 2014-08-01 |
335. 789. 6 ||| 01-08-2013 | 2014-08-01 |
It fails while the failed to load on date formats. How can I fix everything by using load data.
Thank you
Sylvie
Works for me. You must validate the CTL file.
Here is an example:
Control line: -.
DOWNLOAD THE DATA
INFILE *.
IN THE TABLE test_table
REPLACE
FIELDS TERMINATED BY ', '.
(
Col DATE 'yyyy-mm-dd ".
)
BEGINDATA
2013-08-01
2014-09-01
2015-10-01
2016-11-01
2017-12-01
-Create table
SQL > create table test_table (date of the pass);
Table created.
-SQL * Loader
C:\Users\43729434>sqlldr user/password@db_alias name control=C:\fakepath\test_ctl.ctl
SQL * Loader: release 11.2.0.1.0 - Production Tue Oct 24 10:26:40 2013
Copyright (c) 1982, 2009, Oracle and/or its affiliates. All rights reserved.
Commit the point reached - the number of logical records 4
Commit the point reached - the number of logical records 5-Check the data in the database
SQL > alter session set nls_date_format = 'DD-Mon-YYYY ';
Modified session.
SQL > select col from test_table;
COL
-----------
August 1, 2013
01-sep-2014
October 1, 2015
November 1, 2016
December 1, 2017SQL >
Tags: Database
Similar Questions
-
Data capture, etc. using SQL Developer mysql Orac conversion problems
Hello
I have been using Sql Developer to try to convert my mysql database to oracle, I managed to set up the connections and the repository very well. However, when I right click on my database connection and click on the capture of the capture window appears but nothing happens. What I am doing wrong?
Thank you
AaronThis error usually indicates a corrupt repository of migration or a user privilege is missing.
Also the migration of SQL Developer 2 and 1 repository is not compatible - so I would say to create a single repository user for each new version.
It is a repository of sample for SQL Developer 2.x user:CREATE USER migration IDENTIFIED BY migration DEFAULT TABLESPACE users TEMPORARY TABLESPACE temp;
GRANT CONNECT, RESOURCE, CREATE VIEW, CREATE A PUBLIC SYNONYM TO
Migration WITH the ADMIN OPTION.GRANT ALTER ANY ROLE, ALTER ANY SEQUENCE, ALTER ANY TABLE, ALTER TABLESPACE, ALTER ANY TRIGGER, COMMENT ANY TABLE, CREATE ANY SEQUENCE, CREATE ANY TABLE, CREATE ANY TRIGGER, CREATE ROLE, CREATE TABLESPACE, CREATE USER, DROP ANY SEQUENCE, DROP ANY TABLE, DROP ANY TRIGGER, DROP TABLESPACE, DROP USER, DROP ANY ROLE, GRANT ANY ROLE, INSERT ANY TABLE, SELECT ANY TABLE UPDATE no matter WHAT TABLE OF migration;
-
Problem (hierarchical data) resolved by using SQL
Hi I have hierarchical data stored in a table with 3 columns
Item1, item2, relationship
relationship column defines if the element1 is parent of item2 or item1 item2 Chile
I have a fourth column in the same table indicating the entire hierarchy of the family separated by colons;
example: a1, a2, child then output will be a1:a2.
I have tried a lot of things to do with a sql but failed and finally did using the recursive function
Hoping someone can solve the problem in sql
You will find examples of data to work with as well as the desired result:
Kind regardsselect 'p1' as element1, 'p2' as element2, 'parent' as relationship, 'p1' as output from dual union all select 'p2', 'p1', 'child', 'p1:p2' from dual union all select 'p1', 'p3', 'parent', 'p1' from dual union all select 'p3', 'p1', 'child', 'p1:p3' from dual union all select 'p2', 'p4', 'parent', 'p1:p2' from dual union all select 'p4', 'p2', 'child', 'p1:p2:p4' from dual union all select 'p2', 'p5', 'parent', 'p1:p2' from dual union all select 'p5', 'p2', 'child', 'p1:p2:p5' from dual union all select 'p3', 'p6', 'parent', 'p1:p3' from dual union all select 'p6', 'p3', 'child', 'p1:p3:p6' from dual union all select 'p5', 'p7', 'parent', 'p1:p2:p5' from dual union all select 'p7', 'p5', 'child', 'p1:p2:p5:p7' from dual union all select 'p5', 'p8', 'parent', 'p1:p2:p5' from dual union all select 'p8', 'p5', 'child', 'p1:p2:p5:p8' from dual union all select 'b1', 'b2', 'parent', 'b1' from dual union all select 'b2', 'b1', 'child', 'b1:b2' from dual union all select 'b2', 'b3', 'parent', 'b1:b2' from dual union all select 'b3', 'b2', 'child', 'b1:b2:b3' from dual union all select 'c1', 'c2', 'parent', 'c1' from dual union all select 'c2', 'c1', 'child', 'c1:c2' from dual union all select 'c1', 'c3', 'parent', 'c1' from dual union all select 'c3', 'c1', 'child', 'c1:c3' from dual union all select 'c3', 'c5', 'parent', 'c1:c3' from dual union all select 'c5', 'c3', 'child', 'c1:c3:c5' from dual union all select 'c3', 'c6', 'parent', 'c1:c3' from dual union all select 'c6', 'c3', 'child', 'c1:c3:c6' from dual union all select 'c3', 'c7', 'parent', 'c1:c3' from dual union all select 'c7', 'c3', 'child', 'c1:c3:c7' from dual union all select 'a1', null, 'parent', 'a1' from dual
Amitdon't worry, I fixed it...
with t as( select 'p1' as element1, 'p2' as element2, 'parent' as relationship from dual union all select 'p2', 'p1', 'child' from dual union all select 'p1', 'p3', 'parent'from dual union all select 'p3', 'p1', 'child' from dual union all select 'p2', 'p4', 'parent' from dual union all select 'p4', 'p2', 'child' from dual union all select 'p2', 'p5', 'parent' from dual union all select 'p5', 'p2', 'child' from dual union all select 'p3', 'p6', 'parent' from dual union all select 'p6', 'p3', 'child' from dual union all select 'p5', 'p7', 'parent' from dual union all select 'p7', 'p5', 'child' from dual union all select 'p5', 'p8', 'parent' from dual union all select 'p8', 'p5', 'child' from dual union all select 'b1', 'b2', 'parent' from dual union all select 'b2', 'b1', 'child' from dual union all select 'b2', 'b3', 'parent' from dual union all select 'b3', 'b2', 'child' from dual union all select 'c1', 'c2', 'parent' from dual union all select 'c2', 'c1', 'child' from dual union all select 'c1', 'c3', 'parent' from dual union all select 'c3', 'c1', 'child' from dual union all select 'c3', 'c5', 'parent' from dual union all select 'c5', 'c3', 'child' from dual union all select 'c3', 'c6', 'parent' from dual union all select 'c6', 'c3', 'child' from dual union all select 'c3', 'c7', 'parent' from dual union all select 'c7', 'c3', 'child' from dual union all select 'a1', null, 'parent' from dual ), p as ( select * from t where relationship='parent') ,q as ( select * from t where relationship='child' ) select element1,element2,relationship,path from (select path,element1,'parent' relationship,element2 from ( select path,element1,element2,row_number() over (partition by element1,element2 order by length(path) desc) rnum from ( select ltrim(sys_connect_by_path(element1,':'),':') path,element1,element2 from p connect by prior element2=element1 )) where rnum=1 union all select path,element1,'child' relationship,element2 from ( select path,element1,element2,row_number() over (partition by element1,element2 order by length(path) desc) rnum from ( select ltrim(connect_by_root element2||sys_connect_by_path(element1,':'),':') path,element1,element2 from q connect by prior element1=element2 )) where rnum=1)
Ravi Kumar
-
How to insert data into tables using sql loops
Oracle 10.2 g
using Oracle sql * more
Table amounts is
nowcreate table student(id) as select distinct student_id from students_table;
Now create a sequencedesc student; will retrieve student ====== Name Null? Type =========================== ID VARCHAR2(10)
create sequence st_seq;
alter table student add column no;
This is the main partselect * from student no id ========= 234 298 ..........
There are 100 student in the table
now, I want to fill the table with sequences using seq.next_val
How to use a loop to insert 100 auto generated numbers in the table.
Thank you.
Expected result
Why I'm doing this instead ofSelect * from student no id ========= 1 234 2 298 .........
This will cause the duplication of the upncreate table student(no,id) as select st_se.nextval,student_id from students;
using separate throws an error.
Thank you.create table student(st_id,id) as select distinct st_seq.nextval,academicyear from student as select distinct st_seq.nextval,academicyear * ERROR at line 2: ORA-02287: sequence number not allowed here
Hello
As you discovered, you cannot use SELECT DISTINCT and sequence. NEXTVAL in the same query.
You can SELECT DISTINCT in a subquery, like this:
CREATE TABLE student AS WITH distinct_ids AS ( SELECT DISTINCT student_id AS id FROM students_table ) SELECT st_seq.NEXTVAL AS st_id , id FROM distinct_ids;
-
Question to load data using sql loader in staging table, and then in the main tables!
Hello
I'm trying to load data into our main database table using SQL LOADER. data will be provided in separate pipes csv files.
I have develop a shell script to load the data and it works fine except one thing.
Here are the details of a data to re-create the problem.
Staging of the structure of the table in which data will be filled using sql loader
create table stg_cmts_data (cmts_token varchar2 (30), CMTS_IP varchar2 (20));
create table stg_link_data (dhcp_token varchar2 (30), cmts_to_add varchar2 (200));
create table stg_dhcp_data (dhcp_token varchar2 (30), DHCP_IP varchar2 (20));
DATA in the csv file-
for stg_cmts_data-
cmts_map_03092015_1.csv
WNLB-CMTS-01-1. 10.15.0.1
WNLB-CMTS-02-2 | 10.15.16.1
WNLB-CMTS-03-3. 10.15.48.1
WNLB-CMTS-04-4. 10.15.80.1
WNLB-CMTS-05-5. 10.15.96.1
for stg_dhcp_data-
dhcp_map_03092015_1.csv
DHCP-1-1-1. 10.25.23.10, 25.26.14.01
DHCP-1-1-2. 56.25.111.25, 100.25.2.01
DHCP-1-1-3. 25.255.3.01, 89.20.147.258
DHCP-1-1-4. 10.25.26.36, 200.32.58.69
DHCP-1-1-5 | 80.25.47.369, 60.258.14.10
for stg_link_data
cmts_dhcp_link_map_0309151623_1.csv
DHCP-1-1-1. WNLB-CMTS-01-1,WNLB-CMTS-02-2
DHCP-1-1-2. WNLB-CMTS-03-3,WNLB-CMTS-04-4,WNLB-CMTS-05-5
DHCP-1-1-3. WNLB-CMTS-01-1
DHCP-1-1-4. WNLB-CMTS-05-8,WNLB-CMTS-05-6,WNLB-CMTS-05-0,WNLB-CMTS-03-3
DHCP-1-1-5 | WNLB-CMTS-02-2,WNLB-CMTS-04-4,WNLB-CMTS-05-7
WNLB-DHCP-1-13 | WNLB-CMTS-02-2
Now, after loading these data in the staging of table I have to fill the main database table
create table subntwk (subntwk_nm varchar2 (20), subntwk_ip varchar2 (30));
create table link (link_nm varchar2 (50));
SQL scripts that I created to load data is like.
coil load_cmts.log
Set serveroutput on
DECLARE
CURSOR c_stg_cmts IS SELECT *.
OF stg_cmts_data;
TYPE t_stg_cmts IS TABLE OF stg_cmts_data % ROWTYPE INDEX BY pls_integer;
l_stg_cmts t_stg_cmts;
l_cmts_cnt NUMBER;
l_cnt NUMBER;
NUMBER of l_cnt_1;
BEGIN
OPEN c_stg_cmts.
Get the c_stg_cmts COLLECT in BULK IN l_stg_cmts;
BECAUSE me IN l_stg_cmts. FIRST... l_stg_cmts. LAST
LOOP
SELECT COUNT (1)
IN l_cmts_cnt
OF subntwk
WHERE subntwk_nm = l_stg_cmts (i) .cmts_token;
IF l_cmts_cnt < 1 THEN
INSERT
IN SUBNTWK
(
subntwk_nm
)
VALUES
(
l_stg_cmts (i) .cmts_token
);
DBMS_OUTPUT. Put_line ("token has been added: ' |") l_stg_cmts (i) .cmts_token);
ON THE OTHER
DBMS_OUTPUT. Put_line ("token is already present'");
END IF;
WHEN l_stg_cmts EXIT. COUNT = 0;
END LOOP;
commit;
EXCEPTION
WHILE OTHERS THEN
Dbms_output.put_line ('ERROR' |) SQLERRM);
END;
/
output
for dhcp
coil load_dhcp.log
Set serveroutput on
DECLARE
CURSOR c_stg_dhcp IS SELECT *.
OF stg_dhcp_data;
TYPE t_stg_dhcp IS TABLE OF stg_dhcp_data % ROWTYPE INDEX BY pls_integer;
l_stg_dhcp t_stg_dhcp;
l_dhcp_cnt NUMBER;
l_cnt NUMBER;
NUMBER of l_cnt_1;
BEGIN
OPEN c_stg_dhcp.
Get the c_stg_dhcp COLLECT in BULK IN l_stg_dhcp;
BECAUSE me IN l_stg_dhcp. FIRST... l_stg_dhcp. LAST
LOOP
SELECT COUNT (1)
IN l_dhcp_cnt
OF subntwk
WHERE subntwk_nm = l_stg_dhcp (i) .dhcp_token;
IF l_dhcp_cnt < 1 THEN
INSERT
IN SUBNTWK
(
subntwk_nm
)
VALUES
(
l_stg_dhcp (i) .dhcp_token
);
DBMS_OUTPUT. Put_line ("token has been added: ' |") l_stg_dhcp (i) .dhcp_token);
ON THE OTHER
DBMS_OUTPUT. Put_line ("token is already present'");
END IF;
WHEN l_stg_dhcp EXIT. COUNT = 0;
END LOOP;
commit;
EXCEPTION
WHILE OTHERS THEN
Dbms_output.put_line ('ERROR' |) SQLERRM);
END;
/
output
for link -.
coil load_link.log
Set serveroutput on
DECLARE
l_cmts_1 VARCHAR2 (4000 CHAR);
l_cmts_add VARCHAR2 (200 CHAR);
l_dhcp_cnt NUMBER;
l_cmts_cnt NUMBER;
l_link_cnt NUMBER;
l_add_link_nm VARCHAR2 (200 CHAR);
BEGIN
FOR (IN) r
SELECT dhcp_token, cmts_to_add | ',' cmts_add
OF stg_link_data
)
LOOP
l_cmts_1: = r.cmts_add;
l_cmts_add: = TRIM (SUBSTR (l_cmts_1, 1, INSTR (l_cmts_1, ',') - 1));
SELECT COUNT (1)
IN l_dhcp_cnt
OF subntwk
WHERE subntwk_nm = r.dhcp_token;
IF l_dhcp_cnt = 0 THEN
DBMS_OUTPUT. Put_line ("device not found: ' |") r.dhcp_token);
ON THE OTHER
While l_cmts_add IS NOT NULL
LOOP
l_add_link_nm: = r.dhcp_token |' _TO_' | l_cmts_add;
SELECT COUNT (1)
IN l_cmts_cnt
OF subntwk
WHERE subntwk_nm = TRIM (l_cmts_add);
SELECT COUNT (1)
IN l_link_cnt
LINK
WHERE link_nm = l_add_link_nm;
IF l_cmts_cnt > 0 AND l_link_cnt = 0 THEN
INSERT INTO link (link_nm)
VALUES (l_add_link_nm);
DBMS_OUTPUT. Put_line (l_add_link_nm |) » '||' Has been added. ") ;
ELSIF l_link_cnt > 0 THEN
DBMS_OUTPUT. Put_line (' link is already present: ' | l_add_link_nm);
ELSIF l_cmts_cnt = 0 then
DBMS_OUTPUT. Put_line (' no. CMTS FOUND for device to create the link: ' | l_cmts_add);
END IF;
l_cmts_1: = TRIM (SUBSTR (l_cmts_1, INSTR (l_cmts_1, ',') + 1));
l_cmts_add: = TRIM (SUBSTR (l_cmts_1, 1, INSTR (l_cmts_1, ',') - 1));
END LOOP;
END IF;
END LOOP;
COMMIT;
EXCEPTION
WHILE OTHERS THEN
Dbms_output.put_line ('ERROR' |) SQLERRM);
END;
/
output
control files -
DOWNLOAD THE DATA
INFILE 'cmts_data.csv '.
ADD
IN THE STG_CMTS_DATA TABLE
When (cmts_token! = ") AND (cmts_token! = 'NULL') AND (cmts_token! = 'null')
and (cmts_ip! = ") AND (cmts_ip! = 'NULL') AND (cmts_ip! = 'null')
FIELDS TERMINATED BY ' |' SURROUNDED OF POSSIBLY "" "
TRAILING NULLCOLS
('RTRIM (LTRIM (:cmts_token))' cmts_token,
cmts_ip ' RTRIM (LTRIM(:cmts_ip)) ")". "
for dhcp.
DOWNLOAD THE DATA
INFILE 'dhcp_data.csv '.
ADD
IN THE STG_DHCP_DATA TABLE
When (dhcp_token! = ") AND (dhcp_token! = 'NULL') AND (dhcp_token! = 'null')
and (dhcp_ip! = ") AND (dhcp_ip! = 'NULL') AND (dhcp_ip! = 'null')
FIELDS TERMINATED BY ' |' SURROUNDED OF POSSIBLY "" "
TRAILING NULLCOLS
('RTRIM (LTRIM (:dhcp_token))' dhcp_token,
dhcp_ip ' RTRIM (LTRIM(:dhcp_ip)) ")". "
for link -.
DOWNLOAD THE DATA
INFILE 'link_data.csv '.
ADD
IN THE STG_LINK_DATA TABLE
When (dhcp_token! = ") AND (dhcp_token! = 'NULL') AND (dhcp_token! = 'null')
and (cmts_to_add! = ") AND (cmts_to_add! = 'NULL') AND (cmts_to_add! = 'null')
FIELDS TERMINATED BY ' |' SURROUNDED OF POSSIBLY "" "
TRAILING NULLCOLS
('RTRIM (LTRIM (:dhcp_token))' dhcp_token,
cmts_to_add TANK (4000) RTRIM (LTRIM(:cmts_to_add)) ")" ""
SHELL SCRIPT-
If [!-d / log]
then
Mkdir log
FI
If [!-d / finished]
then
mkdir makes
FI
If [!-d / bad]
then
bad mkdir
FI
nohup time sqlldr username/password@SID CONTROL = load_cmts_data.ctl LOG = log/ldr_cmts_data.log = log/ldr_cmts_data.bad DISCARD log/ldr_cmts_data.reject ERRORS = BAD = 100000 LIVE = TRUE PARALLEL = TRUE &
nohup time username/password@SID @load_cmts.sql
nohup time sqlldr username/password@SID CONTROL = load_dhcp_data.ctl LOG = log/ldr_dhcp_data.log = log/ldr_dhcp_data.bad DISCARD log/ldr_dhcp_data.reject ERRORS = BAD = 100000 LIVE = TRUE PARALLEL = TRUE &
time nohup sqlplus username/password@SID @load_dhcp.sql
nohup time sqlldr username/password@SID CONTROL = load_link_data.ctl LOG = log/ldr_link_data.log = log/ldr_link_data.bad DISCARD log/ldr_link_data.reject ERRORS = BAD = 100000 LIVE = TRUE PARALLEL = TRUE &
time nohup sqlplus username/password@SID @load_link.sql
MV *.log. / log
If the problem I encounter is here for loading data in the link table that I check if DHCP is present in the subntwk table, then continue to another mistake of the newspaper. If CMTS then left create link to another error in the newspaper.
Now that we can here multiple CMTS are associated with unique DHCP.
So here in the table links to create the link, but for the last iteration of the loop, where I get separated by commas separate CMTS table stg_link_data it gives me log as not found CMTS.
for example
DHCP-1-1-1. WNLB-CMTS-01-1,WNLB-CMTS-02-2
Here, I guess to link the dhcp-1-1-1 with balancing-CMTS-01-1 and wnlb-CMTS-02-2
Theses all the data present in the subntwk table, but still it gives me journal wnlb-CMTS-02-2 could not be FOUND, but we have already loaded into the subntwk table.
same thing is happening with all the CMTS table stg_link_data who are in the last (I think here you got what I'm trying to explain).
But when I run the SQL scripts in the SQL Developer separately then it inserts all valid links in the table of links.
Here, she should create 9 lines in the table of links, whereas now he creates only 5 rows.
I use COMMIT in my script also but it only does not help me.
Run these scripts in your machine let me know if you also get the same behavior I get.
and please give me a solution I tried many thing from yesterday, but it's always the same.
It is the table of link log
link is already present: dhcp-1-1-1_TO_wnlb-cmts-01-1 NOT FOUND CMTS for device to create the link: wnlb-CMTS-02-2
link is already present: dhcp-1-1-2_TO_wnlb-cmts-03-3 link is already present: dhcp-1-1-2_TO_wnlb-cmts-04-4 NOT FOUND CMTS for device to create the link: wnlb-CMTS-05-5
NOT FOUND CMTS for device to create the link: wnlb-CMTS-01-1
NOT FOUND CMTS for device to create the link: wnlb-CMTS-05-8 NOT FOUND CMTS for device to create the link: wnlb-CMTS-05-6 NOT FOUND CMTS for device to create the link: wnlb-CMTS-05-0 NOT FOUND CMTS for device to create the link: wnlb-CMTS-03-3
link is already present: dhcp-1-1-5_TO_wnlb-cmts-02-2 link is already present: dhcp-1-1-5_TO_wnlb-cmts-04-4 NOT FOUND CMTS for device to create the link: wnlb-CMTS-05-7
Device not found: wnlb-dhcp-1-13 IF NEED MORE INFORMATION PLEASE LET ME KNOW
Thank you
I felt later in the night that during the loading in the staging table using UNIX machine he created the new line for each line. That is why the last CMTS is not found, for this I use the UNIX 2 BACK conversion and it starts to work perfectly.
It was the dos2unix error!
Thank you all for your interest and I may learn new things, as I have almost 10 months of experience in (PLSQL, SQL)
-
Error loading data using SQL loader
I get an error message like "SQL * Loader - 350 combination illegal syntax of non-alphanumeriques characters error during loading of a file using SQL loader in RHEL." The command used to run SQL * Loader is:
Sqlldr userid = < user name > / < password > control = data.ctl
The control file is data.ctl:
DOWNLOAD the data
INFILE ' / home/oraprod/data.txt'
Add in the table test
{
EmpID completed by «,»,
fname completed by «,»,
lname completed by «,»,
treatment is completed with a white space
}
The data.txt file is:
1, Kaushal, Hamad, 5000
2, Chetan, Hamad, 1000
Hopefully, my question is clear.
Please get back with the answer to my query.
Concerning
Replace "{" by "("dans votre fichier de contrôle) "
DOWNLOAD the data
INFILE 'c:\data.txt.
Add the emp_t table
(
EmpID completed by «,»,
fname completed by «,»,
lname completed by «,»,
treatment is completed with a white space
)
C:\>sqlldr user/pwd@database control = c.ctl
SQL * Loader: release 10.2.0.3.0 - Production on Wed Nov 13 10:10:24 2013
Copyright (c) 1982, 2005, Oracle. All rights reserved.
Commit the point reached - the number of logical records 1
Commit the point reached - the number of logical records 2
SQL > select * from emp_t;
EMPID, FNAME LNAME SALARY
---------- -------------------- -------------------- ----------
1 kone hamadi 5000
2 Chetan Hamad 1000
Best regards
Mohamed Houri
-
Problem loading xml using sql loader file
I am trying to load data into the table test_xml (xmldata XMLType)
I have an xml file and I want any file to load in a single column
When I use the following control file and run from the command-line as follows
sqlldr $1@$TWO_TASK direct control=$XXTOP/bin/LOAD_XML.ctl = true; :
DOWNLOAD THE DATA
INFILE *.
TRUNCATE INTO TABLE test_xml
XmlType (XMLDATA)
FIELDS
(
tank fill ext_fname (100),
XMLDATA LOBFILE (ext_fname) COMPLETED BY expressions of folklore
)
START DATA
U01/appl/apps/apps_st/appl/XXTop/12.0.0/bin/file. XML
the file is loaded in the table perfectly.
Unfortunately I can't hard-code the name of file as file name will be changed dynamically.
so I removed the block
START DATA
U01/appl/apps/apps_st/appl/XXTop/12.0.0/bin/file. XML
control file and tried to run by giving the following command line path
sqlldr $1@$TWO_TASK control=$XXTOP/bin/LOAD_XML.ctl direct data=/u01/APPL/apps/apps_st/appl/xxtop/12.0.0/bin/file.xml = true;
But strangely it attempts to load each line of the xml file in the table instead of the whole file
Please find the log of the program with the error
------------------------------------------------------------------
Loading XML through SQL * Loader begins
------------------------------------------------------------------
SQL * Loader-502: cannot open the data file ' <? XML version = "1.0"? > ' table field TEST_XML XMLDATA
SQL * Loader-553: file not found
SQL * Loader-509: System error: no such file or directory
SQL * Loader-502: cannot open the data file '< root >' XMLDATA field table TEST_XML
SQL * Loader-553: file not found
SQL * Loader-509: System error: no such file or directory
SQL * Loader-502: cannot open the data file '< ScriptFileType >' field XMLDATA table TEST_XML
SQL * Loader-553: file not found
SQL * Loader-509: System error: no such file or directory
SQL * Loader-502: cannot open the data file ' < Type > forms < / Type > ' table field TEST_XML XMLDATA
SQL * Loader-553: file not found
SQL * Loader-509: System error: no such file or directory
SQL * Loader-502: cannot open the data file ' < / ScriptFileType > ' table field TEST_XML XMLDATA
SQL * Loader-553: file not found
SQL * Loader-509: System error: no such file or directory
SQL * Loader-502: cannot open the data file '< ScriptFileType >' field XMLDATA table TEST_XML
SQL * Loader-553: file not found
SQL * Loader-509: System error: no such file or directory
SQL * Loader-502: cannot open the data file ' < Type > PLL < / Type > ' table field TEST_XML XMLDATA
SQL * Loader-553: file not found
SQL * Loader-509: System error: no such file or directory
SQL * Loader-502: cannot open the data file ' < / ScriptFileType > ' table field TEST_XML XMLDATA
SQL * Loader-553: file not found
SQL * Loader-509: System error: no such file or directory
SQL * Loader-502: cannot open the data file '< ScriptFileType >' field XMLDATA table TEST_XML
Please help me how can I load full xml in a single column using command line without Hardcoding in the control file
Published by: 907010 on January 10, 2012 02:24But strangely it attempts to load each line of the xml file in the table instead of the whole file
Nothing strange, that the data parameter specifies the file containing the data to load.
If you use the name of the XML here, the control file will try to interpret each line of XML as being separate ways.The traditional approach this is to have the name of the file stored in another file, say filelist.txt and use, for example:
echo "/u01/APPL/apps/apps_st/appl/xxtop/12.0.0/bin/file.xml" > filelist.txt sqlldr $1@$TWO_TASK control=$XXTOP/bin/LOAD_XML.ctl data=filelist.txt direct=true;
-
Hi - I have a single charge rule dimension loading a hierarchy in a cube ASO. It uses SQL to return the values of parent/child, with the operator of consolidation and several UDA values
When I run the State of charge with one set of SQL (what happens is not to have a prescription), data are retieved and the hierarchy is to build successfully, but with members of Level0 not in the right order, but always under the correct parents.
When I use a different piece of SQL (with an order by clause to correctly classify members), it will fail to load and the MaxL script will fail.
The SQLs were tested in TOAD and the overview of data on Essbase, so they return both the same set of data. Nothing useful is returned to work or log of Essbase applications
Someone met by amythinjg like this before?
What's really weird is that the SQL code that is a failure previously worked. The only thing that changed was that a new set of basic data has been loaded from the database
Any help gratefully received
THXWhen you use the "order by" clause, what is the SQL code that fails, or just the rule of the load?
How the 'order by' clause orders the members?My guess is that it is not for lack of SQL (you have already proved it a TOAD), but that members really are not sorted correctly for loading. In a dimension build parent/child of the higher level in the dimension member must be in the first record as the "Parent"(c'est le membre de dimension dans la plupart deles de cas). "»
Robert
-
Error loading of data into Essbase of SQL Server
Hello experts!
I have another urgent and confusing issue. I am load data in a SQL Server view in Essbase (which is inverted with several columns of data) using ODI 11.1.1.5 and I get the following error at + "3-loading-SrcSet0-Load Data" + no:
ODI-1227: SrcSet0 (load) task fails on the source of connection MICROSOFT_SQL_SERVER.
+ Caused by: java.sql.SQLException: incorrect syntax near the keyword 'View' [FMWGEN] [SQLServer JDBC Driver] [SQL Server] +.
where 'View' is the name of the dimension (data) column in the SQL view.
Please help me with advice! Thank you very much!Have you checked the generated SQL code, you can run the SQL generated directly in SQL server studio.
If you use a column called view and one using a view?, if so this can be the questionSee you soon
John
http://John-Goodwin.blogspot.com/ -
Cannot load data into Essbase using ODI
Hi guys,.
Help help. I have problem loading data into essbase using ODI. The error message is
java.sql.SQLException: unexpected token: ACCOUNT in the statement [select C1_ACCOUNT "" account]
I have a very simple flat file that are similar to the below:
Account, resources, time, data
Active, Na_Resource, Jan, 10
Active, Na_Resource, 12, February
With the same flat files, I am able to load data to load rules.
I use 9.3.1.0 and ODI 10.1.3.4.0 essbase. I use the ODI to load members and data in the planning without any problem.
Thank youHello
It seems to generate an extra set of quotation marks around the SQL, in my interface it generates.
SQL = "" "select C1_ACCOUNT 'Account', C2_PERIOD 'Period', C3_RESOURCE 'Resource', C4_DATA 'Data' of the" C$ _0TestApp_testData "where (1 = 1) «»
Note the single quotes around the account.
If you go to the topology Manager, on the tab of the physical architecture, right-click 'Hyperion Planning' > 'change '.
Select the "Langugage" tab for the "JYTHON" line, make sure that the "Object Delimiter" field has no quotes, if it's remove and apply and save.See you soon
John
http://John-Goodwin.blogspot.com/ -
Recovering data using SQL SERVER
Hello
We migrated an environment where Oracle has been store relational data, to one where it is SQLSERVER. I'm trying to load the relational source data into Essbase using rule files. (Nothing fancy) We are on 11.1.2.1
My rule file Essbase, which in SQL embedded in it, returns the numeric columns apparently valid, but rejects essbase each records as if the numerical value was a value of text, for example, he says "Member 12345.67890' not found.
View SQL SERVER sets the numeric columns (Numeric (38.5), null).
Someone at - he met before & can help?
Thank youYou must validate your definition of the rule of load, something pushed and charge State treats the data as members of a dimension column.
-
FDM 11.1.2.2 EFFECTS in the data after loading data
Hello
I'm loading data for planning an application of FDM for 30/04/12 to 31/3/12 (April) FY13 but perform 30/04/13 to 31/03/13 (April) exercise 14 in planning and for the 13 year data are deleted automatically
I use replace when exporting data option
I guess that the FDM cannot remove data that are responsible for the planning application
can someone help me solve this problem.
Thank you
Answer: The correct data is loaded to April 14 exercise
Have you reviewed your Control Board for the periods? Maybe it's that you map Apr-2013 to APR-FY14
Answer: Yes mapping for April 2013 is mapped to APR-FY14 > This is the reason why the data is loaded to FY14. You need to update your table of control periods.
Then your data for FY13 are deleted in planning when using replace. When you load mode replace, FDM runs a clear script before loading data. Which erases all intersections for category (scenario), period and entity (all descendants of your target entity)
Question why the 13 year data are deleted in the planning if we choose the option replace > by default the CLEAR of the LOAD ACTION script do not include the year dimension. This is why the data are deleted for all years. You must include in the script
-
Implementation of application Date of loading and County in ODI
Hi all
I have two different questions.
1. how to implement load_date for SCD Type 2 Dimension tables and fact tables? For the SCD Type 2 Tables I would say 'Add new record' for the date of loading? In the target store, it will be Current_Time_Stamp, is this correct?
2. I have the following query, I need to add to a column of target data store.
Select SUM (CASE
WHEN CAST (a.LAST_IDP_UPDATE AS DATE) BETWEEN dateadd (month,-6, CURRENT_TIMESTAMP) and DATEADD(day,-1,current_timestamp), 1
0 OTHERWISE
END) AS six_months_update of transactions;
This will be assigned to the six_months_update column in the target. Transactions is the main draw in this mapping.
When I use it in the map and check it, it says error. I'm not using the key word "Select" or "AS six_months_update of transactions", in other words the column mapping looks like this
"SUM (CASE WHEN CAST (a.LAST_IDP_UPDATE AS DATE) BETWEEN dateadd (month,-6, CURRENT_TIMESTAMP) and DATEADD(day,-1,current_timestamp) THEN 1 ELSE 0 END).
How do I implement this? Thanks for your time and your help.Hello
ssk1974 wrote:
1. how to implement load_date for SCD Type 2 Dimension tables and fact tables? For the SCD Type 2 Tables I would say 'Add new record' for the date of loading? In the target store, it will be Current_Time_Stamp, is this correct?In the target data store, you define the Type of behavior of CPC to the current timestamp.
> >
2. I have the following query, I need to add to a column of target data store.
Select SUM (CASE
WHEN CAST (a.LAST_IDP_UPDATE AS DATE) BETWEEN dateadd (month,-6, CURRENT_TIMESTAMP) and DATEADD(day,-1,current_timestamp), 1
0 OTHERWISE
END) AS six_months_update of transactions;This will be assigned to the six_months_update column in the target. Transactions is the main draw in this mapping.
When I use it in the map and check it, it says error. I'm not using the key word "Select" or "AS six_months_update of transactions", in other words the column mapping looks like this
"SUM (CASE WHEN CAST (a.LAST_IDP_UPDATE AS DATE) BETWEEN dateadd (month,-6, CURRENT_TIMESTAMP) and DATEADD(day,-1,current_timestamp) THEN 1 ELSE 0 END).
Is the alias "a" on your column corresponds to the alias of the source table (transactions) in the Interface? What error do you get when it does not work?Kind regards
Michael Rainey -
XML data in the table using sql/plsql
Hi experts,
Could you please help with the following requirement. I have the tags xml (.xml on a server file) below. I need to access this file and read the XML and insert into the db table using sql and plsql. Is it possible with the cdata below? And there is a nested this table.
Could someone please guide me if you have a sample code file and xml.
<? XML version = "1.0" encoding = "UTF-8"? >
< generation_date > <! [CDATA [17/11/2015]] > < / generation_date >
< generated_by > <! [CDATA [Admin Admin]] > < / generated_by >
< year > <! [CDATA [2015]] > < / year >
< month > <! [CDATA [01]] > < / month >
< author >
< author > <! [CDATA [user author]] > < / author > < author_initial > <! [CDATA [user]] > < / author_firstname > < author_country > <! [CDATA [author]] > < / author_lastname >
< author_email > <! [CDATA [[email protected]]] > < / author_email >
< author_data_01 > <! [CDATA []] > < / author_data_01 >
< author_data_02 > <! [CDATA []] > < / author_data_02 >
< items >
< article_item >
< article_id > <! [CDATA [123456]] > < / article_id >
< publication > <! [CDATA [Al Bayan]] > < / publication >
< section > <! [CDATA [Local]] > < / section >
< issue_date > <! [CDATA [11/11/2015]] > < / issue_date >
< page > <! [CDATA [2]] > < / print this page >
< article_title > <! [CDATA [title.]] > < / article_title > < number_of_words > <! [CDATA [165]] > < / number_of_words >
< original_price > <! [CDATA [200]] > < / original_price >
< original_price_currency > <! [CDATA [DEA]] > < / original_price_currency >
< price > <! [CDATA [250]] > < / price >
< price_currency > <! [CDATA [DEA]] > < / price_currency >
< / article_item >
< / articles >
< total_amount > <! [CDATA [250]] > < / total_amount >
< total_amount_currency > <! [CDATA [DEA]] > < / total_amount_currency >
< / author >
< / xml >
Thanks in advance,
Suman
XMLTABLE using...
SQL > ed
A written file afiedt.buf1 with t (xml) as (select xmltype ('))
2 ") of the double)"
3
4
5
6
7
8
9
10
11
[[12[email protected]]] >
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34-
35 end of sample data
36-
37 - assumptions:
(38 - a) XML may have several tags
(39 - b) eachmay contain more
40-
41 select x.gen_by, x.gen_date, x.mn, x.yr
42, y.author, y.auth_fn, y.auth_ln, y.auth_cnt, y.auth_em, y.auth_d1, y.auth_d2
43, z.id, z.pub, z.sec, z.iss_dt, z.pg, z.art_ttl, z.num_wrds, z.oprice, z.ocurr, z.price, z.curr
44 t
45, xmltable ('/ authxml')
from $ 46 t.xml
path of 47 columns gen_date varchar2 (10) '. / generation_date'
48, path of varchar2 (15) of gen_by '. / generated_by'
49, path of varchar2 (4) year '. "/ year"
50 varchar2 (2) mn road '. "/ month"
51, path of xmltype authors '.'
52 ) x
53, xmltable ('/ authxml/authors ')
from $ 54 x.authors
author of 55 path of varchar2 columns (15) '. / author'
56, path of varchar2 (10) of auth_fn '. / author_firstname'
57, path of varchar2 (10) of auth_ln '. / author_lastname'
58 road of VARCHAR2 (3) auth_cnt '. / author_country'
59 road of varchar2 (20) of auth_em '. / author_email'
60 road of varchar2 (5) of auth_d1 '. / author_data_01'
61, path of varchar2 (5) of auth_d2 '. / author_data_02'
62, path of xmltype articles '. / Articles'
63 ) y
64, xmltable ('/ Articles/article_item ')
from $ 65 y.articles
path id 66 number columns '. / article_id'
67, path of varchar2 (10) pub '. ' / publication.
68 road of varchar2 (10) dry '. / section'
69, path of varchar2 (10) of iss_dt '. / issue_date'
70 road of VARCHAR2 (3) pg '. "/ print this page"
71, path of varchar2 (20) of art_ttl '. / article_title'
72, path of varchar2 (5) of num_wrds '. / number_of_words'
73, path of varchar2 (5) of oprice '. / original_price'
74 road to VARCHAR2 (3) ocurr '. / original_price_currency'
75, path of varchar2 (5) price '. "/ price"
76, path of VARCHAR2 (3) curr '. / price_currency'
77* ) z
SQL > /.GEN_DATE GEN_BY YEAR MN AUTHOR AUTH_FN AUTH_LN AUT AUTH_EM AUTH_ AUTH_ ID PUB DRY ISS_DT PG ART_TTL NUM_W OPRIC HEARTS PRICE OCU
---------- --------------- ---- -- --------------- ---------- ---------- --- -------------------- ----- ----- ---------- ---------- ---------- ---------- --- -------------------- ----- ----- --- ----- ---
17/11/2015 Admin Admin 2015 01 user author user author [email protected] 123456 UAE Al Bayan Local 11/11/2015 2 is the title. 165 200 AED AED 250Of course, you'll want to change the types of data, etc. as needed.
I assumed that the XML can contain several "
" sections and that each section can contain several entries. Thus the XMLTABLE aliasing as 'x' gives information of XML, and supplies the data associated with the XMLTABLE with alias 'y' which gets the multiple authors, which itself
section of the XMLTABLE with alias 'z' for each of the article_item. CDATA stuff are handled automatically by SQLX (XML functionality integrated into Oracle's SQL)
-
How to insert data into a BLOB column using sql
Hi all
How to insert data into the BLOB column directly using sql.
Thank youcreate table temp ( a blob, b clob); SQL> / Insert into temp values ('32aasdasdsdasdasd4e32','adsfbsdkjf') ; * ERROR at line 1: ORA-01465: invalid hex number Please help in this.
Prakash PInsert into temporary values (UTL_RAW. CAST_TO_RAW ('32aasdasdsdasdasd4e32'), 'adsfbsdkjf');
Maybe you are looking for
-
Qosmio G35 AV600 - Toshiba Controlls buttons do not work on Vista
Hi, can someone help me with this.I'm testing Windows Vista on my G35 AV600, but my top buttons do not work.All my FN buttons are OK. Is there a driver I need to install? THX... Dan
-
Re: Drivers for Toshiba e-STUDIO 160
Hi, I have an old toshiba e-STUDIO 160 MFP and I was wondering can I use it with Ubuntu Linux.I am looking for drivers, but without result. You can help me because all my PCs are Ubuntu Linux, and they cannot function without a printer.
-
Netgear RangeMax Wifi Range Extender 802.11 wireless router g
ALrighty, I had used this router just fine with my WHS v1 and now I'm upgrading and aging...
-
If I always try sharing printer on another computer error and get the massage "this operation has been cancelled due to restrictions in effect on this computer"., I have so confiuse and little dizzy... What can I do to solve this problem
-
HP Envy m6: HP Envy won't go out of fashion 'sleep'
Hello! I have an old HP Envy M6 and it has just recently started to act up to a year. He's not coming fashion 'sleep' when I shake the mouse or press the keys on the keyboard. In addition, instead of mode, sleep it seems to go into hibernation. So