SQL Loader and the bad file
I use SQL Loader to read a file into a table. In my tests a lot of rows are rejected and written to the bad file. But there are no error messages.
Is there a way to find out why the row was rejected.
The Bad File
The bad file contains records that were rejected, either by SQL*Loader or by the Oracle database server. Some of the possible reasons for rejection are discussed in the next sections.
SQL*Loader Rejects
Datafile records are rejected by SQL*Loader when the input format is invalid. For example, if the second enclosure delimiter is missing, or if a delimited field exceeds its maximum length, SQL*Loader rejects the record. Rejected records are placed in the bad file.
Oracle Rejects
After a datafile record is accepted for processing by SQL*Loader, it is sent to the Oracle database server for insertion into a table as a row. If the Oracle database server determines that the row is valid, then the row is inserted into the table. If the row is determined to be invalid, then the record is rejected and SQL*Loader puts it in the bad file. The row may be invalid, for example, because a key is not unique, because a required field is null, or because the field contains invalid data for the Oracle datatype.
YOU WILL get more information
sqlldr help=y
also send your control file syntax
kuljeet pal singh
Similar Messages
-
SQL Loader and weird source file structure
I am familiar with using SQL Loader to process comma or tab delimited text files into proper table data. But how do you process "positionally delimited" files?!
I mean, I have a text file which looks like this:
Item A
---attribute1
---attribute2
---attribute3
---attribute4
Item B
---attribute1
---attribute2
---attribute3
---attribute4
Item C
---attribute1
---attribute2
---attribute3
---attribute4
And so on. How do I tell SQL Loader, 'rows 1, 6 and 11 are the first column in the table; rows 2, 7 and 12 and the second column; rows 3, 8, 13 are the third and so on? I want to end up with data in the form
Item A Attribute1 Attribute2 Attribute3 Attribute 4
Item B Attribute1 Attribute2 Attribute3 Attribute 4
Item C Attribute1 Attribute2 Attribute3 Attribute 4
Is such a thing even possible with SQL Loader?If your data is exactly in that format like in sample provided by Enrique, you can try to play with that certain data pattern. Again, based on previous example:
~ >cat data.dat
map1
615050: ( 95, 83, 68) #5F5344 rgb(95,83,68)
605728: ( 36, 27, 22) #241B16 rgb(36,27,22)
225834: (154,107, 84) #9A6B54 rgb(154,107,84)
176305: (218,187,155) #DABB9B rgb(218,187,155)
141083: (188,142,111) #BC8E6F rgb(188,142,111)
map2
615050: ( 95, 83, 68) #5F5344 rgb(95,83,68)
605728: ( 36, 27, 22) #241B16 rgb(36,27,22)
225834: (154,107, 84) #9A6B54 rgb(154,107,84)
176305: (218,187,155) #DABB9B rgb(218,187,155)
141083: (188,142,111) #BC8E6F rgb(188,142,111)
map3
615050: ( 95, 83, 68) #5F5344 rgb(95,83,68)
605728: ( 36, 27, 22) #241B16 rgb(36,27,22)
225834: (154,107, 84) #9A6B54 rgb(154,107,84)
176305: (218,187,155) #DABB9B rgb(218,187,155)
141083: (188,142,111) #BC8E6F rgb(188,142,111)
~ >cat data.ctl
LOAD DATA
INFILE "data.dat" "str '\nm'"
DISCARDFILE "data.dsc"
DISCARDMAX 999
REPLACE
-- CONCATENATE 6
INTO TABLE data
fields terminated by X'0a' trailing nullcols
( item char "replace('m'||:item,'mm','m')",
attrib1 char,
attrib2 char,
attrib3 char,
attrib4 char,
attrib5 char
~ >sqlplus scott/tiger
SQL*Plus: Release 10.2.0.4.0 - Production on Wed Oct 15 16:27:25 2008
Copyright (c) 1982, 2007, Oracle. All Rights Reserved.
Connected to:
Oracle Database 10g Enterprise Edition Release 10.2.0.4.0 - Production
With the Partitioning, OLAP, Data Mining and Real Application Testing options
SQL> select count(*) from data;
COUNT(*)
0
SQL> !sqlldr userid=scott/tiger control=data.ctl
SQL*Loader: Release 10.2.0.4.0 - Production on Wed Oct 15 16:28:29 2008
Copyright (c) 1982, 2007, Oracle. All rights reserved.
Commit point reached - logical record count 2
Commit point reached - logical record count 3
SQL> col item for a4
SQL> col attrib1 for a50
SQL> col attrib2 for a50
SQL> select item,attrib1,attrib2 from data;
ITEM ATTRIB1 ATTRIB2
map1 615050: ( 95, 83, 68) #5F5344 rgb(95,83,68) 605728: ( 36, 27, 22) #241B16 rgb(36,27,22)
map2 615050: ( 95, 83, 68) #5F5344 rgb(95,83,68) 605728: ( 36, 27, 22) #241B16 rgb(36,27,22)
map3 615050: ( 95, 83, 68) #5F5344 rgb(95,83,68) 605728: ( 36, 27, 22) #241B16 rgb(36,27,22)
SQL>As you see, i loaded on linux, on windows you may slightly adjust controlfile to reflect end of lines...
Best regards
Maxim -
SQL loader Field in data file exceeds maximum length for CLOB column
Hi all
I'm loading data from text file separated by TAB and i got the error below for some lines.
Event the column is CLOB data type is there a limitation of the size of a CLOB data type.
The error is:
Record 74: Rejected - Error on table _TEMP, column DEST.
Field in data file exceeds maximum length
I'm using SQL Loader and the database is oracle 11g r2 on linux Red hat 5
Here are the line causing the error fronm my data file and my table description for test:
create table TEMP
CODE VARCHAR2(100),
DESC VARCHAR2(500),
RATE FLOAT,
INCREASE VARCHAR2(20),
COUNTRY VARCHAR2(500),
DEST CLOB,
WEEK VARCHAR2(10),
IS_SAT VARCHAR2(50),
IS_SUN VARCHAR2(50)
CONTROL FILE:
LOAD DATA
INTO TABLE TEMP
APPEND
FIELDS TERMINATED BY X'9' TRAILING NULLCOLS
CODE,
DESC,
RATE,
INCREASE,
COUNTRY),
DEST,
WEEK,
IS_SAT,
IS_SUN
Data file:
BHS Mobile Bahamas - Mobile 0.1430 1 "242357, 242359, 242375, 242376, 242395, 242421, 242422, 242423, 242424, 242425, 242426, 242427, 242428, 242429, 242431, 242432, 242433, 242434, 242435, 242436, 242437, 242438, 242439, 242441, 242442, 242443, 242445, 242446, 242447, 242448, 242449, 242451, 242452, 242453, 242454, 242455, 242456, 242457, 242458, 242462, 242463, 242464, 242465, 242466, 242467, 242468, 24247, 242524, 242525, 242533, 242535, 242544, 242551, 242552, 242553, 242554, 242556, 242557, 242558, 242559, 242565, 242577, 242636, 242646, 242727"
BOL Mobile ENTEL Bolivia - Mobile Entel 0.0865 Increase 591 "67, 68, 71, 72, 73, 740, 7410, 7411, 7412, 7413, 7414, 7415, 7420, 7421, 7422, 7423, 7424, 7425, 7430, 7431, 7432, 7433, 7434, 7435, 7436, 7437, 7440, 7441, 7442, 7443, 7444, 7445, 7450, 7451, 7452, 7453, 7454, 7455, 746, 7470, 7471, 7472, 7475, 7476, 7477, 7480, 7481, 7482, 7483, 7484, 7485, 7486, 7490, 7491, 7492, 7493, 7494, 7495, 7496" Thank you.Hi
Thank you for youe help, I found the solution and here what i do in my Control file i added
char(40000) OPTIONALLY ENCLOSED BY '"' .
LOAD DATA
INTO TABLE TEMP
APPEND
FIELDS TERMINATED BY X'9' TRAILING NULLCOLS
CODE,
DESC,
RATE,
INCREASE,
COUNTRY,
DEST
char(40000) OPTIONALLY ENCLOSED BY '"',
WEEK,
IS_SAT,
IS_SUN
Thank you for your help. -
How do I find bad music files? I have thousands of files, but some are bad. When I try to load them into iTunes, it just spins. I need a routine to identify and remove the bad files. Any ideas?
Hi ajoddo20,
Welcome to the Apple Support Communities!
You can use Home Sharing to import music and other media from one computer to another. Please use the instructions and information located in the attached article for information on how to complete the process.
iTunes 11 for Mac: Use Home Sharing to import items from another iTunes library
Cheers,
Joe -
SQL loader and stream files with new line '
I have been trying unsuccessfully to load EDI files using SQL loader. The problem
is that the lines are terminated by ' and when I use the stream file option it does
not recognise the line terminator given. As I understand it from the documentation
this should work - but it does not. I have also used the Hex option with no better
result. Does anyone have any ideas ?
I can and have used tr "[']" "[\n]" in Unix to convert the ' to newlines - I just
wonder am I missing something in SQL loader which will allow me to do this ?
This is the sql loader control file
LOAD DATA
INFILE 'WS860685.MFD' "Str ''' "
BADFILE 'WS860685.bad'
DISCARDFILE 'WS860685.dsc'
INTO TABLE "DUND1"."EDI_LOADED_TEMP"
REPLACE
FIELDS TERMINATED BY '+'
TRAILING NULLCOLS
(L1,
L2,
L3,
L4,
L5,
L6,
L7,
L8,
L9,
L10,
L11,
L12,
L13,
L14,
L15,
L16,
L17,
L18,
L19,
L20,
L21,
L22,
L23,
L24,
L25,
L26,
L27,
L28,
L29,
L30,
L31,
L32,
L33,
L34,
L35,
L36,
L37,
L38,
L39,
L40,
LNO)
Heres a sample of the data
UNB+UNOA:2+5398888501357+5398888501838+080306:0737+395+ DESADV+++1'UNH+0001+DESADV:D:93A:UN:EAN004'http://asktom.oracle.com/pls/asktom/f?p=100:11:0::::P11_QUESTION_ID:6020061915147
answers this question perfectly -
SQL*Loader and multiple files
Hello, am tasked with loading tables with 21+ million rows. Will SQL*Loader perform better with one large file or many smaller files? Is there any ideal file size for optimal performance? Thank you
DavidDon, when I tried to loada 21M row table using direct, I get the following messages:
Record 2373: Rejected - Error on table STAGE_CUSTOMER.
ORA-03113: end-of-file on communication channel
SQL*Loader-926: OCI error while uldlfca:OCIDirPathColArrayLoadStream for table STAGE_CUSTOMER
SQL*Loader-2026: the load was aborted because SQL Loader cannot continue.
SQL*Loader-925: Error while uldlgs: OCIStmtExecute (ptc_hp)
ORA-03114: not connected to ORACLE
SQL*Loader-925: Error while uldlgs: OCIStmtFetch (ptc_hp)
ORA-24338: statement handle not executed
Here is the SQL*Loader log:
SQL*Loader: Release 9.2.0.1.0 - Production on Thu Apr 26 15:38:29 2007
Copyright (c) 1982, 2002, Oracle Corporation. All rights reserved.
Control File: stage_customer.ctl
Character Set UTF8 specified for all input.
First primary datafile stage_Customer_20070301.csv has a
utf8 byte order mark in it.
Data File: stage_Customer_20070301.csv
Bad File: stage_Customer_20070301.bad
Discard File: none specified
(Allow all discards)
Number to load: ALL
Number to skip: 0
Errors allowed: 1000
Continuation: none specified
Path used: Direct
Silent options: FEEDBACK
Table STAGE_CUSTOMER, loaded from every logical record.
Insert option in effect for this table: APPEND
TRAILING NULLCOLS option in effect
Column Name Position Len Term Encl Datatype
ROW_ID SEQUENCE (MAX, 1)
CUSTOMER_ACCT_NUM FIRST * , O(") CHARACTER
IS_DELETED NEXT * , O(") CHARACTER
SQL string for column : "CASE WHEN UPPER(:Is_Deleted) IN ('FALSE','0') THEN 0 ELSE 1 END"
NAME_PREFIX NEXT * , O(") CHARACTER
FIRST_NAME NEXT * , O(") CHARACTER
MIDDLE_NAME NEXT * , O(") CHARACTER
LAST_NAME NEXT * , O(") CHARACTER
NAME_SUFFIX NEXT * , O(") CHARACTER
NICK_NAME NEXT * , O(") CHARACTER
ALT_FIRST_NAME NEXT * , O(") CHARACTER
ALT_LAST_NAME NEXT * , O(") CHARACTER
MARKETING_SOURCE_ID NEXT * , O(") CHARACTER
HOME_PHONE NEXT * , O(") CHARACTER
WORK_PHONE NEXT * , O(") CHARACTER
MOBILE_PHONE NEXT * , O(") CHARACTER
ALTERNATE_PHONE NEXT * , O(") CHARACTER
EMAIL_ADDR NEXT * , O(") CHARACTER
ALT_EMAIL_ADDR NEXT * , O(") CHARACTER
BIRTH_DATE NEXT * , O(") CHARACTER
SQL string for column : "TRUNC(TO_DATE(:Birth_Date, 'MM/DD/YYYY HH24:MI:SS'))"
SALES_CHANNEL_ID NEXT * , O(") CHARACTER
SQL string for column : "decode(:Sales_Channel_id,NULL,NULL,NULL)"
ASSOCIATE_NUMBER NEXT * , O(") CHARACTER
ALT_ASSOCIATE_NUMBER NEXT * , O(") CHARACTER
UPDATE_LOCATION_CD NEXT * , O(") CHARACTER
UPDATE_DATE NEXT * , O(") CHARACTER
SQL string for column : "TRUNC(TO_DATE(:Update_Date, 'MM/DD/YYYY HH24:MI:SS'))"
CUSTOMER_LOGIN_NAME NEXT * , O(") CHARACTER
DISCOUNT_CD NEXT * , O(") CHARACTER
DISCOUNT_PERCENT NEXT * , O(") CHARACTER
BUSINESS_NAME NEXT * , O(") CHARACTER
POS_TAX_FLAG NEXT * , O(") CHARACTER
POS_TAX_PROMPT NEXT * , O(") CHARACTER
SQL string for column : "CASE WHEN UPPER(:POS_TAX_PROMPT) IN ('FALSE','0') THEN 0 ELSE 1 END"
POS_DEFAULT_TAX_ID NEXT * , O(") CHARACTER
POS_TAX_ID_EXPIRATION_DATE NEXT * , O(") CHARACTER
POS_AUTHORIZED_USER_FLAG NEXT * , O(") CHARACTER
SQL string for column : "CASE WHEN UPPER(:POS_AUTHORIZED_USER_FLAG) IN ('FALSE','0') THEN 0 ELSE 1 END"
POS_ALLOW_PURCHASE_ORDER_FLAG NEXT * , O(") CHARACTER
SQL string for column : "CASE WHEN UPPER(:POS_ALLOW_PURCHASE_ORDER_FLAG) IN ('FALSE','0') THEN 0 ELSE 1 END"
ADDRESS1 NEXT * , O(") CHARACTER
ADDRESS2 NEXT * , O(") CHARACTER
ADDRESS3 NEXT * , O(") CHARACTER
CITY NEXT * , O(") CHARACTER
STATE_CD NEXT * , O(") CHARACTER
POSTAL_CD NEXT * , O(") CHARACTER
COUNTRY_CD NEXT * , O(") CHARACTER
ALLOW_UPDATE NEXT * , O(") CHARACTER
SQL string for column : "CASE WHEN UPPER(:ALLOW_UPDATE) IN ('FALSE','0') THEN 0 ELSE 1 END"
ACTION_CODE NEXT * , O(") CHARACTER
SQL string for column : "CASE WHEN UPPER(:action_code) IN ('FALSE','0') THEN 0 ELSE 1 END"
ACCOUNT_TYPE_ID NEXT * , O(") CHARACTER
LOCALE_CD NEXT * , O(") CHARACTER
SQL string for column : "CASE WHEN :Locale_CD IS NOT NULL AND :Locale_CD LIKE '__-__' THEN :Locale_CD ELSE 'en-US' END"
IS_READY_FOR_PROCESSING CONSTANT
Value is '1'
IS_BUSINESS CONSTANT
Value is '0'
HAD_ERRORS CONSTANT
Value is '0'
Record 2373: Rejected - Error on table STAGE_CUSTOMER.
ORA-03113: end-of-file on communication channel
SQL*Loader-926: OCI error while uldlfca:OCIDirPathColArrayLoadStream for table STAGE_CUSTOMER
SQL*Loader-2026: the load was aborted because SQL Loader cannot continue.
SQL*Loader-925: Error while uldlgs: OCIStmtExecute (ptc_hp)
ORA-03114: not connected to ORACLE
SQL*Loader-925: Error while uldlgs: OCIStmtFetch (ptc_hp)
ORA-24338: statement handle not executed
Table STAGE_CUSTOMER:
0 Rows successfully loaded.
1 Row not loaded due to data errors.
0 Rows not loaded because all WHEN clauses were failed.
0 Rows not loaded because all fields were null.
Bind array size not used in direct path.
Column array rows : 5000
Stream buffer bytes: 256000
Read buffer bytes: 1048576
Total logical records skipped: 0
Total logical records read: 3469
Total logical records rejected: 1
Total logical records discarded: 0
Direct path multithreading optimization is disabled
Run began on Thu Apr 26 15:38:29 2007
Run ended on Thu Apr 26 15:38:30 2007
Elapsed time was: 00:00:01.18
CPU time was: 00:00:00.32 -
SQL LOADER NOT GENERATING BAD,LOG FILES
Hi
I am calling sqlloader from sql script using host command.We are using parameter file to mention about bad,log,ctl files.sql loader is running successfully all the records are inserted.but the problem is ,it is not creating log file,bad files ....Please give me suggestions.
Thanks.Hi,
As per ur saying the recodes are inserted successfully, so the bad file wont get created. And considering the log file, the path should mentioned in the CTL file and if not mentioned then the log file will created in the same area where the CTL file with the name of ctl file with extension .log instead of .ctl -
Problem : Load PDF or similiar files( stored at operating system) into an oracle table using SQl*Loader .
and than Unload the files back from oracle tables to prevoius format.
I 've used SQL*LOADER .... " sqlldr " command as :
" sqlldr scott/[email protected] control=c:\sqlldr\control.ctl log=c:\any.txt "
Control file is written as :
LOAD DATA
INFILE 'c:\sqlldr\r_sqlldr.txt'
REPLACE
INTO table r_sqlldr
Fields terminated by ','
id sequence (max,1) ,
fname char(20),
data LOBFILE(fname) terminated by EOF )
It loads files ( Pdf, Image and more...) that are mentioned in file r_sqlldr.txt into oracle table r_sqlldr
Text file ( used as source ) is written as :
c:\kalam.pdf,
c:\CTSlogo1.bmp
c:\any1.txt
after this load ....i used UTL_FILE to unload data and write procedure like ...
CREATE OR REPLACE PROCEDURE R_UTL AS
l_file UTL_FILE.FILE_TYPE;
l_buffer RAW(32767);
l_amount BINARY_INTEGER ;
l_pos INTEGER := 1;
l_blob BLOB;
l_blob_len INTEGER;
BEGIN
SELECT data
INTO l_blob
FROM r_sqlldr
where id= 1;
l_blob_len := DBMS_LOB.GETLENGTH(l_blob);
DBMS_OUTPUT.PUT_LINE('blob length : ' || l_blob_len);
IF (l_blob_len < 32767) THEN
l_amount :=l_blob_len;
ELSE
l_amount := 32767;
END IF;
DBMS_LOB.OPEN(l_blob, DBMS_LOB.LOB_READONLY);
l_file := UTL_FILE.FOPEN('DBDIR1','Kalam_out.pdf','w', 32767);
DBMS_OUTPUT.PUT_LINE('File opened');
WHILE l_pos < l_blob_len LOOP
DBMS_LOB.READ (l_blob, l_amount, l_pos, l_buffer);
DBMS_OUTPUT.PUT_LINE('Blob read');
l_pos := l_pos + l_amount;
UTL_FILE.PUT_RAW(l_file, l_buffer, TRUE);
DBMS_OUTPUT.PUT_LINE('writing to file');
UTL_FILE.FFLUSH(l_file);
UTL_FILE.NEW_LINE(l_file);
END LOOP;
UTL_FILE.FFLUSH(l_file);
UTL_FILE.FCLOSE(l_file);
DBMS_OUTPUT.PUT_LINE('File closed');
DBMS_LOB.CLOSE(l_blob);
EXCEPTION
WHEN OTHERS THEN
IF UTL_FILE.IS_OPEN(l_file) THEN
UTL_FILE.FCLOSE(l_file);
END IF;
DBMS_OUTPUT.PUT_LINE('Its working at last');
END R_UTL;
This loads data from r_sqlldr table (BOLBS) to files on operating system ,,,
-> Same procedure with minor changes is used to unload other similar files like Images and text files.
In above example : Loading : 3 files 1) Kalam.pdf 2) CTSlogo1.bmp 3) any1.txt are loaded into oracle table r_sqlldr 's 3 rows respectively.
file names into fname column and corresponding data into data ( BLOB) column.
Unload : And than these files are loaded back into their previous format to operating system using UTL_FILE feature of oracle.
so PROBLEM IS : Actual capacity (size ) of these files is getting unloaded back but with quality decreased. And PDF file doesnt even view its data. means size is almot equal to source file but data are lost when i open it.....
and for images .... imgaes are getting loaded an unloaded but with colors changed ....
Also features ( like FFLUSH ) of Oracle 've been used but it never worked
ANY SUGGESTIONS OR aLTERNATE SOLUTION TO LOAD AND UNLOAD PDFs through Oracle ARE REQUESTED.
------------------------------------------------------------------------------------------------------------------------Thanks Justin ...for a quick response ...
well ... i am loading data into BLOB only and using SQL*Loader ...
I've never used dbms_lob.loadFromFile to do the loads ...
i 've opend a file on network and than used dbms_lob.read and
UTL_FILE.PUT_RAW to read and write data into target file.
actually ...my process is working fine with text files but not with PDF and IMAGES ...
and your doubt of ..."Is the data the proper length after reading it in?" ..m not getting wat r you asking ...but ... i think regarding data length ..there is no problem... except ... source PDF length is 90.4 kb ..and Target is 90.8 kb..
thats it...
So Request u to add some more help ......or should i provide some more details ?? -
I was moving 90 files from one folder to another and instead accidently double clicked all the files I had selected and they all opened at once and now they are all stuck trying to load and the program is not responding.
When I put my mouse over the folders, it's just the loading cursor so i can't select anything. I've tried using 'command' - 'option' - 'W' and that doesn't work either.
I have tried restarting finder and all that does is shut all of the folders and reopens them and they get stuck trying to load all over again.
I have tried restarting my macbook and every time I log back in, it restarts all the programs and all the finder windows and the whole process repeats.
(even when I unselect the 'restart opened programs' box.)
I really hope someone knows how to troubleshoot this problem I am having!You're trying to use Spry Accordions for something they were never intended to do. Why don't you switch to a more appropriate jQuery Mega Menu?
http://www.designchemical.com/lab/jquery-mega-drop-down-menu-plugin/examples/
In case you missed the announcement, Spry is dead. Adobe abandoned it late last year because it has outlived its usefulness.
http://blogs.adobe.com/dreamweaver/2012/08/update-on-adobe-spry-framework-availability.htm l
Nancy O. -
I have problem and your help to solve it would be very much appreciated.
I am uploading a text file with SQL Loader into a table. Since I used APPEND option in the Loader, I don't want records to be duplicated. So, I wrote a "BEFORE INSERT .. FOR EACH ROW" trigger to check whether that row already exists or not.
For example, let us consider a table TEST as follows.
Fld1 NUMBER(2);
Fld2 VARCHAR2(10);
Fld3 VARCHAR2(10);
I have a trigger on this table.
CREATE OR REPLACE TRIGGER Trg_Bef_Insert_Test
BEFORE INSERT ON Test FOR EACH ROW
DECLARE
vCount NUMBER(2);
DuplicateRow EXCEPTION;
BEGIN
SELECT Count(*) INTO vCount FROM Test
WHERE fld1 || fld2 || fld3 = :new.fld1 || :new.fld2 || :new.fld3;
IF vCount > 0 THEN
RAISE DuplicateRow;
END IF;
EXCEPTION
WHEN DuplicateRow THEN
Raise_Application_Error (-20001,'Record already exists');
WHEN OTHERS THEN
DBMS_OUTPUT.PUT_LINE('ERROR : ' || SQLCODE || '; ' || SUBSTR(SQLERRM, 1, 150));
END;
Please refer to the following SQL statements which I executed in the SQL Plus.
SQL> insert into test values (1,'one','first');
1 row created.
SQL> insert into test values (1,'one','first');
insert into test values (1,'one','first')
ERROR at line 1:
ORA-20001: Record already exists
ORA-06512: at "CAMELLIA.TRG_TEST", line 13
ORA-04088: error during execution of trigger 'CAMELLIA.TRG_TEST'
Would anyone tell me why do errors -6512 and -4088 occur ?
Also, if you have any other suggestion to handle this situation, please let me know.
By the way, I am using Oracle 8.1.7.
Thank you.There are a few things wrong here, but you should really use a unique constraint for this.
SQL> create table t (a number, b number, c number,
2 constraint uk unique (a, b, c));
Table created.Here's an example data file with 12 records three of which are duplicates.
1,2,3
3,4,5
6,7,8
3,2,1
5,5,5
3,4,5
3,2,1
1,1,1
2,2,2
6,7,8
8,8,8
9,9,9And a control file
load data
infile 'in.dat'
append
into table t
fields terminated by ',' optionally enclosed by '"'
(a, b, c)Running it with sql loader, inserts the nine records, outputs the three duplicates to a .bad file and logs all the errors in the .log file. No need for triggers or any code.
$ sqlldr control=in.ctl
Username:xxx
Password:
SQL*Loader: Release 9.2.0.1.0 - Production on Mon Apr 21 23:16:44 2003
Copyright (c) 1982, 2002, Oracle Corporation. All rights reserved.
Commit point reached - logical record count 12
$ cat in.bad
3,4,5
3,2,1
6,7,8
SQL> select * from t;
A B C
1 2 3
3 4 5
6 7 8
3 2 1
5 5 5
1 1 1
2 2 2
8 8 8
9 9 9
9 rows selected. -
SQL Loader and Floating Point Numbers
Hi
I have a problem loading floating point numbers using SQL Loader. If the number has more than 8 significant digits SQL Loader rounds the number i.e. 1100000.69 becomes 1100000.7. The CTL file looks as follows
LOAD DATA
INFILE '../data/test.csv' "str X'0A'"
BADFILE '../bad/test.bad'
APPEND
INTO TABLE test
FIELDS TERMINATED BY "," OPTIONALLY ENCLOSED BY '"'
Amount CHAR
and the data file as follows
"100.15 "
"100100.57 "
"1100000.69 "
"-2000000.33"
"-100000.43 "
the table defined as follows
CREATE TABLE test
Amount number(15,4)
) TABLESPACE NNUT050M1;
after loading a select returns the following
100.15
100100.57
1100000.7
-2000000
-100000.4
Thanks in advance
RussellActually if you format the field to display as (say) 999,999,999.99, you will see the correct numbers loaded via SQL Loader.
null -
SQL*Loader and binary data
i have a C routine that builds SQL*Loader input files. the input files contain multiple records, with a couple of integer columns and a raw(1400) field. the control file specifies a record separator of '|', which seems weird (having text in the middle of raw data) but also is somewhat co-operative (see below).
so i basically write each integer to the file, then a short (2-byte) length value for the raw field, then the raw field. then the '|' separator.
i've noticed that if the size of raw field is 400 bytes or less, everything works fine, i get the correct number of records in the database.
unfortunately, with a size of 401 or more, SQL*Loader parses the thing into twice as many records as it should. so if i've written 3 records to my input data file, with each record's raw field at 400 bytes or less i get 3 records loaded. but any with a raw field of 401+, i get two records for each.
any ideas why? and how to correct this? also, any ideas on a better way to do this? all the examples of large data in the online doc and the o'reilly book favor showing examples with large character data, which does me not much good.
tia. johni have a C routine that builds SQL*Loader input files. the input files contain multiple records, with a couple of integer columns and a raw(1400) field. the control file specifies a record separator of '|', which seems weird (having text in the middle of raw data) but also is somewhat co-operative (see below).
so i basically write each integer to the file, then a short (2-byte) length value for the raw field, then the raw field. then the '|' separator.
i've noticed that if the size of raw field is 400 bytes or less, everything works fine, i get the correct number of records in the database.
unfortunately, with a size of 401 or more, SQL*Loader parses the thing into twice as many records as it should. so if i've written 3 records to my input data file, with each record's raw field at 400 bytes or less i get 3 records loaded. but any with a raw field of 401+, i get two records for each.
any ideas why? and how to correct this? also, any ideas on a better way to do this? all the examples of large data in the online doc and the o'reilly book favor showing examples with large character data, which does me not much good.
tia. john -
Hello,
I'm trying to use sql-loader with parallel option.
I have loaded data with and without parellel but it takes same time. I don't appreciatte a better perfomance with parallel.
In the called to sqlldr i'm adding PARALLEL=TRUE. That is the only change i have made.
Do i have to make any 'alter table' with my Oracle table??.
Any advice will be greatly appreciatted.
NaujThe PARALLEL=TRUE parameter will not, by itself, result in any performance gain at all. It is really just a flag which tells SQL*Loader to allow multiple sessions to perform direct loads at the same time. It is up to you to actually spawn multiple SQL*Loader sessions on different portions of the data (e.g. you might divide your source data into multiple files and run distinct SQL*Loader sessions on each file concurrently)
-
Sql*loader and sequence() for primary keys
I have a question regarding SQL*Loader with the sequence() function and using it for a primary key to load records in multiple tables from one input record. I am pulling data from a delimited file and populating several tables from each row. For the primary key, I am using the sequence function.
For the first table (the parent), I use sequence(40000,1) for the key. Since the remaining inserts are based on the same logical record, I use sequence(40000,1) for those too (one record for each month). The problem comes in when a child record does not pass a WHEN clause (the amount is zero). Then it almost seems as if the parent record is not loaded and the child (or children) that does pass the WHEN clause are assigned to the next parent! Obviously, the sequence is getting out of sync between the children and the parent.
I've looked in the documentation and tried several different ways to attack this problem. Is there a bug in SQLLDR (8.1.7) or is it just my coding.
I will try to include the files below but they are very large.
Thanks for your help.
Dan
***CONTROL FILE***
LOAD DATA
INFILE 'rent.csv'
INTO TABLE BUDGET_LINE
append
WHEN TOT_AMT != '0'
FIELDS TERMINATED BY ',' OPTIONALLY ENCLOSED BY '"'
TRAILING NULLCOLS
NETMAN_ITEM_NO FILLER CHAR,
SPEND FILLER CHAR,
ACCOUNT FILLER CHAR,
TOT_AMT FILLER CHAR,
JAN_AMT FILLER CHAR,
JAN_CNT FILLER CHAR,
FEB_AMT FILLER CHAR,
FEB_CNT FILLER CHAR,
MAR_AMT FILLER CHAR,
MAR_CNT FILLER CHAR,
APR_AMT FILLER CHAR,
APR_CNT FILLER CHAR,
MAY_AMT FILLER CHAR,
MAY_CNT FILLER CHAR,
JUN_AMT FILLER CHAR,
JUN_CNT FILLER CHAR,
JUL_AMT FILLER CHAR,
JUL_CNT FILLER CHAR,
AUG_AMT FILLER CHAR,
AUG_CNT FILLER CHAR,
SEP_AMT FILLER CHAR,
SEP_CNT FILLER CHAR,
OCT_AMT FILLER CHAR,
OCT_CNT FILLER CHAR,
NOV_AMT FILLER CHAR,
NOV_CNT FILLER CHAR,
DEC_AMT FILLER CHAR,
DEC_CNT FILLER CHAR,
CUT FILLER CHAR,
NETMANGEN FILLER CHAR,
NETMAN_item BOUNDFILLER CHAR,
NETMAN_item_seq BOUNDFILLER CHAR,
NETMAN_location BOUNDFILLER CHAR,
UPDATED_ON DATE "MM/DD/YYYY",
NETMAN_com_desc BOUNDFILLER CHAR,
NETMAN_vendor BOUNDFILLER CHAR,
NETMAN_generation BOUNDFILLER CHAR,
CREATED_ON SYSDATE,
CREATED_BY CONSTANT '0',
UPDATED_BY CONSTANT '0',
ACTIVE CONSTANT 'T',
GL_CODE_COMBO_ID CONSTANT '0',
BUDGET_TYPE CONSTANT 'B',
AMOUNT_TYPE CONSTANT 'D',
source constant 'N',
BUDGET_LINE_ID SEQUENCE(40000,1),
DESCRIPTION "(:NETMAN_item)||'-'||(:NETMAN_item_seq)||'; '||:NETMAN_com_desc||'; '||:NETMAN_vendor||' ('||:NETMAN_generation||')'"
INTO TABLE GL_CODE_TEMP
append
WHEN TOT_AMT != '0'
FIELDS TERMINATED BY ',' OPTIONALLY ENCLOSED BY '"'
TRAILING NULLCOLS
NETMAN_ITEM_NO FILLER POSITION(1) CHAR TERMINATED BY ',',
BUDGET_LINE_ID SEQUENCE(40000,1),
SPENDER CHAR ,
ACCT CHAR ,
TOT_AMT FILLER CHAR
INTO TABLE BUDGET_COST
append
WHEN AMOUNT != '0'
FIELDS TERMINATED BY ',' OPTIONALLY ENCLOSED BY '"'
TRAILING NULLCOLS
NETMAN_ITEM_NO FILLER POSITION(1) CHAR TERMINATED BY ',',
BUDGET_LINE_ID SEQUENCE(40000,1),
PERIOD_ID CONSTANT '1',
SPEND FILLER CHAR,
ACCOUNT FILLER CHAR,
TOT_AMT FILLER CHAR,
AMOUNT CHAR
INTO TABLE BUDGET_COST
append
WHEN AMOUNT != '0'
FIELDS TERMINATED BY ',' OPTIONALLY ENCLOSED BY '"'
TRAILING NULLCOLS
NETMAN_ITEM_NO FILLER POSITION(1) CHAR TERMINATED BY ',',
BUDGET_LINE_ID SEQUENCE(40000,1),
PERIOD_ID CONSTANT '2',
SPEND FILLER CHAR,
ACCOUNT FILLER CHAR,
TOT_AMT FILLER CHAR,
JAN_AMT FILLER CHAR,
JAN_CNT FILLER CHAR,
AMOUNT CHAR
INTO TABLE BUDGET_COST
append
WHEN AMOUNT != '0'
FIELDS TERMINATED BY ',' OPTIONALLY ENCLOSED BY '"'
TRAILING NULLCOLS
NETMAN_ITEM_NO FILLER POSITION(1) CHAR TERMINATED BY ',',
BUDGET_LINE_ID SEQUENCE(40000,1),
PERIOD_ID CONSTANT '3',
SPEND FILLER CHAR,
ACCOUNT FILLER CHAR,
TOT_AMT FILLER CHAR,
JAN_AMT FILLER CHAR,
JAN_CNT FILLER CHAR,
FEB_AMT FILLER CHAR,
FEB_CNT FILLER CHAR,
AMOUNT CHAR
INTO TABLE BUDGET_COST
append
WHEN AMOUNT != '0'
FIELDS TERMINATED BY ',' OPTIONALLY ENCLOSED BY '"'
TRAILING NULLCOLS
NETMAN_ITEM_NO FILLER POSITION(1) CHAR TERMINATED BY ',',
BUDGET_LINE_ID SEQUENCE(40000,1),
PERIOD_ID CONSTANT '4',
SPEND FILLER CHAR,
ACCOUNT FILLER CHAR,
TOT_AMT FILLER CHAR,
JAN_AMT FILLER CHAR,
JAN_CNT FILLER CHAR,
FEB_AMT FILLER CHAR,
FEB_CNT FILLER CHAR,
MAR_AMT FILLER CHAR,
MAR_CNT FILLER CHAR,
AMOUNT CHAR
INTO TABLE BUDGET_COST
append
WHEN AMOUNT != '0'
FIELDS TERMINATED BY ',' OPTIONALLY ENCLOSED BY '"'
TRAILING NULLCOLS
NETMAN_ITEM_NO FILLER POSITION(1) CHAR TERMINATED BY ',',
BUDGET_LINE_ID SEQUENCE(40000,1),
PERIOD_ID CONSTANT '5',
SPEND FILLER CHAR,
ACCOUNT FILLER CHAR,
TOT_AMT FILLER CHAR,
JAN_AMT FILLER CHAR,
JAN_CNT FILLER CHAR,
FEB_AMT FILLER CHAR,
FEB_CNT FILLER CHAR,
MAR_AMT FILLER CHAR,
MAR_CNT FILLER CHAR,
APR_AMT FILLER CHAR,
APR_CNT FILLER CHAR,
AMOUNT CHAR
INTO TABLE BUDGET_COST
append
WHEN AMOUNT != '0'
FIELDS TERMINATED BY ',' OPTIONALLY ENCLOSED BY '"'
TRAILING NULLCOLS
NETMAN_ITEM_NO FILLER POSITION(1) CHAR TERMINATED BY ',',
BUDGET_LINE_ID SEQUENCE(40000,1),
PERIOD_ID CONSTANT '6',
SPEND FILLER CHAR,
ACCOUNT FILLER CHAR,
TOT_AMT FILLER CHAR,
JAN_AMT FILLER CHAR,
JAN_CNT FILLER CHAR,
FEB_AMT FILLER CHAR,
FEB_CNT FILLER CHAR,
MAR_AMT FILLER CHAR,
MAR_CNT FILLER CHAR,
APR_AMT FILLER CHAR,
APR_CNT FILLER CHAR,
MAY_AMT FILLER CHAR,
MAY_CNT FILLER CHAR,
AMOUNT CHAR
INTO TABLE BUDGET_COST
append
WHEN AMOUNT != '0'
FIELDS TERMINATED BY ',' OPTIONALLY ENCLOSED BY '"'
TRAILING NULLCOLS
NETMAN_ITEM_NO FILLER POSITION(1) CHAR TERMINATED BY ',',
BUDGET_LINE_ID SEQUENCE(40000,1),
PERIOD_ID CONSTANT '7',
SPEND FILLER CHAR,
ACCOUNT FILLER CHAR,
TOT_AMT FILLER CHAR,
JAN_AMT FILLER CHAR,
JAN_CNT FILLER CHAR,
FEB_AMT FILLER CHAR,
FEB_CNT FILLER CHAR,
MAR_AMT FILLER CHAR,
MAR_CNT FILLER CHAR,
APR_AMT FILLER CHAR,
APR_CNT FILLER CHAR,
MAY_AMT FILLER CHAR,
MAY_CNT FILLER CHAR,
JUN_AMT FILLER CHAR,
JUN_CNT FILLER CHAR,
AMOUNT CHAR
INTO TABLE BUDGET_COST
append
WHEN AMOUNT != '0'
FIELDS TERMINATED BY ',' OPTIONALLY ENCLOSED BY '"'
TRAILING NULLCOLS
NETMAN_ITEM_NO FILLER POSITION(1) CHAR TERMINATED BY ',',
BUDGET_LINE_ID SEQUENCE(40000,1),
PERIOD_ID CONSTANT '8',
SPEND FILLER CHAR,
ACCOUNT FILLER CHAR,
TOT_AMT FILLER CHAR,
JAN_AMT FILLER CHAR,
JAN_CNT FILLER CHAR,
FEB_AMT FILLER CHAR,
FEB_CNT FILLER CHAR,
MAR_AMT FILLER CHAR,
MAR_CNT FILLER CHAR,
APR_AMT FILLER CHAR,
APR_CNT FILLER CHAR,
MAY_AMT FILLER CHAR,
MAY_CNT FILLER CHAR,
JUN_AMT FILLER CHAR,
JUN_CNT FILLER CHAR,
JUL_AMT FILLER CHAR,
JUL_CNT FILLER CHAR,
AMOUNT CHAR
INTO TABLE BUDGET_COST
append
WHEN AMOUNT != '0'
FIELDS TERMINATED BY ',' OPTIONALLY ENCLOSED BY '"'
TRAILING NULLCOLS
NETMAN_ITEM_NO FILLER POSITION(1) CHAR TERMINATED BY ',',
BUDGET_LINE_ID SEQUENCE(40000,1),
PERIOD_ID CONSTANT '9',
SPEND FILLER CHAR,
ACCOUNT FILLER CHAR,
TOT_AMT FILLER CHAR,
JAN_AMT FILLER CHAR,
JAN_CNT FILLER CHAR,
FEB_AMT FILLER CHAR,
FEB_CNT FILLER CHAR,
MAR_AMT FILLER CHAR,
MAR_CNT FILLER CHAR,
APR_AMT FILLER CHAR,
APR_CNT FILLER CHAR,
MAY_AMT FILLER CHAR,
MAY_CNT FILLER CHAR,
JUN_AMT FILLER CHAR,
JUN_CNT FILLER CHAR,
JUL_AMT FILLER CHAR,
JUL_CNT FILLER CHAR,
AUG_AMT FILLER CHAR,
AUG_CNT FILLER CHAR,
AMOUNT CHAR
INTO TABLE BUDGET_COST
append
WHEN AMOUNT != '0'
FIELDS TERMINATED BY ',' OPTIONALLY ENCLOSED BY '"'
TRAILING NULLCOLS
NETMAN_ITEM_NO FILLER POSITION(1) CHAR TERMINATED BY ',',
BUDGET_LINE_ID SEQUENCE(40000,1),
PERIOD_ID CONSTANT '10',
SPEND FILLER CHAR,
ACCOUNT FILLER CHAR,
TOT_AMT FILLER CHAR,
JAN_AMT FILLER CHAR,
JAN_CNT FILLER CHAR,
FEB_AMT FILLER CHAR,
FEB_CNT FILLER CHAR,
MAR_AMT FILLER CHAR,
MAR_CNT FILLER CHAR,
APR_AMT FILLER CHAR,
APR_CNT FILLER CHAR,
MAY_AMT FILLER CHAR,
MAY_CNT FILLER CHAR,
JUN_AMT FILLER CHAR,
JUN_CNT FILLER CHAR,
JUL_AMT FILLER CHAR,
JUL_CNT FILLER CHAR,
AUG_AMT FILLER CHAR,
AUG_CNT FILLER CHAR,
SEP_AMT FILLER CHAR,
SEP_CNT FILLER CHAR,
AMOUNT CHAR
INTO TABLE BUDGET_COST
append
WHEN AMOUNT != '0'
FIELDS TERMINATED BY ',' OPTIONALLY ENCLOSED BY '"'
TRAILING NULLCOLS
NETMAN_ITEM_NO FILLER POSITION(1) CHAR TERMINATED BY ',',
BUDGET_LINE_ID SEQUENCE(40000,1),
PERIOD_ID CONSTANT '11',
SPEND FILLER CHAR,
ACCOUNT FILLER CHAR,
TOT_AMT FILLER CHAR,
JAN_AMT FILLER CHAR,
JAN_CNT FILLER CHAR,
FEB_AMT FILLER CHAR,
FEB_CNT FILLER CHAR,
MAR_AMT FILLER CHAR,
MAR_CNT FILLER CHAR,
APR_AMT FILLER CHAR,
APR_CNT FILLER CHAR,
MAY_AMT FILLER CHAR,
MAY_CNT FILLER CHAR,
JUN_AMT FILLER CHAR,
JUN_CNT FILLER CHAR,
JUL_AMT FILLER CHAR,
JUL_CNT FILLER CHAR,
AUG_AMT FILLER CHAR,
AUG_CNT FILLER CHAR,
SEP_AMT FILLER CHAR,
SEP_CNT FILLER CHAR,
OCT_AMT FILLER CHAR,
OCT_CNT FILLER CHAR,
AMOUNT CHAR
INTO TABLE BUDGET_COST
append
WHEN AMOUNT != '0'
FIELDS TERMINATED BY ',' OPTIONALLY ENCLOSED BY '"'
TRAILING NULLCOLS
NETMAN_ITEM_NO FILLER POSITION(1) CHAR TERMINATED BY ',',
BUDGET_LINE_ID SEQUENCE(40000,1),
PERIOD_ID CONSTANT '12',
SPEND FILLER CHAR,
ACCOUNT FILLER CHAR,
TOT_AMT FILLER CHAR,
JAN_AMT FILLER CHAR,
JAN_CNT FILLER CHAR,
FEB_AMT FILLER CHAR,
FEB_CNT FILLER CHAR,
MAR_AMT FILLER CHAR,
MAR_CNT FILLER CHAR,
APR_AMT FILLER CHAR,
APR_CNT FILLER CHAR,
MAY_AMT FILLER CHAR,
MAY_CNT FILLER CHAR,
JUN_AMT FILLER CHAR,
JUN_CNT FILLER CHAR,
JUL_AMT FILLER CHAR,
JUL_CNT FILLER CHAR,
AUG_AMT FILLER CHAR,
AUG_CNT FILLER CHAR,
SEP_AMT FILLER CHAR,
SEP_CNT FILLER CHAR,
OCT_AMT FILLER CHAR,
OCT_CNT FILLER CHAR,
NOV_AMT FILLER CHAR,
NOV_CNT FILLER CHAR,
AMOUNT CHAR
*** PIECE OF DATA FILE ***
Item,Spender,Account,Total Amt,Jan Amt,Jan Count,Feb Amt,Feb Count,Mar Amt,Mar Count,Apr Amt,Apr Count,May Amt,May Count,Jun Amt,Jun Count,Jul Amt,Jul Count,Aug Amt,Aug Count,Sep Amt,Sep Count,Oct Amt,Oct Count,Nov Amt,Nov Count,Dec Amt,Dec Count,Status,Netman Gen,Netman Item,Netman Unit,Location,Last Update Date,Component Description,Vendor Description,Generation Process
10110993,10993,8301-01,90134,7480,0,7480,0,7480,0,7480,0,7480,0,7480,0,7480,0,7480,0,7480,0,7480,0,7667,0,7667,0,0,+,LEASE PYMT,207,WIMOS,5/22/2002,LEASE PAYMENTS,"VIKING HOLDING, INC.",ACTUAL BUDGET
10410993,10993,8301-04,15240,1270,0,1270,0,1270,0,1270,0,1270,0,1270,0,1270,0,1270,0,1270,0,1270,0,1270,0,1270,0,0,+,JANITORIAL,58,WIMOS,5/22/2002,JANITORIAL,BUILDING ONE SVC SOLUTION,ACTUAL BUDGET
10810993,10993,8301-08,2232,186,0,186,0,186,0,186,0,186,0,186,0,186,0,186,0,186,0,186,0,186,0,186,0,0,+,ELECTRIC,77,WIMOS,5/22/2002,"UTILITIES (GAS,ELEC.,ETC)",WISCONSIN PUBLIC SERVICE,AVGD 01 04 07 10 NOT WEIGHTED
10910993,10993,8301-09,4220,26,0,348,0,609,0,383,0,348,0,371,0,348,0,371,0,360,0,348,0,360,0,348,0,0,+,FIRE EQUIP,51,WIMOS,5/22/2002,RENT CONTRACT SERVICES,"CENTRALCOM, INC.",ACTUAL EXPERIENCE
11610993,10993,8301-16,1272,106,0,106,0,106,0,106,0,106,0,106,0,106,0,106,0,106,0,106,0,106,0,106,0,0,+,L/H MOSINE,1,WIMOS,5/22/2002,LEASEHOLD IMPROVEMENTS,ELLIS STONE,ACTUAL BUDGET
10110994,10994,8301-01,69960,5830,0,5830,0,5830,0,5830,0,5830,0,5830,0,5830,0,5830,0,5830,0,5830,0,5830,0,5830,0,0,+,LEASE PYMT,228,WISTEWEL,5/22/2002,LEASE PAYMENTS,BJ INVESTMENTS LLC,ACTUAL BUDGET
10410994,10994,8301-04,840,70,0,70,0,70,0,70,0,70,0,70,0,70,0,70,0,70,0,70,0,70,0,70,0,0,+,JANITORIAL,69,WISTEWEL,5/22/2002,JANITORIAL,MARSDEN,ACTUAL BUDGET
10710994,10994,8301-07,6067,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,6067,0,0,+,LEASE PYMT,228,WISTEWEL,5/22/2002,LEASE PAYMENTS,BJ INVESTMENTS LLC,ASSUME 5% INCREASE OVER ACTUAL 2000 EXPENSES
10810994,10994,8301-08,2460,205,0,205,0,205,0,205,0,205,0,205,0,205,0,205,0,205,0,205,0,205,0,205,0,0,+,ELECTRIC,84,WISTEWEL,5/22/2002,"UTILITIES (GAS,ELEC.,ETC)",BJ INVESTMENTS LLC,AVGD 03 06 09 NOT WEIGHTED
10910994,10994,8301-09,1050,70,0,70,0,105,0,105,0,70,0,105,0,35,0,140,0,35,0,70,0,210,0,35,0,0,+,SANITATION,12,WISTEWEL,5/22/2002,RENT CONTRACT SERVICES,WASTE MANAGEMENT OF WIS,ACTUAL EXPERIENCE
11910994,10994,8301-19,1099,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1099,0,0,0,0,0,0,0,0,0,0,+,INSURANCE,6,WISTEWEL,5/22/2002,INSURANCE,BJ INVESTMENTS LLC,ACTUAL EXPERIENCE
10110998,10998,8301-01,2440,2440,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,+,LEASE PYMT,47,ILELG,5/22/2002,LEASE PAYMENTS,ELGIN AIRPORT BUSINESS PK,ACTUAL BUDGET
10410998,10998,8301-04,146,146,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,+,LEASE PYMT,47,ILELG,5/22/2002,LEASE PAYMENTS,ELGIN AIRPORT BUSINESS PK,ACTUAL BUDGET
10610998,10998,8301-06,336,28,0,28,0,28,0,28,0,28,0,28,0,28,0,28,0,28,0,28,0,28,0,28,0,0,+,DRINK H2O,46,ILELG,5/22/2002,COOLER AND BOTTLED WATER,"HINCKLEY & SCHMITT, INC.",AVGD 01 02 03 04 05 06 07 08 09 10
10710998,10998,8301-07,276,276,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,+,LEASE PYMT,47,ILELG,5/22/2002,LEASE PAYMENTS,ELGIN AIRPORT BUSINESS PK,ASSUME 5% INCREASE OVER ACTUAL 2000 EXPENSES
10810998,10998,8301-08,3108,433,0,315,0,234,0,173,0,181,0,292,0,320,0,337,0,316,0,153,0,183,0,171,0,0,+,ELECTRIC,20,ILELG,5/22/2002,"UTILITIES (GAS,ELEC.,ETC)",COMMONWEALTH EDISON,AVGD 01 02 03 04 05 06 07 08 09 10 WEIGHTED
*** SCRIPT FOR TABLES LOADED ***
CREATE TABLE BUDGET_LINE (
BUDGET_LINE_ID NUMBER NOT NULL,
BUDGET_TYPE CHAR (1) NOT NULL,
GL_CODE_COMBO_ID NUMBER NOT NULL,
AMOUNT_TYPE CHAR (1) NOT NULL,
ACTIVE CHAR (1) DEFAULT 'T' NOT NULL,
SOURCE CHAR (1),
CUT CHAR (1),
DESCRIPTION VARCHAR2 (180),
CAP_ITEM_ID NUMBER,
PBT_ID NUMBER,
BILL_ID NUMBER,
CREATED_ON DATE DEFAULT SYSDATE NOT NULL,
CREATED_BY NUMBER NOT NULL,
UPDATED_ON DATE DEFAULT SYSDATE NOT NULL,
UPDATED_BY NUMBER NOT NULL,
CHECK (ACTIVE IN ('T','F') ) ,
CHECK (CUT IN ('C',NULL) ),
CONSTRAINT BUDGET_LINE_PRI
PRIMARY KEY ( BUDGET_LINE_ID ) ) ;
CREATE TABLE BUDGET_COST (
BUDGET_LINE_ID NUMBER NOT NULL,
PERIOD_ID NUMBER NOT NULL,
AMOUNT NUMBER (13,2),
CONSTRAINT BUDGET_COST_PRI
PRIMARY KEY ( BUDGET_LINE_ID, PERIOD_ID ) ) ;
CREATE TABLE GL_CODE_TEMP (
BUDGET_LINE_ID NUMBER NOT NULL,
SPENDER CHAR (5),
ACCT CHAR (7),
GL_CODE_COMBO_ID NUMBER,
CONSTRAINT GL_CODE_TEMP_BDGT_ID
PRIMARY KEY ( BUDGET_LINE_ID ) ) ;Thanks for the reply .. user do have their user credentials but only for the application ... but all users use a common loader and control file once they log into the application. So irrespective of which user is logged in he selects the same control file and loads to the same table mentioned in the control file .. i instead want user to be able to load to the table in control file but into his schema like username.tablename instead of just the tablename mentioned in .ctl file.
-
SQL Loader and Insert Into Performance Difference
Hello All,
Im in a situation to measure performance difference between SQL Loader and Insert into. Say there 10000 records in a flat file and I want to load it into a staging table.
I know that if I use PL/SQL UTL_FILE to do this job performance will degrade(dont ask me why im going for UTL_FILE instead of SQL Loader). But I dont know how much. Can anybody tell me the performance difference in % (like 20% will decrease) in case of 10000 records.
Thanks,
Kannan.Kannan B wrote:
Do not confuse the topic, as I told im not going to use External tables. This post is to speak the performance difference between SQL Loader and Simple Insert Statement.I don't think people are confusing the topic.
External tables are a superior means of reading a file as it doesn't require any command line calls or external control files to be set up. All that is needed is a single external table definition created in a similar way to creating any other table (just with the additional external table information obviously). It also eliminates the need to have a 'staging' table on the database to load the data into as the data can just be queried as needed directly from the file, and if the file changes, so does the data seen through the external table automatically without the need to re-run any SQL*Loader process again.
Who told you not to use External Tables? Do they know what they are talking about? Can they give a valid reason why external tables are not to be used?
IMO, if you're considering SQL*Loader, you should be considering External tables as a better alternative.
Maybe you are looking for
-
How can I remove an email address from one apple account and associate it with another?
I created an appleID account to use with the mac AppStore without realising i previously had an appleID account from my first iPod touch. Now with OSX 10.8 I want to use the email address from the old account with the new account for Messages.app wit
-
TS3623 AppleTV 2nd gen intermittent audio content out.
My second generation AppleTV plays all content great to my Toshiba LED TV, but content out to the soundbar is intermittent. iTune movie "Let Me In" doesn't but "The Replacements" works perfect and so on. Same thing with Netflicks. But my Blueray p
-
ICLOUD AND MOBILE.ME MAILBOXES
I'm running 10.6.8 so I'm not icloud native. I had mobile.me and had 3 mailboxes set up. When i migrated to icloud it only kept my primary and I lost the other two and cannot for the life of me i can't figure out how to get them back. Any ideas?
-
Stop sending messages with different fonts!
Hello, I need some help. I started using Apple Mail recently and I like it alright. My main issue is that when I cut and paste from my browser or from anywhere else really, the program is preserving the font though I can't see that it is. When I get
-
Just bought a Surface Pro 3 and installed my copy of CS5 on it. The letters and numbers on the menus and toolbars are so small as to be unreadable. I tried going to Options but no good. I changed the display resolution but no better. How can I ma