SQL Loader and control files with WHEN clauses
Hi All :)
Want to load data into 3 tables that are defined like so:
SQL> desc PARENT
Name NULL? Type
PKey.........NOT NULL....Number
Blah_One.................VARHCAR2(50)
Blah_Two.................VARHCAR2(50)
SQL> desc CHILD_ONE
Name NULL? Type
PKey.........NOT NULL....Number
FKey.....................Number -- this is used as a Foriegn key to PARNET
Bleep_One................VARHCAR2(50)
SQL> desc CHILD_TWO
Name NULL? Type
PKey.........NOT NULL....Number
FKey.....................Number -- this is used as a Foriegn key to PARNET
Bleep_Two................VARHCAR2(50)
I have a flat file that looks like this
PARENT|BLAHBLAH|Blahba|
ONE|BLEEP-IT|
ONE|BLEEP-BLOP|
TWO|TWOBLEEP|
TWO|OR NOT TO|
TWO|BLEEP
PARENT|AbbaDabaDooo|whaaaaa|
TWO|waka=waka|
.... so I worte a control file that looks like this ....
LOAD DATA
APPEND
INTO PARENT
WHEN (tableName='PARENT')
FIELDS TERMINATED BY '|' TRAILING NULLCOLS
tableName FILLER,
BLAH_ONE,
BLAH_TWO,
PKey "PARENT_SEQ.nextval"
INTO CHILD_ONE
WHEN (tableName='ONE')
FIELDS TERMINATED BY '|' TRAILING NULLCOLS
tableName FILLER,
BLEEP_ONE,
PKey "CHILD_ONE_SEQ.nextval",
FKey "PARENT_SEQ.currval"
INTO CHILD_TWO
WHEN (tableName='TWO')
FIELDS TERMINATED BY '|' TRAILING NULLCOLS
tableName FILLER,
BLEEP_TWO,
PKey "CHILD_TWO_SEQ.nextval",
FKey "PARENT_SEQ.currval"
where PARENT_SEQ, CHILD_ONE, and CHILD_TWO
are SEQUENCES.
The probelm I am having is that the Fkeys and PKeys
don't match up????
Am I mis-using SEQUENCES?
Should I be using a trigger?
I am very confused!
Thanks
http://asktom.oracle.com/pls/asktom/f?p=100:11:0::::P11_QUESTION_ID:6020061915147
answers this question perfectly
Similar Messages
-
SQL Loader and control file changes for different users
In the front end of my application I can select a data file and a control file, and load data to the table mentioned in .ctl file. Every user who logs in uses the same .ctl file and so loads onto the same table. Now I want the user to load data onto the table in his own schema. I can get the username of the user currently logged in and i want to insert it into that username.table. So can i copy the contents of the .ctl file into a variable, modify it into username.table in that string and pass that variable as a parameter to the sqlldr command instead of the .ctl file.
Or is there a better way how I can modify the same control file everytime to change tablename to username.tablename in .ctl file and pass to sqlldr to load data to table in local user schema table.
Thanks and RegardsThanks 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.
-
Problem import csv file with SQL*loader and control file
I have a *csv file looking like this:
E0100070;EKKJ 1X10/10 1 KV;1;2003-06-16;01C;75
E0100075;EKKJ 1X10/10 1 KV;500;2003-06-16;01C;67
E0100440;EKKJ 2X2,5/2,5 1 KV;1;2003-06-16;01C;37,2
E0100445;EKKJ 2X2,5/2,5 1 KV;500;2003-06-16;01C;33,2
E0100450;EKKJ 2X4/4 1 KV;1;2003-06-16;01C;53
E0100455;EKKJ 2X4/4 1 KV;500;2003-06-16;01C;47,1
I want to import this csv file to this table:
create table artikel (artnr varchar2(10), namn varchar2(25), fp_storlek number, datum date, mtrlid varchar2(5), pris number);
My controlfile looks like this:
LOAD DATA
INFILE 'e:\test.csv'
INSERT
INTO TABLE ARTIKEL
FIELDS TERMINATED BY ';'
TRAILING NULLCOLS
(ARTNR, NAMN, FP_STORLEK char "to_number(:fp_storlek,'99999')", DATUM date 'yyyy-mm-dd', MTRLID, pris char "to_number(:pris,'999999D99')")
I cant get sql*loader to import the last column(pris) as I want. It ignore my decimal point which in this case is "," and not "." maybe this is the problem. If the decimal point is the problem how can I get oracle to recognize "," as a decimal point??
the result from the import now, is that a decimal number (37,2) becomes 372 in the tableSet NLS_NUMERIC_CHARACTERS environment variable at OS level, before running SqlLoader :
$ cat test.csv
E0100070;EKKJ 1X10/10 1 KV;1;2003-06-16;01C;75
E0100075;EKKJ 1X10/10 1 KV;500;2003-06-16;01C;67
E0100440;EKKJ 2X2,5/2,5 1 KV;1;2003-06-16;01C;37,2
E0100445;EKKJ 2X2,5/2,5 1 KV;500;2003-06-16;01C;33,2
E0100450;EKKJ 2X4/4 1 KV;1;2003-06-16;01C;53
E0100455;EKKJ 2X4/4 1 KV;500;2003-06-16;01C;47,1
$ cat artikel.ctl
LOAD DATA
INFILE 'test.csv'
replace
INTO TABLE ARTIKEL
FIELDS TERMINATED BY ';'
TRAILING NULLCOLS
(ARTNR, NAMN, FP_STORLEK char "to_number(:fp_storlek,'99999')", DATUM date 'yyyy-mm-dd', MTRLID, pris char "to_number(:pris,'999999D99')")
$ sqlldr scott/tiger control=artikel
SQL*Loader: Release 10.1.0.3.0 - Production on Sat Nov 12 15:10:01 2005
Copyright (c) 1982, 2004, Oracle. All rights reserved.
Commit point reached - logical record count 6
$ sqlplus scott/tiger
SQL*Plus: Release 10.1.0.3.0 - Production on Sat Nov 12 15:10:11 2005
Copyright (c) 1982, 2004, Oracle. All rights reserved.
Connected to:
Oracle Database 10g Enterprise Edition Release 10.1.0.3.0 - Production
With the Partitioning, OLAP and Data Mining options
SQL> select * from artikel;
ARTNR NAMN FP_STORLEK DATUM MTRLI PRIS
E0100070 EKKJ 1X10/10 1 KV 1 16/06/2003 01C 75
E0100075 EKKJ 1X10/10 1 KV 500 16/06/2003 01C 67
E0100440 EKKJ 2X2,5/2,5 1 KV 1 16/06/2003 01C 372
E0100445 EKKJ 2X2,5/2,5 1 KV 500 16/06/2003 01C 332
E0100450 EKKJ 2X4/4 1 KV 1 16/06/2003 01C 53
E0100455 EKKJ 2X4/4 1 KV 500 16/06/2003 01C 471
6 rows selected.
SQL> exit
Disconnected from Oracle Database 10g Enterprise Edition Release 10.1.0.3.0 - Production
With the Partitioning, OLAP and Data Mining options
$ export NLS_NUMERIC_CHARACTERS=',.'
$ sqlldr scott/tiger control=artikel
SQL*Loader: Release 10.1.0.3.0 - Production on Sat Nov 12 15:10:41 2005
Copyright (c) 1982, 2004, Oracle. All rights reserved.
Commit point reached - logical record count 6
$ sqlplus scott/tiger
SQL*Plus: Release 10.1.0.3.0 - Production on Sat Nov 12 15:10:45 2005
Copyright (c) 1982, 2004, Oracle. All rights reserved.
Connected to:
Oracle Database 10g Enterprise Edition Release 10.1.0.3.0 - Production
With the Partitioning, OLAP and Data Mining options
SQL> select * from artikel;
ARTNR NAMN FP_STORLEK DATUM MTRLI PRIS
E0100070 EKKJ 1X10/10 1 KV 1 16/06/2003 01C 75
E0100075 EKKJ 1X10/10 1 KV 500 16/06/2003 01C 67
E0100440 EKKJ 2X2,5/2,5 1 KV 1 16/06/2003 01C 37,2
E0100445 EKKJ 2X2,5/2,5 1 KV 500 16/06/2003 01C 33,2
E0100450 EKKJ 2X4/4 1 KV 1 16/06/2003 01C 53
E0100455 EKKJ 2X4/4 1 KV 500 16/06/2003 01C 47,1
6 rows selected.
SQL> Control file is exactly as yours, I just put replace instead of insert. -
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 -
I know I've done this before but, I don't use SQL Loader often and I'm having issues getting a file to load.
The table has 6 columns in it - one of which is a timestamp.
I was having issues loading it initially with date format issues. I ruled out any issues with the timestamp format by simply loading a dummy table with some timestamp based data and had no issue.
So - I think the issue is around the fact that the table I'm loading's first column being a value I'm attempting to default with a sequence when loading and - that I'm screwing up something there.
Table is as such:
CREATE TABLE ACS_IPS
(seq_ips NUMBER,
col2 VARCHAR2(100),
col3 VARCHAR2(100),
col4 VARCHAR2(100),
col5 TIMESTAMP,
col6 VARCHAR2(100),
col7 VARCHAR2(100),
col8 DATE DEFAULT SYSDATE NOT NULL,
col9 VARCHAR2(30) DEFAULT USER);The control file is:
load data
truncate
into table acs_ips
fields terminated by ","
trailing nullcols
seq_ips "seq_ips.nextval",
col2,
col3,
col4,
col5 TIMESTAMP "YYYY-MM-DD HH24:MI:SS.FF9",
col6,
col7
)The sequence column isn't in the file being loaded... and - there are additional columns that are defaulted on the table that aren't in the control file.
Any help is appreciated... The error I'm getting is:
Rejected - Error on table CAMS.ACS_IPS, column ACTION_START.
ORA-01841: (full) year must be between -4713 and +9999, and not be 0Yeah - not sure that clears it up...
The sequence in my table is the first column - and - I think that's the problem... the sequence is being loaded as the first column in the control file but - it's not in the file being loaded so - it's skewing (again - I think??) the data being read in - which is why I'm getting the timestamp issues on the one column (it's actually reading the next column in the file vs. the actual timestamp one).
If that's the issue - I'm not sure how to avoid it without restructuring the table to stick the sequence physically at the end. I'm certain that's not necessary and - I'm overlooking something that's otherwise simple but evading me. -
SQL Loader - CSV Data file with carraige returns and line fields
Hi,
I have a CSV data file with occasional carraige returns and line feeds in between, which throws my SQL loader script off. Sql loader, takes the characters following the carraige return as a new record and gives me error. Is there a way I could handle carraige returns and linefeeds in SQL Loader.
Please help. Thank you for your time.
This is my Sql Loader script.
load data
infile 'D:\Documents and Settings\user1\My Documents\infile.csv' "str '\r\n'"
append
into table MYSCHEMA.TABLE1
fields terminated by ','
OPTIONALLY ENCLOSED BY '"'
trailing nullcols
( NAME CHAR(4000),
field2 FILLER,
field3 FILLER,
TEST DEPT CHAR(4000)
)You can "regexp_replace" the columns for special characters
-
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 LPAD CONTROL FILE QUESTION
Hi, inthe flat file
company_cd is "1" or "01"
and center_cd is 3 digits... ex: "493"
in the table the userid coulmn should be 6 digits
currently i am getting this as userid in the table
"010493" is right, because company_cd is "01"
"10493" is not right, because company_cd is "1"
if company_cd is 2 digits(01) i am getting 6 digits userid which is OK
but when company_cd is singile digit(1) i am getting 5 digits userid
I NEED TO LPAD with 0 in the front when company_cd is "1"any suggetions ???????
***********This is the code i am using currently in the CTL file for userid**********
,USERID "CONCAT(substr(trim(:company_cd),1,2),lpad(trim(:center_cd),4,0))"
.......Thank You..........
Edited by: phani_Marella on Aug 28, 2012 11:12 AMNow where does company 'coz' come from all of a sudden?
I'm sure you read {message:id=9360002} , hence my confusion.
Anyway, the SQL*Loader forum is @ Export/Import/SQL Loader & External Tables -
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.
-
How to create parameter and control file like filename + date
Hello there
I am trying to create parameter and control file with following command
in SQLPLUS
create pfile='/u03/oradata/WEBDB/backup/initWEBDB.ora' from spfile;
In RMAN
copy current controlfile to '/u03/oradata/WEBDB/backup/cf_longterm.cpy';
how can I put date at the end of filename like
initWEBDB8jan06.ora and cf_longterm8jan06.cpy
Thanks in advance
LionelASM is reliable but a smart DBA is very careful. If ASM is doing mirroring this is like RAID doing mirroring. What happens if you accidentally delete one copy ... the other one disappears instantly. Not a good idea.
With respect to redo logs you need a minimum of three groups, two members, and one thread per instance. So a 2 node cluster should, at a minimum have 12 physical files.
Not mirroring the redo logs, assuming multiple members, is not as critical. -
Load data with SQL Loader link field between CSV file and Control File
Hi all,
in a SQL Loader control file, how do you specify link with field in CSV file and Control file?
E.g. if I wat to import the record in table TEST (col1, col2, col3) with data in csv file BUT in different position. How to do this?
FILE CSV (with variable position):
test1;prova;pippo;Ferrari;
xx;yy;hello;by;
In the table TEST i want that col1 = 'prova' (xx),
col2 = 'Ferrari' (yy)
col3 = default N
the others data in CSV file are ignored.
so:
load data
infile 'TEST.CSV'
into table TEST
fields terminated by ';'
col1 ?????,
col2 ?????,
col3 CONSTANT "N"
Thanks,
AttilioWith '?' mark i mean " How i can link this COL1 with column in csv file ? "
Attilio -
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 ?? -
Import and process larger data with SQL*Loader and Java resource
Hello,
I have a project to import data from a text file in a schedule. A lager data, with nearly 20,000 record/1 hours.
After that, we have to analysis the data, and export the results into a another database.
I research about SQL*Loader and Java resource to do these task. But I have no experiment about that.
I'm afraid of the huge data, Oracle could be slowdown or the session in Java Resource application could be timeout.
Please tell me some advice about the solution.
Thank you very much.With '?' mark i mean " How i can link this COL1 with column in csv file ? "
Attilio -
What does it means when you turn on the macbook and a file with a "?" mark flashes?
What does it means when you turn on the macbook and a file with a "?" mark flashes?
It usually means some system files are missing or corrupted. Reinstalling OS X is the fix:
Reinstall OS X without erasing the drive
Do the following:
1. Repair the Hard Drive and Permissions
Boot from your Snow Leopard Installer disc. After the installer loads select your language and click on the Continue button. When the menu bar appears select Disk Utility from the Utilities menu. After DU loads select your hard drive entry (mfgr.'s ID and drive size) from the the left side list. In the DU status area you will see an entry for the S.M.A.R.T. status of the hard drive. If it does not say "Verified" then the hard drive is failing or failed. (SMART status is not reported on external Firewire or USB drives.) If the drive is "Verified" then select your OS X volume from the list on the left (sub-entry below the drive entry,) click on the First Aid tab, then click on the Repair Disk button. If DU reports any errors that have been fixed, then re-run Repair Disk until no errors are reported. If no errors are reported click on the Repair Permissions button. Wait until the operation completes, then quit DU and return to the installer.
If DU reports errors it cannot fix, then you will need Disk Warrior and/or Tech Tool Pro to repair the drive. If you don't have either of them or if neither of them can fix the drive, then you will need to reformat the drive and reinstall OS X.
2. Reinstall Snow Leopard
If the drive is OK then quit DU and return to the installer. Proceed with reinstalling OS X. Note that the Snow Leopard installer will not erase your drive or disturb your files. After installing a fresh copy of OS X the installer will move your Home folder, third-party applications, support items, and network preferences into the newly installed system.
Download and install the Combo Updater for the version you prefer from support.apple.com/downloads/. -
Do we need to format data and log files with 64k cluster size for sql server 2012?
Do we need to format data and log files with 64k cluster size for sql server 2012?
Does this best practice still applies to sql server 2012 & 2014?Yes. The extent size of SQL Server data files, and the max log block size have not changed with the new versions, so the guidance should remain the same.
Microsoft SQL Server Storage Engine PM
Maybe you are looking for
-
Problem with reading Dynpro fields
Hi, I have some tabstrips. On each tabstrip, I have a container for an ALV and on the bottom I have another subscreen for some input fields. Under the subscreen I have some buttons to insert, delete etc... The fields in my subscreen I have bound to D
-
Start Workflow AFTER File Is Uploaded
I want workflow to start AFTER i copy file through webdav (drag n drop). Now it starts workflow BEFORE file is uploaded. Workflow uses data from the file so the order is crucial. Is it possible?
-
N93 PCSuite Connt. Problem
N93 Device. PC XP SP2. Whenever Im tryin to connect my device with PCS6. its not being possible, I hav done all reviewing help tasks both PCS6 & N93 phone, still the same, Connection to PC Suite failed, please reinstall (Code: InitIMediaControl2). I
-
Can only hear sound out of one ear in iPod 30gb
My nephew can only hear sound from one ear of his headphones. 1) he's not becoming deaf and we've tried multiple pairs of headphones that give the SAME result. 2) the volume settings are correct, so its not that. What are the options here? Is there a
-
Scrolling credits - look great on iMovie, but can't see in iDVD
I made an iMovie for a group I traveled with this summer, and everything is working great except for the rolling credits I created at the end. Instead of the black background with white credits, all I see is white. I can't see other posts with this s