SQL Loader control file (.ctl) given in table
HelloI have a table 'region' in my schema called dss.
SQL > desc regionI want to LOAD the data into this table of the region in a file called "region.tbl" located at d:\tpch\region.tbl, using a CONTROL file that is also on the the same place is to say d:\tpch\region.ctl.
R_REGIONKEY
R_NAME
R_COMMENT
Region.tbl file contains few records. Recording of a SAMPLE of region.tbl is as follows:
* 1 | AMERICA | HS ironic use, same request. s | *
Region.CTL file contains the following lines to load data using sql loader:
DOWNLOAD THE DATA
INFILE'd:\tpch\region.tbl'
IN THE REGION OF THE TABLE
FIELDS TERMINATED BY ' |'
* (R_REGIONKEY, R_NAME, R_COMMENT) *.
so I go to the command prompt, navigate to the location of the above files and run the command:
D:\TPCH > sqlldr control = region.ctl dss/dss = useridand get the following error:
SQL * Loader-128: unable to start session
ORA-01017: name of user and password invalid. connection refused
I have the same table under the "system" user creation, but I get a different error with this that is:
SQL * Loader-941: error when the table REGION describe statement
ORA-04043: object REGION does not exist
Using Oracle 11 g on my Windows XP.
I'll appreciate the valuable suggestion.
Thank you very much.
Best regards
Kam
You can connect with dss/dss? For example, what
sqlplus dss/dss
If no, and you are sure that the name of username/password combination is correct, have you checked things like $ORACLE_SID - i.e. it points to the right database?
Tags: Database
Similar Questions
-
Parameters / Variables in SQL Loader Control File
Here's my problem, I created the SQL Loader control file (ctl) to load a file of employees. This loading program is stored in the Oracle Applications. I want it is pass a parameter derived from the profile as the username of those who run the loader program and pass it to the program loader so that the user name information is included in the loading
example of
input data
123456, John, Smith
654321, Jane Doe
data loaded
123456, John, Smith, July 3, 2009, USER13
654321, Jane, Doe, July 3, 2009, USER13
the sysdate is easy because it can be set in the column, but what I want to really realize is a parameter passed to the ctl file.
Thanks in advance.Hello
It's not easy to pass arguments to control the file all what you can do is change the controlfile by file option for your writing dynamically setting. If the user is the database user you can place the USER as a keyword as you where you will store sysdate.Thank you.
-
Conditions in SQL Loader Control file
Hello
I am trying to find a way to set up a sql loader control file that will have the data to a CSV (as shown below):
ACCOUNT DESCRIPTION 9-Apr 9-May 9-June 9 - Jul 9-Aug 9-Sep
3573000 H - 75 68 75 75 75 30 CLRICL
3123000 10 10 6 12 10 7 HRS-OTHER
3151000 HRS - BISHOP 150 143 150 143 120 143
3153000 HRS - BISHOP 22 22 14 29 22 22
3571000 H-TEACHER 135 143 150 218 143 143
and import it into an Oracle table as below:
ACCOUNT YR_MNTH TOTAL DESCRIPTION
3573000 h-CLRICL April 9, 70
3123000 HRS-OTHER 9-Apr 5
3151000 HRS - MGR 9 - APR 129
HRS - MGR 3153000 9-April 20
3571000 HRS - TEACHER 9 - APR 145
3573000 h-CLRICL 9 may 73
3123000 HRS - OTHER 9 - May 12
3151000 HRS - MGR 9 - may 135
HRS - MGR 3153000 9-10 may
3571000 HRS - TEACHER 9 - may 150
3573000 h-CLRICL June 9, 75
3123000 HRS-OTHER 9 - Jun 10
3151000 HRS - 9 - Jun 150 MGR
HRS - MGR 3153000 9-June 22
3571000 HRS-TEACHER 9 - Jun 135
3573000 h-CLRICL July 9, 68
3123000 HRS - OTHER 9-Jul 10
3151000 HRS - MGR 9 - Jul 143
HRS - MGR 3153000 9 - Jul 22
3571000 HRS - TEACHER 9 - Jul 143
3573000 h-CLRICL August 9, 75
3123000 HRS - OTHER 9-August 6
3151000 HRS - MGR 9 - August 150
HRS - MGR 3153000 9-August 14
3571000 HRS - TEACHER 9 - August 150
3573000 h-CLRICL 9 - Sep 75
3123000 9 HRS-OTHER-Sep 12
HRS - MGR 3151000 9-Sep 143
9 HRS - MGR 3153000 - Sept. 29
3571000 HRS-TEACHER 9 - Sep 218
Has anyone done anything like this? Any light anyone can throw is greatly appreciated.
Thank you.
Edited by: user11293056 January 6, 2010 09:19Hello
I think you'll be better off using external pointing to csv data, and then by running the query on the external table to insert rows in the target table table.
Concerning
-
SQL * Loader Control File - Error 510
Hello!
I am trying to load a file TXT using SQL * Loader, my control file is a little too big I guess: 83KO.
The problem is the message I get:
SQL * Loader: release 10.2.0.3.0 - Production on Qua game 16 11:18:58 2009
Copyright (c) 1982, 2005, Oracle. All rights reserved.
SQL * Loader-510: O registro fisico dados (C:\Teste\Exe548teste_zanthus.old.ctl) e but full o' maximo land (2147473647).
The language is Brazilian Portuguese.
But the size of the file is only 83 KB, not the maximum size. I'm confused.
The data is a TXT file with more than 1000 characters per line.
The problem is that the generated control file is 'bigger' than the maximum. The error is not from the data file (error in the control file, not the data file). If you want I can put the file here and a sample of the data file too.
I guess that is not find expressions of the folklore of the control file, but there a tank < ENTER > at the EOF (CR + LF (I think).
I really want to split the data file or in multiple files control file and then control the import with the software, which would be boring...
I don't know if this information helps but my control file using multiple INTO TABLE...
Thank you!I still feel that the problem is the end character.
André Luis wrote:
The comparison is ok since I have already tested with a small control file.
The problem is not the size of the file, the problem is the size of the line, with a small control file sql loader to read the file only online, and in this case it works because it is under the limit for the size of the line. (The smal file perhaps has the same problems with the characters of late, but due to its size it recount not error.)
I hope that I missed something in the creation of the control file, I think he tries to read data from it, despite the fact that I have to tell him otherwise, because I saw something to tell the size limit for a control file with data inside...
The control file syntax is OK, I don't think that he search data in the control file.
I insist on the fact that you are creating the control file with another editor, otherwise...
-
the formatting of char to number in sql loader control file
I tried to load a huge csv Excel file into oracle with sql loader database. But a column contains numbers of year as '2014', ' 2015 ". In the control file, I have defined as:
column_name decimal (38) external "TO_NUMBER (: column_name, ' 9999').
It awlays say: ORA-01722 invalid number format. I changed the format of different number. All this has not worked. Please help me on this.
1. the data of table column type is number (38.0)
2. data csv file looks like this: color is the number of year.
04/03/15, D_2-15, 10953562, 11116, 27144, 03/03/15,2015
04/03/15, P_1-58, 1143088, 5262, 12994, 03/03/15,2015
04/03/15, Q_1-31_Distinct_WWE, 7576633, 22352, 52975, 03/03/15,2015
Thanks in advance.
We can not help you unless you provide a sample of documents failed. The sample you provided loads without any problems:
SQL > CREATE TABLE MY_TABLE)
2 COLONNE_1 DATE,
3 COLUMN_2 VARCHAR2 (255 BYTE).
COLUMN_3 VARCHAR2 (255 BYTE) 4.
COLUMN_4 VARCHAR2 (255 BYTE) 5.
6 COLUMN_5 VARCHAR2 (255 BYTE).
7 COLONNE_6 DATE,
8 BUSINESS_YR NUMBER(*,0)
9 )
10.Table created.
SQL > home
Microsoft Windows [Version 6.1.7600]
Copyright (c) 2009 Microsoft Corporation. All rights reserved.C:\app\xxx\product\11.2.0\dbhome_2\BIN>type c:\temp\xx.ctl
DOWNLOAD THE DATA
CHARACTERSET US7ASCIIINFILE *.
TRUNCATE
IN THE TABLE MY_TABLE
FIELDS ENDED BY ',' POSSIBLY FRAMED BY "" "
TRAILING NULLCOLS
(
COLONNE_1 DATE "MM-DD-AA.
COLUMN_2 CHAR (255),
COLUMN_3 CHAR (255),
COLUMN_4 CHAR (255) NULLIF COLUMN_4 = BLANKS,
COLUMN_5 CHAR (255) NULLIF COLUMN_5 = BLANKS,
COLONNE_6 DATE "MM-DD-YY."
BUSINESS_YR EXTERNAL INTEGER (38)
)
BEGINDATA
03/20/15,1P-11,1111.22,,,03/22/15, 2014
21/03/15, M_XXX-4, 5607817, 0, 0, 03-9/22/15, 2014
22/03/15, M_DDD-2, 54990, 0, 0, 03-8/22/15, 2014
23/03/15, R_1-46, 5297481, 24, 24, 03/22/15, 2014
16/03/15, X_1 - 48 a, 8547274, 13474, 13474, 15/03/15, 2015
03/17/15,1T-15-dental,2118.12,,,03/15/15, 2015
18/03/15, 1 S - 1S, 555, 15/03/15, 2015
19/03/15, P_NNN-7, 7455342, 10941, 10941, 03/15/15, 2015
C:\app\xxx\product\11.2.0\dbhome_2\BIN>sqlldr control=c:\temp\xx.ctl log=c:\temp\xx.log
Username:Scott
Password:SQL * Loader: release 11.2.0.3.0 - Production on Sun Apr 5 06:28:06 2015
Copyright (c) 1982, 2011, Oracle and/or its affiliates. All rights reserved.
Commit the point reached - the number of logical records 7
Commit the point reached - the number of logical records 8C:\app\xxx\product\11.2.0\dbhome_2\BIN>exit
SQL > column column_2 format a15
SQL > column column_3 format a10
SQL > column column_4 format a8
SQL > column column_5 format a8
SQL > select * from my_table
2.COLUMN_1, COLUMN_2, COLUMN_3, COLUMN_4 COLUMN_5 COLONNE_6 BUSINESS_YR
--------- --------------- ---------- -------- -------- --------- -----------
MARCH 20, 15 1 P - 11 1111.22 2014 22 MARCH 15
21 MARCH 15 M_XXX-9-4 5607817 0 0 22 MARCH 15 2014
22 MARCH 15 M_DDD-8-2 54990 0 0 22 MARCH 15 2014
23 MARCH 15 R_1-46 5297481 24 24 22 MARCH 15 2014
16 March 15 X_1-48 has 8547274 13474 13474 15 March 15 2015
March 17, 15 1 t 15-dental 2118.12 15 March 15 2015
1 S - 1 S 18 MARCH 15 555 2015 15 MARCH 15
MARCH 19, 15 P_NNN-7 7455342 10941 10941 15 MARCH 15 2015SY.
-
SQL Loader Control file - which represent decimal numbers
Hello
I use the version of database Oracle 10.2.0. I will receive a data file delimited pipe I need to load into the table specified below. Can you please suggest me how to represent the last column ERROR_PERCENT in the control file, which is number (3.2) in the table? I tried DECIMAL (3,2), EXTERNAL (3,2) DECIMAL against it and I get errors wasgetting. Help, please.
CREATE TABLE TRACK_ERRORS
(
ACCOUNT_ID NUMBER (7).
DATESTAMP TIMESTAMP (6).
SPECIFIC_RISK NUMBER (3).
STOCK_RISK NUMBER (3).
ERROR_PERCENT NUMBER (3.2)
)
OPTIONS (SKIP = 1)
DOWNLOAD THE DATA
INFILE 'C:\Sqlldr\Input\Track_Errors.dat '.
BADFILE "C:\Sqlldr\Track_Errors.bad."
DISCARDFILE 'C:\Sqlldr\Track_Errors.dis '.
ADD
IN THE TABLE "TRACK_ERRORS.
fields ended by ' |' SURROUNDED OF POSSIBLY "" "
TRAILING NULLCOLS
(Account_Id EXTERNAL INTEGER (7)
, datestamp 'Rtrim (to_date (:datestamp,'YYYY/MM/DD')).
Specific_Risk INTEGER EXTERNAL (3)
Stock_Risk INTEGER EXTERNAL (3)
ERROR_PERCENT
)
Kind regards
NaveenNaveen Kumar C wrote:
I tried with decimal external. It does not work. The following is the log fileSQL * Loader: Release 10.2.0.1.0 - Production on Thu Feb 25 10:11:42 2010
Copyright (c) 1982, 2005, Oracle. All rights reserved.
Control file: track_errors.ctl
Data file: C:\Sqlldr\Input\Track_Errors.dat
Bad leadership: C:\Sqlldr\Track_Errors.bad
Delete the file: C:\Sqlldr\Track_Errors.dis
(Allow all releases)Number of loading: ALL
Number of jump: 1
Authorized errors: 50
Link table: 64 lines, maximum of 256000 bytes
Continuation of the debate: none is specified
Path used: classicsTable "TRACK_ERRORS', loaded from every logical record.
Insert the option in effect for this table: APPEND
TRAILING NULLCOLS option in effectColumn Position Len term Encl. Datatype name
------------------------------ ---------- ----- ---- ---- ---------------------
FIRST ARGUMENT ACCOUNT_ID 7 | O ("") CHARACTER
DATESTAMP NEXT * | O ("") CHARACTER
The SQL string for the column: "Rtrim (to_date (:datestamp,'YYYY/MM/DD')).
SPECIFIC_RISK 3 | O ("") CHARACTER
STOCK_RISK 3 | O ("") CHARACTER
ERROR_PERCENT NEXT * | O ("") CHARACTERSheet 1: Rejected - error on the table 'TRACK_ERRORS", the ERROR_PERCENT column.
ORA-01438: value larger than the precision specified for the columnSheet 2: Rejected - error on the table 'TRACK_ERRORS", the ERROR_PERCENT column.
ORA-01438: value larger than the precision specified for the columnSheet 3: Rejected - error on the table 'TRACK_ERRORS", the ERROR_PERCENT column.
ORA-01438: value larger than the precision specified for the columnTable "TRACK_ERRORS":
0 rows successfully loaded.
3 rows not loaded due to data errors.
0 rows not loading because all WHEN clauses were failed.
0 rows not populated because all fields are null.The space allocated to bind table: 34432 byte (64 lines)
Bytes of read buffer: 256000Ignored logical records total: 1
Total logical records read: 3
Total rejected logical records: 3
Total logical records ignored: 0Run started the Thu Feb 25 10:11:42 2010
Run finished the game Feb 25 10:11:55 2010Time was: 00:00:13.99
Time processor was: 00:00:00.14It does not work because of the data and not + external comma +.
These mistakes ORA-set out clearly that your data values are larger than the eligible accuracy.isotope
-
Hi all
I have a file with data. I want to insert only the exp_data < = current data in the control file. My like this.
DOWNLOAD THE DATA
INFILE ' D:\sample. DAT'
TRUNCATE
IN THE TABLE s_TABLE WHEN (1:6) < = "(to_char(sysdate,'mmddyy')).
TRAILING NULLCOLS
(
eff_data position(1:6).
name position(7:20)
)
During the execution of this I got error like this
SQL * Loader-350: at line 48 syntax error.
Illegal combination of nonalphanumeric characters
IN THE TABLE s_TABLE WHEN (1:6) < = "(to_char (sysdate, eIf I use with less symbol I receives the data. Is another way to achieve this scenario. If you need more data I'll provide you with.
Thank you.
Hello
Some examples of data.
011413DBTEST
011513DBDATAFORTEST
102313DATA
Table as:
Create the table s_TABLE
(
eff_data varchar2 (6).
name varchar2 (20)
)
-
Option of SQL loader control file
Hello
I just started using sql loader and I doubt as a requirement.
I used to get the first data file with 10 columns excel. We got a table with 10 columns backend and were load this excel file using sql loader.
but since last week, they changed the data file and are now sending the data in column 8. what my condition is, for the other 2 columns, I want to insert text 'COLUMN_DROPPED' in the backend table. Rest 8 columns must be filled as usual.
How can I handle files of control for this option?
I just want to know the option that I why I am not providing control file.
Thank you
Puneet974647 wrote:
My requirement is for the other 2 columns, I want to insert text 'COLUMN_DROPPED' in the backend table. Rest 8 columns must be filled as usual.First of all, it is only possible if remaining 2 column datatype is string (char/nchar, varchar2/nvarchar2, clob/nclob) and is at least 14 characters long. The rest is easy. Just change 2 last control file fields:
column9 constant 'COLUMN_DROPPED', column10 constant 'COLUMN_DROPPED'
SY.
-
Problem with SQL * Loader control file
Hi friends,
I use the following control file.
Here is my data fileLoad Data infile * BADFILE xx_ds_po_upload_bad_file.bad APPEND INTO TABLE xx_ds_po_upload_hdr when (1) = 'HDR' FIELDS TERMINATED BY " " TRAILING NULLCOLS ( header_id "xx_ds_poupload_hdr_s.nextval" ,Supplier_Number ,Supplier_Site_Code ) INTO TABLE xx_ds_po_upload_lnr when (1) = 'LNR' FIELDS TERMINATED BY " " TRAILING NULLCOLS ( header_id "xx_ds_poupload_hdr_s.currval" ,Organization_code ,Item ,quantity ,need_by_date ,line_id "xx_ds_poupload_lnr_s.nextval" )
When I insert the data, the program ends normally but given correct will not be inserted...HDR 123 001 LNR xxS XX 5 05
It is the way in which the data is inserted in the tables
Line tableHeader Table HEADER_ID SUPPLIER_NUMBER SUPPLIER_S --------- ------------------------------ ---------- 32 123 001
Of the foregoing, in the table of the line, we can see that 05 is inserted for organization_code and since we gave "TRAILING BY NULL COLUMNS" program has no error on and the other fields are NULL.HEADER_ID LINE_ID ORG ITEM QUANTITY NEED_BY_D --------- --------- --- -------------------- --------- --------- 32 10015 05
Can you please why 05 is taken for organization_code when xSS should be taken according to the data files?
Please advise on this
Kind regards
Anthony Alix.
Published by: Anthony Alix on April 29, 2010 11:32A load of table multiple when one later IN THE TABLE
clause starts the position is NOT defined at the beginning of the
logic automatically.This is train how to rewrite your code to get the right result
Load data
...
IN THE TABLE xx_ds_po_upload_hdr
When (1) = 'HDR '.
...
IN THE TABLE xx_ds_po_upload_lnr
When (1) = 'LNR.
...
header_id POSITION (1) "xx_ds_poupload_hdr_s.currval".
Organization_code
... -
How to call sql loader control file with in the pl/sql procedure
Hi friends,
I am doing a project in relation to the transfer data using queues. In the queue, I'll get a data delimited by tabs in the form of CLOB variable/message. I don't want to keep this dat in the oracle table.
During the updating of the data in the table.
1. don't want to write data to a file. (You want to access directly after the specific queue).
2. as the data is in the form of delimited by tabs, I want to use sql loader concept.
How can I call the ctrl charger sql file with in my pl/sql procedure. When I searched, most forums recommending the external procedure or a Java program.
Please guide me on this issue. My preferrence is pl sql, but don't know the external procedure. If no other way, I'll try Java.
I'm using oracle 9.2.0.8.0.
Thanks in advance,
Vimal...Or SQL * Loader, or external tables are designed to read data from a CLOB stored in the database. They both work on files stored on the file system. If you don't want the data to be written to a file, you have to roll your own parsing code. It is certainly possible. But it will be much less effective than SQL * Loader or external tables. And it is likely to lead to a little more code.
The simplest possible thing that might work would be to use something like Tom Kyte string tokenization package to read a line in the CLOB, divide the component parts and save the different chips in a significant collection (i.e. an object type or a record type that matches the table definition). Of course, you need manage things like the conversion of strings to numbers or dates, rejecting the lines, writing to log files, etc.
Justin
-
SQL Loader in error after the modified table
Hello
"I had a column in the table that was initially defined as VARCHAR2 (250), I changed the table and made 1000, when the data is over 250 characters sql loader is in error"
Field in the data file exceeds the maximum length. The table shows the field in VARCHAR2 (1000). Help, please.
Thank you
Gwenaël
I changed the table again to make VARCHAR2 (4000) and still have the error. My data are about 350 characters. Help, please
Change to the column sqlldr control file and explicitly set tank (4000). The default data in sqlldr type is char (255).
-
Hi all
I created a sql * simultaneous program of charger with a parameter to pass the path of the data file with file name. Now my question is how does the program know that the control file is in a specific path.
For example, I kept the control file in the $XXX_TOP/bin and the data file in the $XXX_TOP.
I have now in the program parameter, pass the path of the data file, but how the program takes the path of the default control file $XXX_TOP/bin.
Thanks and greetings
El MI created a sql * simultaneous program of charger with a parameter to pass the path of the data file with file name. Now my question is how does the program know that the control file is in a specific path.
For example, I kept the control file in the $XXX_TOP/bin and the data file in the $XXX_TOP.
I have now in the program parameter, pass the path of the data file, but how the program takes the path of the default control file $XXX_TOP/bin.
You can provide information on the data file in the control file, or switch the full directory path and the name of your file as an argument. Concurrent Manager passes the "data = (full path of the data file)" token at query execution time. Without a data file name, the concurrent manager ignores this token and SQL * Loader uses the data file name specified in the control file.
http://docs.Oracle.com/CD/E18727_01/doc.121/e12897/T302934T458254.htm#4163833
The control file must be placed in the directory XX_TOP/bin $.
http://oracleapplications99.blogspot.ca/2011/12/sqlloader-examples.html
http://imdjkoch.WordPress.com/2010/08/12/registering-SQL-Loader-as-a-concurrent-program/
http://erpschools.com/articles/SQL-LoaderThank you
Hussein -
Not able to load csv file CLOB columns in table
Hello
I'm trying to load a table with the Source file CLOB columns which is in .csv format. I get the following messages
"SQL * Loader-292: setting LINES ignored when an XML, VARRAY or LOB column is loaded.
Can anyone help me on how to proceed with my load of data.
Thank you!!!Hello
Ignore "SQL * Loader-292: setting LINES ignored when loading an XML, VARRAY or LOB column" error
After you import your csv file just change the length CHAR (100000).
ex: your column col1 CHAR (1000) to change CHAR (100000).
and deploy your mapping and execution
Kind regards
Vincent -
How to load the file name in the table target. ?
Hi Expertise,
I load the data of 100 files of same schema using packages,
It is a variable stores the names of files. I used this link for reference: ODI gurus: SEVERAL FILES - TARGET SINGLE TABLE - SINGLE INTERFACE & several files simple single interface target .
but now I need what files have been executed in the interface. Please give me some ideas?
I need when the data from a particular file was loading then in DB, the particular file name must also be sent to the target.using ODI 11.1.1.9 & wls 10.3
Help with kindness,
Thank you
Shakur
In my example src_file_name is a column name
and #projectName.variableName - is a variable
If you want to store in the column you define '#projectName.variableName.txt '- don't forget the single quotes - (as a result, you get an error)
-
How to load flat files without header to table in ODI
I try to get data from a flat file, but it doesn't have any header
as 1, tom, 36, usa.
I have a table with id column, name, age, country, and I want to get the data. Please let me know how to proceed.
Thanks in advance
If you add columns manually in the data model there is no need to reverse engineering. If you reverse engineer with header set to 0 ODI will simply give the columns arbitrary identifiers such as C1, C2, C3 etc. That you can leave or change.
Maybe you are looking for
-
Satellite A500 - 149 - graphics card problem
Hello I have a Toshiba Satellite A500-149 and last week my screen has scratches ace. The grapichs card is ATI Mobility Radeon HD 4650. I send the computer to Toshiba yesterday but I need feedback because a repair. If the same graph as problem could c
-
MFPM177: Cannot download driver
Hello! I just bought an HP Color Laser Jet MFP Pro M177. I am trying to download the driver but it not work not-is it because I'm running OS X 10.9.5? In the affirmative, please can you tell me what I need to do to install the printer. Is there anoth
-
Clock at 10 MHz continues with 1.8 Vpp using 6544
Hi everyone, I need to have a continuous 10 MHz clock with the help of 8Vpp 1, NI6544. In the examples, I found these 3 examples for me: 1 dynamic generation with voltage Configuration.vi (example HSDIO) 2 dynamic generation with exported (example HS
-
My T500 there a WWAN card or is it extensible WWAN on PCI slot, I have a map of foam with two antennas on this subject. T500 2055-A77 T500 all have no WWAN antenna or is it because I have the slot for SIM card, and I hope that someday I can use it.
-
Error code Windows updatefailed 0000057 has
original title: 0000057A error code updates fail.i get error code 0000057A.what can I do?