SQL*Loader issue with WHEN command
Environment: R12.1.2
We have a file coming in from a bank that needs to be loaded into a custom table using SQL*Loader.
The file has multiple record formats. Each record in the file starts with a "record type", which defines the format.
For simplicity, let me say that there is a record type of "H" with the header format, and another record type "D" has a detail record format. An "H" record may be followed by multiple "D" records until the next "H" record is encountered. Unfortunately, there is no common key, like say "Vendor Number" in both the "H" and "D" records to establish a relationship. So the plan was to use a Oracle sequence or SQL*Loader sequence to get a sequence loaded into the table as the file is being loaded. Then if consecutive "H" records had a sequence value of 100 and 112, we would know that the "D" records for the "H" 100 record are all the records with sequence value of 101 through 111.
The issue occurs as we have to use the WHEN command in the control file to direct a certain record type to specific columns of the table. Based on the populated sequence values, with the WHEN command, it seems that all the "H" records get loaded first followed by the "D" records. The sequence becomes of no use and we cannot establish a link between the "H" and "D" records. The alternative is to not use WHEN with the sequence, but load the file into generic column names which provides for less understanding in the application.
Is there a way (command feature) to ensure that SQL*Loader loads the records sequentially while using WHEN?
Thanks
Satish
I used RECNUM parameter instead of sequence and it worked fine
Similar Messages
-
SQL Loader : Issue with WHEN
I'm using Oracle 11g, Win XP.
I'm trying to load data with below control file:
OPTIONS (SKIP=0, DIRECT=FALSE, PARALLEL=FALSE, BINDSIZE=50000, errors=999999,ROWS=200, READSIZE=65536)
LOAD DATA
APPEND
INTO TABLE v_table
when COL_3 = 'XXXX'
fields terminated by "|" optionally enclosed by '"'
trailing nullcols
COL_1 "trim(:COL_1)",
COL_2 "trim(:COL_2)",
COL_3 "trim(:COL_3)",
COL_4 "trim(:COL_4)",
COL_5 "trim(:COL_5)",
COL_6 "trim(:COL_6)",
COL_7 "trim(:COL_7)",
INTO TABLE v_table
APPEND
when COL_3 = 'YYY'
fields terminated by "|" optionally enclosed by '"'
trailing nullcols
COL_1 "trim(:COL_1)",
COL_2 "trim(:COL_2)",
COL_3 "trim(:COL_3)",
COL_4 "trim(:COL_4)",
COL_5 "trim(:COL_5)",
COL_6 "trim(:COL_6)",
COL_7 "trim(:COL_7)",
)Below is the sample data in the data file:
33432|"ORACLE"|"XXXX"|"555827 "|"317564"|" "|""|"ORACLE "|2011-07-20-15.37.11.879915|0001-01-01-01.01.01.000001
33433|"ORACLE"|"XXXX"|"555828 "|"317564"|" "|""|"ORACLE "|2011-07-24-15.37.11.879915|0001-01-01-01.01.01.000001
33434|"ORACLE"|"XXXX"|"555829 "|"317564"|" "|""|"ORACLE "|2011-07-10-15.37.11.879915|0001-01-01-01.01.01.000001
33435|"ORACLE"|"XXXX"|"555830 "|"317564"|" "|""|"ORACLE "|2011-07-22-15.37.11.879915|0001-01-01-01.01.01.000001
33436|"ORACLE"|"XXXX"|"555831 "|"317564"|" "|""|"ORACLE "|2011-07-20-15.37.11.879915|0001-01-01-01.01.01.000001
33437|"ORACLE"|"XXXX"|"555832 "|"317564"|" "|""|"ORACLE "|2011-07-20-15.37.11.879915|0001-01-01-01.01.01.000001
40048|"SAS"|"ZZZ "|"1017838 "|"317551"|" "|""|"COD "|2011-09-08-08.44.29.684915|0001-01-01-01.01.01.000001
40049|"SAS"|"ZZZ "|"1017839 "|"317551"|" "|""|"COD "|2011-09-08-08.44.29.684915|0001-01-01-01.01.01.000001
40050|"SAS"|"ZZZ "|"1017840 "|"317551"|" "|""|"COD "|2011-09-08-08.44.29.684915|0001-01-01-01.01.01.000001
20046|"SUNUSA"|"YYY "|"1017836 "|"317551"|" "|""|"JAVA "|2011-09-08-08.44.29.684915|0001-01-01-01.01.01.000001
20047|"SUNUSA"|"YYY "|"1017837 "|"317551"|" "|""|"JAVA "|2011-09-08-08.44.29.684915|0001-01-01-01.01.01.000001
20048|"SUNUSA"|"YYY "|"1017838 "|"317551"|" "|""|"JAVA "|2011-09-08-08.44.29.684915|0001-01-01-01.01.01.000001
20049|"SUNUSA"|"YYY "|"1017839 "|"317551"|" "|""|"JAVA "|2011-09-08-08.44.29.684915|0001-01-01-01.01.01.000001
20050|"SUNUSA"|"YYY "|"1017840 "|"317551"|" "|""|"JAVA "|2011-09-08-08.44.29.684915|0001-01-01-01.01.01.000001Issue is:
When I'm loading data in the table with the above control card, only data with when COL_3 = 'XXXX' is getting loaded. And if I comment the block which has COL_3 = 'XXXX', then the second block is getting loaded (when COL_3 = 'YYY'). But I'm unable to load data for XXXX and YYY in single load. Can someone please help me on this?Thanks Warren. Found the solution.
when COL_3 = 'XXXX'
fields terminated by "|" optionally enclosed by '"'
trailing nullcols
COL_1 *POSITION(1)* "trim(:COL_1)",
COL_2 "trim(:COL_2)",
COL_3 "trim(:COL_3)",
COL_4 "trim(:COL_4)",
COL_5 "trim(:COL_5)",
COL_6 "trim(:COL_6)",
COL_7 "trim(:COL_7)",
INTO TABLE v_table
APPEND
when COL_3 = 'YYY'
fields terminated by "|" optionally enclosed by '"'
trailing nullcols
COL_1 POSITION(1) "trim(:COL_1)",
COL_2 "trim(:COL_2)", -
How to load XML file to table (non-XML) with SQL*Loader -- issue with nulls
I have been attempting to use SQL*Loader to load an XML file into a "regular" Oracle table. All fields work fine, unless a null is encountered. The way that nulls are represented is shown below:
<PAYLOAD>
<FIELD1>ABCDEF</FIELD1>
<FIELD2/>
<FIELD3>123456</FIELD3>
</PAYLOAD>
In the above example, FIELD2 is a null field and that is the way it is presented. I have searched everywhere and have not found how I could code for this. The issue is that if FIELD2 is present, it is coded like: <FIELD2>SOMEDATA</FIELD2>, but the null is represented as <FIELD2/>. Here is a sample of the control file I am using to attempt the load -- very simplistic, but works fine when fields are present:
load data
infile 'testdata.xml' "str '<PAYLOAD>'"
TRUNCATE
into table DATA_FROM_XML
FIELD1 ENCLOSED BY '<FIELD1>' AND '</FIELD1>',
FIELD2 ENCLOSED BY '<FIELD2>' AND '</FIELD2>',
FIELD3 ENCLOSED BY '<FIELD3>' AND '</FIELD3>')
What do I need to do to account for the way that nulls are presented? I have tried everything I could glean from the web and the documentation and nothing has worked. Any help would be really appreciated.I hadn't even got that far. can you direct me to where the docs are to import data that is stored within xml but that you don't need any xml functionality, that just happens to be the format the data is stored in? thx
-
SQL*Loader issue with NULLIF
Hi all,
I am trying to use following control file,
LOAD DATA
INFILE *
REPLACE
INTO TABLE T1
FIELDS TERMINATED BY '|'
TRAILING NULLCOLS
OBJECT_NAME CHAR NULLIF OBJECT_NAME = "NULL" ,
SUBOBJECT_NAME CHAR NULLIF SUBOBJECT_NAME = "NULL" ,
OBJECT_ID DECIMAL EXTERNAL NULLIF OBJECT_ID = "NULL" ,
DATA_OBJECT_ID DECIMAL EXTERNAL NULLIF DATA_OBJECT_ID = "NULL" ,
OBJECT_TYPE CHAR NULLIF OBJECT_TYPE = "NULL" ,
CREATED DATE "DD/MM/YYYY HH24:MI:SS" NULLIF CREATED = "NULL" ,
LAST_DDL_TIME DATE "DD/MM/YYYY HH24:MI:SS" NULLIF LAST_DDL_TIME = "NULL" ,
TIMESTAMP CHAR NULLIF TIMESTAMP = "NULL" ,
STATUS CHAR NULLIF STATUS = "NULL" ,
TEMPORARY CHAR NULLIF TEMPORARY = "NULL" ,
GENERATED CHAR NULLIF GENERATED = "NULL" ,
SECONDARY CHAR NULLIF SECONDARY = "NULL"
)I am getting error,
SQL*Loader-350: Syntax error at line 21.
Expecting positive integer or column name, found keyword timestamp.
CHAR NULLIF TIMESTAMP = "NULL" ,
STATUSThe file I am trying to load is a pipe delimited file and has a string "NULL" for NULL values. So, I have added NULLIF for all columns.
Interesting thing is, Oracle allows us to have column names like TIMESTAMP or GENERATED, but I use it in the NULLIF clause, it is effectively syntax error.
The table I am using is like this (it is same as user_objects view),
SQL> desc t1
Name Null? Type
OBJECT_NAME VARCHAR2(128)
SUBOBJECT_NAME VARCHAR2(30)
OBJECT_ID NUMBER
DATA_OBJECT_ID NUMBER
OBJECT_TYPE VARCHAR2(19)
CREATED DATE
LAST_DDL_TIME DATE
TIMESTAMP VARCHAR2(19)
STATUS VARCHAR2(7)
TEMPORARY VARCHAR2(1)
GENERATED VARCHAR2(1)
SECONDARY VARCHAR2(1)If I remove the NULLIF clause for columns, timestamp and generated, there is no problem, the control file works fine.
How can I get around this problem ?
Thanks in advanceTIMESTAMP is a keyword for the loader and confuses it.
rename your column -
SQL Loader issue - With junk charters in Last field
Hi
I have a data file to load .
I used a CTL and The Load is running fine.
But the last record comes with some kind of junk character when loaded into the table.
I checked if the file is in moved in binary mode or trying TRIM commands or replacing it int he code.
I tried replacing ^M and chr(10) but of no use.
can you please asssit men in this.. We have a go live soonPl post your exact OS and database versions, along with your complete sqlldr command, the table description and a sample of your input csv file.
See if the CONTINUEIF clause can help
http://download.oracle.com/docs/cd/E11882_01/server.112/e16536/ldr_control_file.htm#i1005509
HTH
Srini -
How to export data with column headers in sql server 2008 with bcp command?
Hi all,
I want know "how to export data with column headers in sql server 2008 with bcp command", I know how to import data with import and export wizard. when i
am trying to import data with bcp command data has been copied but column names are not came.
I am using the below query:-
EXEC master..xp_cmdshell
'BCP "SELECT * FROM [tempdb].[dbo].[VBAS_ErrorLog] " QUERYOUT "D:\Temp\SQLServer.log" -c -t , -T -S SERVER-A'
Thanks,
SAAD.Hi All,
I have done as per your suggestion but here i have face the below problem, in print statment it give correct query, in EXEC ( EXEC master..xp_cmdshell @BCPCMD) it was displayed error message like below
DECLARE @BCPCMD
nvarchar(4000)
DECLARE @BCPCMD1
nvarchar(4000)
DECLARE @BCPCMD2
nvarchar(4000)
DECLARE @SQLEXPRESS
varchar(50)
DECLARE @filepath
nvarchar(150),@SQLServer
varchar(50)
SET @filepath
= N'"D:\Temp\LDH_SQLErrorlog_'+CAST(YEAR(GETDATE())
as varchar(4))
+RIGHT('00'+CAST(MONTH(GETDATE())
as varchar(2)),2)
+RIGHT('00'+CAST(DAY(GETDATE())
as varchar(2)),2)+'.log" '
Set @SQLServer
=(SELECT
@@SERVERNAME)
SELECT @BCPCMD1
= '''BCP "SELECT
* FROM [tempdb].[dbo].[wErrorLog] " QUERYOUT '
SELECT @BCPCMD2
= '-c -t , -T -S '
+ @SQLServer +
SET @BCPCMD
= @BCPCMD1+ @filepath
+ @BCPCMD2
Print @BCPCMD
-- Print out below
'BCP "SELECT
* FROM [tempdb].[dbo].[wErrorLog] " QUERYOUT "D:\Temp\LDH_SQLErrorlog_20130313.log" -c -t , -T -S servername'
EXEC
master..xp_cmdshell
@BCPCMD
''BCP' is not recognized as an internal or external command,
operable program or batch file.
NULL
if i copy the print ourt put like below and excecute the CMD it was working fine, could you please suggest me what is the problem in above query.
EXEC
master..xp_cmdshell
'BCP "SELECT * FROM
[tempdb].[dbo].[wErrorLog] " QUERYOUT "D:\Temp\LDH_SQLErrorlog_20130313.log" -c -t , -T -S servername '
Thanks, SAAD. -
SQL Loader ISSUE- when invoking function in a package - in Direct Path- SPK
This is the loader file a.ctl
load data
append
into table emp
when eno='4'
(eno number,
ename varchar2(20))
when (1)<>'4'
into table detpt
(deptno number,
deplogid "Log.get_logid('logid')"
Note: the deptlogid field is not null column.
The par fie is as follows
rows=1000
errors=0
direct=true
control=a.ctl
when i am running this file i am getting error when i am invoking the package Log.get_logid('logid')" in direct mode. It returns null value when it is used in control file.
1) if i am running this function in sql prompt like
select Log.get_logid('logid') from dual
i am getting result as 121.
2) what is the problem when the same function is used in Sql loader in direct mode.
3) is there any restriction to use the function in sql loader?
4) whether to use the function in sql loader is applicable for direct mode or conventional mode.
5) when i am running in conventional mode it is working fine . what is the reason??
I am running the loader from dos prompt like
c:> sqlldr scott/tiger@dev parfile=abc.par
Oracle 9i is the version for the loader.
Please help me out to solve the issueThis is the loader file a.ctl
load data
append
into table emp
when eno='4'
(eno number,
ename varchar2(20))
when (1)<>'4'
into table detpt
(deptno number,
deplogid "Log.get_logid('logid')"
Note: the deptlogid field is not null column.
The par fie is as follows
rows=1000
errors=0
direct=true
control=a.ctl
when i am running this file i am getting error when i am invoking the package Log.get_logid('logid')" in direct mode. It returns null value when it is used in control file.
1) if i am running this function in sql prompt like
select Log.get_logid('logid') from dual
i am getting result as 121.
2) what is the problem when the same function is used in Sql loader in direct mode.
3) is there any restriction to use the function in sql loader?
4) whether to use the function in sql loader is applicable for direct mode or conventional mode.
5) when i am running in conventional mode it is working fine . what is the reason??
I am running the loader from dos prompt like
c:> sqlldr scott/tiger@dev parfile=abc.par
Oracle 9i is the version for the loader.
Please help me out to solve the issue -
Sql loader - Data loading issue with no fixed record length
Hi All,
I am trying to load the following data through sql loader. However the records # 1, 3 & 4 are only loading succesfully into the table and rest of the records showing as BAD. What is missing in my syntax?
.ctl file:
LOAD DATA
INFILE 'C:\data.txt'
BADFILE 'c:\data.BAD'
DISCARDFILE 'c:\data.DSC' DISCARDMAX 50000
INTO TABLE icap_gcims
TRAILING NULLCOLS
CUST_NBR_MAIN POSITION(1:9) CHAR NULLIF (CUST_NBR_MAIN=BLANKS),
CONTACT_TYPE POSITION(10:11) CHAR NULLIF (CONTACT_TYPE=BLANKS),
INQUIRY_TYPE POSITION(12:13) CHAR NULLIF (INQUIRY_TYPE=BLANKS),
INQUIRY_MODEL POSITION(14:20) CHAR NULLIF (INQUIRY_MODEL=BLANKS),
INQUIRY_COMMENTS POSITION(21:60) CHAR NULLIF (INQUIRY_COMMENTS=BLANKS),
OTHER_COLOUR POSITION(61:75) CHAR NULLIF (OTHER_COLOUR=BLANKS),
OTHER_MAKE POSITION(76:89) CHAR NULLIF (OTHER_MAKE=BLANKS),
OTHER_MODEL_DESCRIPTION POSITION(90:109) CHAR NULLIF (OTHER_MODEL_DESCRIPTION=BLANKS),
OTHER_MODEL_YEAR POSITION(110:111) CHAR NULLIF (OTHER_MODEL_YEAR=BLANKS)
data.txt file:
000000831KHAN
000000900UHFA WANTS NEW WARRANTY ID 000001017OHAL
000001110KHAP
000001812NHDE231291COST OF SERVICE INSPECTIONS TOO HIGH MAXIMA 92 MK
000002015TPFA910115CUST UPSET WITH AIRPORT DLR. $200 FOR PLUGS,OIL,FILTER CHANGE. FW
Thanks,Hi,
Better if you have given the table structure, I check your script it was fine
11:39:01 pavan_Real>create table test1(
11:39:02 2 CUST_NBR_MAIN varchar2(50),
11:39:02 3 CONTACT_TYPE varchar2(50),
11:39:02 4 INQUIRY_TYPE varchar2(50),
11:39:02 5 INQUIRY_MODEL varchar2(50),
11:39:02 6 INQUIRY_COMMENTS varchar2(50),
11:39:02 7 OTHER_COLOUR varchar2(50),
11:39:02 8 OTHER_MAKE varchar2(50),
11:39:02 9 OTHER_MODEL_DESCRIPTION varchar2(50),
11:39:02 10 OTHER_MODEL_YEAR varchar2(50)
11:39:02 11 );
Table created.
11:39:13 pavan_Real>select * from test1;
no rows selected
C:\Documents and Settings\ivy3905>sqlldr ara/ara@pavan_real
control = C:\control.ctl
SQL*Loader: Release 9.2.0.1.0 - Production on Sat Sep 12 11:41:27 2009
Copyright (c) 1982, 2002, Oracle Corporation. All rights reserved.
Commit point reached - logical record count 5
11:42:20 pavan_Real>select count(*) from test1;
COUNT(*)
5 control.ctl
LOAD DATA
INFILE 'C:\data.txt'
BADFILE 'c:\data.BAD'
DISCARDFILE 'c:\data.DSC' DISCARDMAX 50000
INTO TABLE test1
TRAILING NULLCOLS
CUST_NBR_MAIN POSITION(1:9) CHAR NULLIF (CUST_NBR_MAIN=BLANKS),
CONTACT_TYPE POSITION(10:11) CHAR NULLIF (CONTACT_TYPE=BLANKS),
INQUIRY_TYPE POSITION(12:13) CHAR NULLIF (INQUIRY_TYPE=BLANKS),
INQUIRY_MODEL POSITION(14:20) CHAR NULLIF (INQUIRY_MODEL=BLANKS),
INQUIRY_COMMENTS POSITION(21:60) CHAR NULLIF (INQUIRY_COMMENTS=BLANKS),
OTHER_COLOUR POSITION(61:75) CHAR NULLIF (OTHER_COLOUR=BLANKS),
OTHER_MAKE POSITION(76:89) CHAR NULLIF (OTHER_MAKE=BLANKS),
OTHER_MODEL_DESCRIPTION POSITION(90:109) CHAR NULLIF (OTHER_MODEL_DESCRIPTION=BLANKS),
OTHER_MODEL_YEAR POSITION(110:111) CHAR NULLIF (OTHER_MODEL_YEAR=BLANKS)
data.txt
000000831KHAN
000000900UHFA WANTS NEW WARRANTY ID 000001017OHAL
000001110KHAP
000001812NHDE231291COST OF SERVICE INSPECTIONS TOO HIGH MAXIMA 92 MK
000002015TPFA910115CUST UPSET WITH AIRPORT DLR. $200 FOR PLUGS,OIL,FILTER CHANGE. FW
CUST_NBR_MAIN CONTACT_TYPE INQUIRY_TYPE INQUIRY_MODEL INQUIRY_COMMENTS OTHER_COLOUR OTHER_MAKE OTHER_MODEL_DESCRIPTION OTHER_MODEL_YEAR
000000831 KH AN NULL NULL NULL NULL NULL NULL
000000900 UH FA WANTS NEW WARRANTY ID 000001017OHAL NULL NULL NULL NULL
000001110 KH AP NULL NULL NULL NULL NULL NULL
000001812 NH DE 231291C OST OF SERVICE INSPECTIONS TOO HIGH MAXI MA 92 MK NULL NULL NULL
000002015 TP FA 910115C UST UPSET WITH AIRPORT DLR. $200 FOR PLU GS,OIL,FILTER C HANGE. FW NULL NULL- Pavan Kumar N
Edited by: Pavan Kumar on Sep 12, 2009 11:46 AM -
Special character loading issue with SQL Loader
Hi,
I am getting the special characters as part of my input file to SQL loader. The problem is that because the length of the input string (having special characters) is more than 1000 in input data, the converted bytes length is becoming more than 4000 and the defined substrb() function in control file is not working for it and the target 'ADDR_LINE' column in table 'TEST_TAB' is defined Varchar2(1024 char).
Following is a sample ctl file and data i am using for it.
LOAD DATA
CHARACTERSET UTF8
INFILE 'updated.txt'
APPEND INTO TABLE TEST_TAB
FIELDS TERMINATED BY "|~"
TRAILING NULLCOLS
INDX_WORD ,
ADDR_LINE "SUBSTRB(:ADDR_LINE , 1, 1000)",
CITY
following is the actual data which i am receiving as part of input file to sql loader for the ADDR_LINE column:
'RUA PEDROSO ALVARENGA, 1284 AƒAƒA‚AƒAƒA‚A‚AƒAƒAƒA‚A‚AƒA‚A‚AƒAƒAƒA‚AƒAƒA‚A‚A‚AƒAƒA‚A‚AƒA‚A‚AƒAƒAƒA‚AƒAƒA‚A‚AƒAƒAƒA‚A‚AƒA‚A‚A‚AƒAƒA‚AƒAƒA‚A‚A‚AƒAƒA‚A‚AƒA‚A‚A‚AƒAƒA‚AƒAƒA‚A‚AƒAƒAƒA‚A‚AƒA‚A‚AƒAƒAƒA‚AƒAƒA‚A‚A‚AƒAƒA‚A‚AƒA‚A‚A‚AƒAƒA‚AƒAƒA‚A‚AƒAƒAƒA‚A‚AƒA‚A‚A‚AƒAƒA‚AƒAƒA‚A‚A‚AƒAƒA‚A‚AƒA‚A‚A– 10 ANDAR'
My database is having following settings.
NLS_CALENDAR GREGORIAN
NLS_CHARACTERSET AL32UTF8
NLS_COMP BINARY
NLS_CURRENCY $
NLS_DATE_FORMAT DD-MON-RR
NLS_DATE_LANGUAGE AMERICAN
NLS_DUAL_CURRENCY $
NLS_ISO_CURRENCY AMERICA
NLS_LANGUAGE AMERICAN
NLS_LENGTH_SEMANTICS BYTE
NLS_NCHAR_CHARACTERSET AL16UTF16
NLS_NCHAR_CONV_EXCP FALSE
NLS_NUMERIC_CHARACTERS .,
NLS_SORT BINARY
NLS_TERRITORY AMERICA
NLS_TIMESTAMP_FORMAT DD-MON-RR HH.MI.SSXFF AM
NLS_TIMESTAMP_TZ_FORMAT DD-MON-RR HH.MI.SSXFF AM TZR
NLS_TIME_FORMAT HH.MI.SSXFF AM
NLS_TIME_TZ_FORMAT HH.MI.SSXFF AM TZR
Any help in this regard will be much appreciated.
Thanks in advance.Is the data file created directly on the Unix server ? If not, how does it get to the Unix server ? And where does the file come from ? Is the UTF8 locale installed on the Unix server (check with the Unix sysadmin) ?
HTH
Srini -
Strange sqlloader loader issue with carriage return in Unix
Oracle 10g
Solaris
Hi All, I'm having issues in running some data into a table via sqlloader. The data was extracted using concatanated SQL with a | delimiter. sql script was executed in the shell to produce the data file.
eg
a,b,c|
d,e,f|
The control file specifies a string terminator as "str '|\n'" but when i run the sqlloadr command on the unix box I states that
no terminator found after TERMINATED and ENCLOSED field.
Ive tried it with \n\r same sort of issue.
The strange scneario i encountered was when I just specified "str '|'" as I read unix would default to \n, the weird thig was that my 6 records DID load into the table succesfully but a bad file was produced with a | character in it and the log file specfied that it tried to load 7 records where 6 were succesfull and 1 failed even though I only had 6 record to play with in the 1dst place.
Any ideas / thoughts greatly appreciated?!
Kind regards
SatnamHi All,
Ive updated the problem..with some output... essentially Ive get it to a situation wher I load ALL my records into the table but I still get a bad file with a "|" record issue and the log file still syas that Im trying to load 7 record when I only have the 6 records.
...............SQL statment...
set trimpspool on
set feedback off
set heading off
set linesize 500
set pagesize 0
spool loaddata_FP.lst
SELECT '"'||spart.x_lsm_region||'"'||','||
'"'||spart.x_sub_type||'"'||','||
'"'||spart.x_origin_type||'"' ||'|'
FROM siebel.cx_ls_part_ship spart;
spool off
-- sample of control file
load data infile 'loaddata_FP.lst' "str '|'"
into table siebel_data_fp fields terminated by "," optionally enclosed by '"'
(x_lsm_region,
x_sub_type,
x_cust_face_staff,
x_nature_partner,
x_origin_type)
--sample log file with error why is it telling me I have 7 records when I am processing 6?
value used for ROWS parameter changed from 64 to 22
Record 7: Rejected - Error on table SIEBEL_DATA_FP, column X_SUB_TYPE.
Column not found before end of logical record (use TRAILING NULLCOLS)
Table SIEBEL_DATA_FP:
6 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.
--- sample bad file showing the pipe ... whay is sqlloader trying to process this pipe when its part of the record...
/u01/oracle/admin/adhoc/xxxl(TESTxx)$
/u01/oracle/admin/adhoc/xxx(TESTxx)$ vi FCT_PARTNERSHIP_ldrcontrol.bad
"FCT_PARTNERSHIP_ldrcontrol.bad" [Incomplete last line] 2 lines, 213 characters
|
~
~
~
any help appreciated!
Edited by: spliffer on 04-May-2010 05:06 -
Class loading issue with JDK 1.5
I have recently loaded JDK 1.5 on a laptop that previously had version 1.3. The java code I need to run stopped working and I getget a java.lang.NoClassDefFoundError. I am logging the classpath and I see the jar file with the offending class is there.
I checked my pathing even, since I know java will have a problem with slashes at the beginning of the path when it is called via command line. But all my pathing is absolute.
In the code, I am using C to start up the JVM and then use JNI to communicate between java and C. Because of this complexity, I have searched the forums for problems with JNI and JDK 1.5. I found a case where turning off the JIT compilation kept the JVM from crashing for some users having issues with 1.5, but this approach did not work for me. Not too surprising, though, since this is really a classloading issue.
Where do I go next? Anyone else having this problem?[http://java.sun.com/javase/6/docs/technotes/guides/security/SunProviders.html]
Reminder: Cryptographic implementations in the Sun JDK are distributed through several different providers
("Sun", "SunJSSE", "SunJCE", "SunRsaSign")
for both historical reasons and by the types of services provided.
General purpose applications SHOULD NOT request cryptographic services from specific providers. That is:
getInstance("...", "SunJCE"); // not recommended
vs.
getInstance("..."); // recommended
Otherwise, applications are tied to specific providers which may not be available on other Java implementations.
They also might not be able to take advantage of available optimized providers (for example, hardware
accelerators via PKCS11 or native OS implementations such as Microsoft's MSCAPI) that have a
higher preference order than the specific requested provider. -
Data load issue with export data source - BW 3.5
Hi,
We are facing issues in loading data with the help of export data source.
We have created export data source of 0PCA_C01 cube. With the help of this export datasource, we are loading data to other custom cube. Scenario is working fine in development server.
But when we transported objects to quality server data is not getting loaded to custom target cube.
It is extracting zero records. All transports are ok and we have generated export datasource in quality before transports .Also regenerated export datasource after transport and activated infosource, update rule via RS* programs. Every object is active but data is not getting extracted.
RSA3 for 80PCA_C01 datasource isn't extracting any record in Quality. Records getting extracted in development. We are in BW 3.5 with patch level 19.
Please guide us to resolve the issue.
Thanks,
AdityaHi
Make sure that you have relevant Role & Authorization at Quality/PRS.
You have to Transport the Source Cube first and then Create a Generate Export Data Source in QAS. Then, replicate data sources for BW QAS Soruce System. Make sure this replicated Data Source in QAS. Only then can transport new update rules for second cube.
Hope it helps and clear -
Sql loader error with date format
Hi everyone,
I have table and have a data in one coulmn RECORDED_DATE like '20090224' and my client is asking me to load this coulmn data in 'yyyymmdd' format.I am strucked up with my ideas.I used to_date('20090124','yyyymmdd') in control file.but it is also not working Here it is my control file
LOAD DATA
INFILE 'C:\xxxx\SQLLDR\HE data\HE_data_Feb.txt'
BADFILE 'C:\xxxx\SQLLDR\HE data.bad'
DISCARDFILE 'C:\xxxx\SQLLDR\HE data.dsc'
INTO TABLE LSCCMGR.FASTPAY_HE_DATA
REPLACE
fields terminated by X'09'
TRAILING NULLCOLS
(RECORDED_DATE "TO_DATE(:RECORDED_DATE,'mm/dd/yyyy')"
AGENT_ID
MEASURE
TRANSACTIONS
FEES
If i excute like this i am getting the error like
Record 1: Rejected - Error on table LSCCMGR.FASTPAY_HE_DATA, column RECORDED_DATE.
ORA-01843: not a valid month
Getting for all records,what i need o change to get the RECORDED_DATE as dateformat.Ple any one help me in this issue to resolve
How can we perform this using sql loader pls let me know,Thanks in advance.
SravanHi,
>>(RECORDED_DATE "TO_DATE(:RECORDED_DATE,'mm/dd/yyyy')"
*Change this line to*
(RECORDED_DATE "TO_DATE(:RECORDED_DATE,'yyyymmdd')"Regards, -
SQL*LOADER script with ORA-03135: connection lost contact error
Hello,
I got a really strange problem with a script that transfer data from a database to an other. Each day we recieve the raw data in zipped txt files, then we feed it to the database with SQL Loader. This worked fine until two weeks ago. At first, I thought the error must have been in the script, but it didn't change at all since 3 months. And the weirdest thing is that sometime it works without any problems, but now I get almost anytime the "ORA-03135: connection lost contact" and it seems to happen randomly. It never fails at the same place , thought the data I feed the script is always the same.
I'm new to SQL*Loader and since the script seems to send all the data, I don't understand where that error come from. Can I do something on my workstation or the problem is on the database server ?
I think the problem would be that the connection get a timeout out on the server, but we never got that problem on the production server and it has a lot more data to transfer then my little test script.
Have you any idea on whjat the problem could be ?03135, 00000, "connection lost contact"
// *Cause: 1) Server unexpectedly terminated or was forced to terminate.
// 2) Server timed out the connection.
// *Action: 1) Check if the server session was terminated.
// 2) Check if the timeout parameters are set properly in sqlnet.ora.I would suspect networking issues external to sqlldr & Oracle -
SQL*Loader: puzzling with ORA-03106
Hello All,
I got a process that loads 3 files into a 8.1.7.2.0. Database. It uses DIRECT Path to load it. If the database is freshly started it loads the first 2 files and fails with the third one with:
Error during upi fetch: [100]
ORA-03106: fatal two-task communication protocol error
SQL*Loader-704: Internal error: uldisconnect [-1]
ORA-00600: internal error code, arguments: [729], [64], [space leak], [], [], [], [], []
If it's not started freshly it can't even load a single file. But if I do the load without DIRECT it works.
In a forum I found a hint to the Parameter SESSION_CACHED_CURSORS. I then changed it from 100 to 0 and it worked.
But I don't see the reason for that behaviour!
Any hint is appreciated!
Imre03135, 00000, "connection lost contact"
// *Cause: 1) Server unexpectedly terminated or was forced to terminate.
// 2) Server timed out the connection.
// *Action: 1) Check if the server session was terminated.
// 2) Check if the timeout parameters are set properly in sqlnet.ora.I would suspect networking issues external to sqlldr & Oracle
Maybe you are looking for
-
MacBook Pro mid 2010 13 inch battery?
Hello, I remember my old MacBook's (white, early 2008) the battery showed things like : "Replace soon" and so, but on my MacBook Pro it went to Service Battery immediately. Now it seems it still holds as much as charge as it did before, so I don't kn
-
Not able to get SSL related CGI Environment Variables?
We are currently using APEX 3.2.0.x, OHS 10.1.3.x, and 11gR1 on linux. The APEX application we've been developing will be accessed via SSL and x509 certificates such that a client certificate is passed from a user's browser to the OHS, the informatio
-
Calling a webservice from webdynpro ABAP.
Hi, Anybody have doc/material with screenshots on calling a webservice from webdynpro ABAP (In WAS 7.0 version using service calls ) with clear steps ? Thanks in advance. Ponts will not be a constraint for right answers Praveen Edited by: Praveen ku
-
Printer all of a sudden went offline And connect button if gray (not operable) How do i get connection back between Hp pc and hp printerCon THe printer and PC are on wifi. Printer works for Phones and Ipad. Scan works with the PC but not print.
-
Accounts with "underscore" don't work!!!
Hi guyz, My Apple Account & email address contain "underscore" ("_") & it seems that I'm not able to log on to them on iPod Touch 2.2.1! It gives me "Wrong ID" error but I have typed my ID right! (I can connect to other accounts which does not contai