Selection criteria in SQL Loader
Hi All,
I have a Data file which has around 7000 lines,
I am using SQL Loader to insert those records into my interface tables, but i have a selection criteria like i need to pick those records whose number starts with 'P'.
Can I use the LIKE operator in SQL Loader to pick those records which matches the criteria.
LOAD DATA
REPLACE
INTO TABLE xx_jm_intf_stg
WHERE number LIKE 'P%'
FIELDS TERMINATED BY '|'
TRAILING NULLCOLS
or is there any other way to pick those records.
Thanks in Advance.
Jana
Jana,
CTL file:
LOAD DATA
INFILE *
Append
INTO TABLE XX_JM_INTF_STG
WHEN (1:1) = 'P'
FIELDS TERMINATED BY "|" OPTIONALLY ENCLOSED BY '"'
(column1,
column2,
column3,
column4,
column5)
BEGINDATA
P513001|P513001|Lloyds of London|GB123456789|P513001
P513002|P513001|Lloyds of London|GB123456790|P513002
A513003|P513001|Lloyds of London|GB123456791|P513003
C513004|P513004|AXA Brussels|BE123456|P513004
P513006|P513006|Fortis Bank|BE234341354|P513006
{code}
Table:
{code}
SQL> select t.* from xx_jm_intf_stg t;
COLUMN1 COLUMN2 COLUMN3 COLUMN4 COLUMN5
P513001 P513001 Lloyds of London GB123456789 P513001
P513002 P513001 Lloyds of London GB123456790 P513002
P513006 P513006 Fortis Bank BE234341354 P513006
{code}
Regards,
Similar Messages
-
Selection Criteria for Delta loads triggered using MDM_CLNT_EXTR
Hi ,
Currently we are required to load data only from two specific account groups . Therefore in the selection criteria in mdm_clnt_extr we maintian these two account groups and extract data.
However, when setting up the delta load there does not to be an option to restrcit the delta to a specify an criteria. Therefore, in our case several records from account groups which are not required are passed on to the MDM system.
Is there a way to address this requirement ?
1. There is an option to run the initial load variants at regular intervals, the problem with this is that in our case we have several variant creates as the R/3 system does not allows extraction on more that 999 records at a time. Therefore at point of time to capture the delta records , if we run all these jobs our network gets choked.
2. Run delta job, but without selection criteria it pulls out records which we don't require
Any suggestions on how this problem can be addressed are welcome ,
Thanks in advance,
Anita GeorgeThanks Michael !
Well, regarding hte ALE settings, we did take a look in bd64 the filters are based on objects which one of these is relevant for customer account groups ? Probably in the future we would require all data, and then is it enogh to remove the filter ?
Can a filter be maintained at the XI level , this would be good as only the required account groups are passed on to MDM . Is there any documentation on available on this ?
Regarding the Import Manager, will have to check this functionality, as it is now no matter how many times we update the map/rename /load/unload it automated imports keep failing.
Our R/3 system seems to have problem extracting more than 999 records, as we tried with different number of records and all those extraction jobs got cancelled. So, currently we are running multiple jobs for the initial load and even this is very time consuming.
Thanks & Regards,
Anita George -
How to load selected column with sql loader
Hi all
I want to load only few columns from a datafile not all columns and i don't know how to do from SQL LDR.
I know we can use position but the data is not fixed length.
I'm working with Oracle 11g and Linux OS.
Here is an example of my data file and table.
Data file is and the field is separated by | :
3418483|VOU|20120609090114|555208363|0|2858185502059|1000|0||
3418484|SR|20120609090124|551261956|0|4146314127759|200000|0||
SQL> desc TBL1
Name Null? Type
CTYPE VARCHAR2(5)
BDATE DATE
PARTNUM VARCHAR2(60)
SERIALNO NUMBER
FVALUE NUMBER
I want to have:
SQL> select * from TBL1
CTYPE BDATE PARTNUM SERIALNO FVALUE
VOU 09/06/2012 555208363 2858185502059 1000
SR 09/06/2012 551261956 4146314127759 200000Thank you.look at FILLER
http://www.orafaq.com/wiki/SQL*Loader_FAQ#Can_one_skip_certain_columns_while_loading_data.3F
--add sample
num1 FILLER,
ctype,
bdate "to_date(:bdate, 'YYYYMMDDHH24MISS')",
PARTNUM,
num2 FILLER,
SERIALNO,
FVALUE,
num3 FILLER
)Edited by: AlexAnd on Jun 9, 2012 4:29 AM -
Creating SQL-Loader script for more than one table at a time
Hi,
I am using OMWB 2.0.2.0.0 with Oracle 8.1.7 and Sybase 11.9.
It looks like I can create SQL-Loader scripts for all the tables
or for one table at a time. If I want to create SQL-Loader
scripts for 5-6 tables, I have to either create script for all
the tables and then delete the unwanted tables or create the
scripts for one table at a time and then merge them.
Is there a simple way to create migration scripts for more than
one but not all tables at a time?
Thanks,
Prashant RaneNo there is no multi-select for creating SQL-Loader scripts.
You can either create them separately or create them all and
then discard the one you do not need. -
Sql loader function attachment....
Hello all,
I have a doubt on sql loader....
Now i'm having like below tables..
TableA
empno|ename
1|A
2|B
3|C
Table B
salary|empno
10|1
12|2
14|3
My requirement is, in my data file instead of empno i'm having ename. Now, I need to right a function where if in datafile ename is A its should update 1 in that empno field.
Please guide me to achieve this...
I am new to technical... So i'm not confortable in writing...
I come to know that we can attach the function in to sql loader..
select statement in sql loader
Thanks and Regards,
MuthuBy using last update function, I modified the control file like below.
load data
infile *
into TABLE AP_SUPPLIER_SITES_INT
REPLACE
fields terminated by ","
OPTIONALLY ENCLOSED BY '"'
VENDOR_INTERFACE_ID "VDR_INF_F(':CUSTOMER_NUM','9999')",
VENDOR_SITE_INTERFACE_ID "(ap_supplier_sites_int_s.NEXTVAL)",
LAST_UPDATE_DATE "SYSDATE",
LAST_UPDATED_BY,
VENDOR_SITE_CODE,
CREATION_DATE "SYSDATE",
CREATED_BY,
PURCHASING_SITE_FLAG,
PAY_SITE_FLAG,
ADDRESS_LINE1,
ADDRESS_LINE2,
ADDRESS_LINE3,
CITY,
STATE,
ZIP,
COUNTRY,
PHONE,
FAX,
PAYMENT_METHOD_LOOKUP_CODE,
TERMS_ID,
CREATE_DEBIT_MEMO_FLAG,
HOLD_UNMATCHED_INVOICES_FLAG,
EMAIL_ADDRESS,
MATCH_OPTION,
EXCLUDE_FREIGHT_FROM_DISCOUNT,
INVOICE_CURRENCY_CODE,
PAYMENT_CURRENCY_CODE,
COUNTRY_OF_ORIGIN_CODE,
FREIGHT_TERMS_LOOKUP_CODE,
PAY_GROUP_LOOKUP_CODE,
PAY_DATE_BASIS_LOOKUP_CODE,
ALWAYS_TAKE_DISC_FLAG,
ORG_ID
begindata
1005,,SYSDATE,1132,Test MA Site_1,SYSDATE,1132,Y,Y,No#907 62nd Street ,10th Sector,KK Nagar,Chennai,TamilNadu,600078,IN,+91 44 33333333,044 40404040,CHECK,10000,Y,N,[email protected],R,Y,INR,INR,IN,TBD,STANDARD,DISCOUNT,Y,120
1005,,SYSDATE,1132,Test MA Site_2,SYSDATE,1132,Y,Y,No#907 62nd Street ,10th Sector,KK Nagar,Chennai,TamilNadu,600078,IN,+91 44 33333333,044 40404040,CHECK,10000,Y,N,[email protected],R,Y,INR,INR,IN,TBD,STANDARD,DISCOUNT,Y,120
1005,,SYSDATE,1132,Test MA Site_3,SYSDATE,1132,Y,Y,No#907 62nd Street ,10th Sector,KK Nagar,Chennai,TamilNadu,600078,IN,+91 44 33333333,044 40404040,CHECK,10000,Y,N,[email protected],R,Y,INR,INR,IN,TBD,STANDARD,DISCOUNT,Y,120
1006,,SYSDATE,1132,Test1 M Site_1,SYSDATE,1132,Y,Y,No#907 62nd Street ,10th Sector,KK Nagar,Chennai,TamilNadu,600078,IN,+91 44 33333333,044 40404040,CHECK,10000,Y,N,[email protected],R,Y,INR,INR,IN,TBD,STANDARD,DISCOUNT,Y,120
1007,,SYSDATE,1132,Test1 B Site_1,SYSDATE,1132,Y,Y,No#907 62nd Street ,10th Sector,KK Nagar,Chennai,TamilNadu,600078,IN,+91 44 33333333,044 40404040,CHECK,10000,Y,N,[email protected],R,Y,INR,INR,IN,TBD,STANDARD,DISCOUNT,Y,120
*Now I am getting different error like below. Please look that error and give me your suggestion...*
Table "AP"."AP_SUPPLIER_SITES_INT", loaded from every logical record.
Insert option in effect for this table: REPLACE
Column Name Position Len Term Encl Datatype
VENDOR_INTERFACE_ID FIRST * , O(") CHARACTER
SQL string for column : "VDR_INF_F(':CUSTOMER_NUM','9999')"
VENDOR_SITE_INTERFACE_ID NEXT * , O(") CHARACTER
SQL string for column : "(ap_supplier_sites_int_s.NEXTVAL)"
LAST_UPDATE_DATE NEXT * , O(") CHARACTER
SQL string for column : "SYSDATE"
LAST_UPDATED_BY NEXT * , O(") CHARACTER
VENDOR_SITE_CODE NEXT * , O(") CHARACTER
CREATION_DATE NEXT * , O(") CHARACTER
SQL string for column : "SYSDATE"
CREATED_BY NEXT * , O(") CHARACTER
PURCHASING_SITE_FLAG NEXT * , O(") CHARACTER
PAY_SITE_FLAG NEXT * , O(") CHARACTER
ADDRESS_LINE1 NEXT * , O(") CHARACTER
ADDRESS_LINE2 NEXT * , O(") CHARACTER
ADDRESS_LINE3 NEXT * , O(") CHARACTER
CITY NEXT * , O(") CHARACTER
STATE NEXT * , O(") CHARACTER
ZIP NEXT * , O(") CHARACTER
COUNTRY NEXT * , O(") CHARACTER
PHONE NEXT * , O(") CHARACTER
FAX NEXT * , O(") CHARACTER
PAYMENT_METHOD_LOOKUP_CODE NEXT * , O(") CHARACTER
TERMS_ID NEXT * , O(") CHARACTER
CREATE_DEBIT_MEMO_FLAG NEXT * , O(") CHARACTER
HOLD_UNMATCHED_INVOICES_FLAG NEXT * , O(") CHARACTER
EMAIL_ADDRESS NEXT * , O(") CHARACTER
MATCH_OPTION NEXT * , O(") CHARACTER
EXCLUDE_FREIGHT_FROM_DISCOUNT NEXT * , O(") CHARACTER
INVOICE_CURRENCY_CODE NEXT * , O(") CHARACTER
PAYMENT_CURRENCY_CODE NEXT * , O(") CHARACTER
COUNTRY_OF_ORIGIN_CODE NEXT * , O(") CHARACTER
FREIGHT_TERMS_LOOKUP_CODE NEXT * , O(") CHARACTER
PAY_GROUP_LOOKUP_CODE NEXT * , O(") CHARACTER
PAY_DATE_BASIS_LOOKUP_CODE NEXT * , O(") CHARACTER
ALWAYS_TAKE_DISC_FLAG NEXT * , O(") CHARACTER
ORG_ID NEXT * , O(") CHARACTER
value used for ROWS parameter changed from 64 to 30
Record 1: Rejected - Error on table "AP"."AP_SUPPLIER_SITES_INT", column VENDOR_INTERFACE_ID.
ORA-06553: PLS-306: wrong number or types of arguments in call to 'VDR_INF_F'
Record 2: Rejected - Error on table "AP"."AP_SUPPLIER_SITES_INT", column VENDOR_INTERFACE_ID.
ORA-06553: PLS-306: wrong number or types of arguments in call to 'VDR_INF_F'
Record 3: Rejected - Error on table "AP"."AP_SUPPLIER_SITES_INT", column VENDOR_INTERFACE_ID.
ORA-06553: PLS-306: wrong number or types of arguments in call to 'VDR_INF_F'
Record 4: Rejected - Error on table "AP"."AP_SUPPLIER_SITES_INT", column VENDOR_INTERFACE_ID.
ORA-06553: PLS-306: wrong number or types of arguments in call to 'VDR_INF_F'
Record 5: Rejected - Error on table "AP"."AP_SUPPLIER_SITES_INT", column VENDOR_INTERFACE_ID.
ORA-06553: PLS-306: wrong number or types of arguments in call to 'VDR_INF_F'
Thanks and Regards,
Muthu -
제품 : ORACLE SERVER
작성날짜 : 2002-04-25
Advanced SQL*LOADER
====================
PURPOSE
Q&A를 통한 SQL*LOADER 사용 방법에 대해 알아보도록 한다.
Explanation
1) Carriage returns, linefeeds, EOL character를 load 하는 방법
2) Delimiter 를 사용한 경우 특정 field 를 skip 할수 있나?
3) "FIELD IN DATA FILE EXCEEDED MAXIMUM SPECIFIED LENGTH" 메세지
해결 방법
4) Blob 이나 raw data 는 어떻게 사용하나?
5) Error LDR-510은 어떻게 처리하나?
6) EBCDIC Characterset data file 은 어떻게 load 하나?
7) Control file 에 WE8EBCDIC500 characterset 을 사용하였는데도
SQL*Loader-266 가 발생하는 경우
8) Decimal data는 어떻게 load 하는가?
9) Trailing signs 이 있는 숫자는 어떻게 load 하는가?
10) Zoned number는 무엇인가?
11) Packed Decimal Number는 무엇인가?
12) NULLIF 는 어떻게 사용하나 ?
13) 한개의 single column을 위해 여러 개의 nullif는 사용가능한가?
14) SQL*Loader 가 NULL 로 여기는 column 을 blank space 로
여기도록 만들려면 ?
15) WHEN 절은 어떻게 사용하나?
16) WHEN 절에 OR 를 사용할수 있는가?
17) Delimiter 로 ','를 사용하였는데 data 에 ','가 포함된 경우는?
18) 어떻게 하면 commit 을 덜 사용할 수 있나?
1) carriage returns, linefeeds, EOL character를 load 하기
SQL*Loader 는 이들을 통해 서로 다른 physical record 로 인식한다.
이들을 load 하기 위해 사용되는 option 은
- concatenate
- continueif
- file processing option: FIX (PRE: 1012555.6 PRS: 2060647.6)
- file processing option: VAR (PRE: 1011372.6 PRS: 2059405.6)
예제1) concatenate 사용하기
Control File: test.ctl
load data
infile 'test.dat'
truncate
concatenate (2)
into table test
(col1 char(2000))
Data File: 'test.dat'
This is a test \n
this is the second Line.
This is a new record\n
this is the second line of the second record
결과:
SQL> select * from test;
COL1
This is a test \nthis is the second Line.
This is a new record\nthis is the second line of the second record
예제2) continueif 를 사용하기
Control File: test.ctl
load data
infile test.dat
truncate
continueif this (1) = '*'
into table test
(col1 char(64000))
Data File: 'test.dat'
*11111111111
*22222222222
*33333333333
*44444444444
*55555555555
66666666666
*77777777777
*88888888888
999999999999
*aaaaaaaaaaa
*bbbbbbbbbbb
cccccccccccc
*ddddddddddd
*eeeeeeeeeee
*fffffffffff
*ggggggggggg
*hhhhhhhhhhh
결과 :
SQL> select * from test;
COL1
11111111111222222222223333333333344444444444555555555556666666666
777777777778888888888899999999999
aaaaaaaaaaabbbbbbbbbbbccccccccccc
dddddddddddeeeeeeeeeeefffffffffffggggggggggghhhhhhhhhhh
2) delimiter 를 사용한 경우 특정 field 를 skip 할수 있나 ?
: 불가능하다 (RTSS Bulletin: 103235.426)
3): 모든 column 에 해당 column 에 해당하는 length 를 지정하였는데
다음과 같은 error message 를 접한 경우 :
"FIELD IN DATA FILE EXCEEDED MAXIMUM SPECIFIED LENGTH"
:255 자 이상의 char/varchar2/long field 를 load 하려한 경우
이 경우는 CHAR data type 의 buffer size 를 증가 시켜야 한다.
이의 default 는 255 이다.
예제)
load data
into table
(col1 char(64000))
이 경우 buffer 를 64K 로 증가시켜 col1 에 load 해야 한다.
<주의> 64K 는 sql*loader 에서 사용 가능한 maximum record length이다.
이는 1 record 를 여러개의 buffer 를 통해 load 하지 못하는 문제이다.
최대 buffer 는 64k 이다.
64 K 이상을 원하는 경우
a) 여러개의 작은 chunk 로 나누거나,
b) SQL*Loader 를 사용하지 못한다.
4) blob 이나 raw data 는 어떻게 사용하나 ?
: RAW datatype 을 사용하고 length를 부여한다.
예제)
LOAD DATA
INFILE xx.dat "VAR"
REPLACE
INtO TABLE test
(BLOB raw (32767) )
xx.dat 는 load 하고자 하는 전체 file 이다.
이는 bit mapped files 이나, 그외 file type 을 DB 에 load 시
사용 가능한 option 이다.
5) error LDR-510은 어떻게 처리한가 ?
: LDR-510은 data file 안의 physical record가 최대값인 64K 를
넘은 경우이다.
SQL*Loader 에서는 physical record 가 연속적이어야 하며, 이는
최대인 64k 를 넘지 못하는 제한이 있기 때문이다.
(여러 buffers 를 통해 load 불가능)
이는 위의 1번과 같으므로 physical record 를 여러 logical record 로
나누어야 한다.
6) EBCDIC Characterset data file 은 어떻게 load 하나 ?
: control file 에 characterset 을 명시한다.
많이 사용되는 EBCDIC character set 은 WE8EBCDIC500 이다.
예제)
load data
characterset we8ebcdic500
infile *
replace
into table for_load
(x)
begindata
B
Z
X
SQL> select * from for_load;
X
a
i
이는 ASCII 의 경우도 같다.
7) control file 에 WE8EBCDIC500 characterset 을 사용하였는데도
SQL*Loader-266 가 발생하는 경우
환경변수인 ORA_NLS 가 맞게 설정되었는지를 check 한다.
(PRE: 1012552.6 PRS: 2060644.6)
8) decimal data 는 어떻게 load 하는가?
: data 를 조작하는 방법밖에 없다.즉 decimal point 가 들어가게
data 를 조작한다.
예제)
load data
infile *
truncate
into table test
(col1 integer external(5) ":col1/100")
begindata
12345
10000
24983
SQL> select * from test;
COL1
123.45
100
249.83
9) trailing signs 이 있는 숫자는 어떻게 load 하는가?
예제)
load data
infile *
truncate
into table loadnums
(col1 position(1:5),
col2 position(7:16) "to_number(:col2,'99,999.99MI')")
begindata
abcde 1,234.99-
abcde 11,234.34+
abcde 45.23
abcde 99,234.38-
abcde 23,234.23+
abcde 98,234.23+
SQL> select * from loadnums;
COL1 COL2
abcde -1234.99
abcde 11234.34
abcde -99234.38
abcde 23234.23
abcde 98234.23
<주의> 이경우 log file 에 다음의 error message 를 볼수있다.
Record 3: Rejected - Error on table LOADNUMS, column COL2.
ORA-01722: invalid number
이 error message 는 당연한 것이다.
왜냐면 control file 에 number datatype 에 mask 를 주었기 때문에
모든 number 는 mask 를 가져야 한다.
이때 Record 3은 trailing sign 이 없기 때문에 reject 된 것이다.
10) zoned number는 무엇인가?
이는 decimal digit 의 string 으로 1byte 에 1 string 이 해당된며,
부호가 맨 마지막byte 에 포함되는 경우이다.
예제)
LOAD DATA
infile *
append
INTO TABLE test
(col1 position(1:3) zoned(3),
col2 position(4:6),
col3 position(7:8))
begindata
12J43323
43023423
SQL> select * from test;
COL1 COL2 COL3
-121 433 23
430 234 23
2 rows selected.
다음은 zoned values의 map 이다:
{ABCDEFGHI}JKLMNOPQR0123456789
++++++++++----------++++++++++
{ABCDEFGHI}JKLMNOPQR
01234567890123456789
11) Packed Decimal Number는 무엇인가 ?
: packed decimal format은 bytes 로 이루어진 1 string 의 모음인데
각각은 2 digit (2 nibbles) 을 가진다.
이중 마지막 byte 는 1 digit 와 sign 으로 이루어진다.
이 sign 은 보통 0x0a, 0x0b, ..., 0x0f: usually 0x0c/a/e/f for +ve,
0x0d/b for -ve 로 이루어져 있다.
예를 들어 +123 의 packed decimal 표현은 다음과 같다.
[12] [3C] 이고 이때 [12] 는 nibbles 0x01 and 0x02를 포함하는
byte 이다. [3C]의 경우도 같다.
The kernel 은 sing nibble 의 여부를 ttcp2n() 을 통해 check한다.
만일 0x0a, ..., 0x0f 중의 하나가 아니면 ORA-1488 error 를 발생시킨다.
<주의> BUG:296890:
이는 bug 는 아니며, SQL*Loader 는 COBOL 에서 발생시키는 UNSIGNED
packed decimal 을 support 하지 않는다.
즉 SQL*Loader 는 packed decimal을 load 시 마지막 byte 가 반드시
1 digit와 ,sign 이 포함되어지는지 check 한다.
12) NULLIF 는 어떻게 사용하나 ?
예제)
load data
infile *
truncate
into table test
fields terminated by ','
(col1 date "mm/dd/yy" nullif col1='0', col2)
begindata
0,12345
11/11/95,12345
0,12345
11/11/95,12345
SQL> select * from test;
COL1 COL2
12345
11-NOV-95 12345
12345
11-NOV-95 12345
13) 한개의 single column을 위해 여러 개의 nullif 는 사용가능한가 ?
: 불가능하다. 그러나 workaround 로는
예제)
load data
infile *
truncate
into table test
fields terminated by ',' optionally enclosed by '"'
(col1,col2 "decode(:col2,'X',NULL,'Y',NULL,'Z',NULL,:col2)",col3)
begindata
12345,"X",12345
12345,"A",12345
12345,"Y",12345
12345,"Z",12345
12345,"B",12345
SQLDBA> select * from test;
COL1 COL2 COL3
12345 12345
12345 A 12345
12345 12345
12345 12345
12345 B 12345
5 rows selected.
14) SQL*Loader 가 NULL 로 여기는 column 을 blank space 로 여기도록
만들려면 ?
: PRESERVE BLANKS를 사용하지 않으면 loader 는 blank 들을 null 로
인식한다.
이 경우 workaround 로는
예제)
load data
infile *
into table test
fields terminated by ','
(col1 position(1:5) integer external,
col2 position(15:20) char "nvl(:col2,' ')",
col3 position(25:30) integer external)
begindata
12345 rec1 12345
12345 23453
23333 rec3 29874
98273 98783
98723 rec5 234
SQL> select * from test yields;
COL1 COL2 COL3
12345 rec1 12345
12345 23453
23333 rec3 29874
98273 98783
98723 rec4 234
5 rows selected.
15) WHEN 절은 어떻게 사용한가 ?
예제)
load data
infile *
truncate
into table t1
when col1 = '12345'
(col1 position(1:5) integer external, col2 position(7:12) char)
into table t2
when col1 = '54321'
(col1 position(1:5) integer external, col2 position(7:12) char)
begindata
12345 table1
54321 table2
99999 no tab
12345 table2
54321 table2
SQL> select * from t1;
COL1 COL2
12345 table1
12345 table2
SQL> select * from t2;
COL1 COL2
54321 table2
54321 table2
16) WHEN 절에 OR 를 사용할수 있는가 ?
: 불가능하다 그러나 workaround 로는
예제) 만일 where (col1=12345 OR col1=54321) AND col2='rowena'경우에
data 를 insert 하고자 하면
load data
infile *
truncate
into table test
when col1 = '12345' and col2='rowena'
(col1 position(1:5) integer external, col2 position(7:12) char)
into table test
when col1 = '54321' and col2='rowena'
(col1 position(1:5) integer external, col2 position(7:12) char)
begindata
12345 rowena
43234 rowena
54321 rowena
(즉, OR를 갖지 못하나, 같은 table 에 두개의 when 은 가질수있다.)
SQLDBA> select * from test;
COL1 COL2
12345 rowena
54321 rowena
2 rows selected.
17) delimiter 로 ','를 사용하였는데 data 에 ','가 포함된 경우는 ?
: 두 번 지정한다.
예제)
load 할 data 가 col1, rowena, rowena, col3 이고
datafile 이 다음과 같은 경우
col1, rowena,, rowena, col3
select * from table:
COL1 COL2 COL3
col1 rowena, rowena col3
18) 어떻게 하면 commit 을 덜 사용할 수 있나 ?
: rows 나 bindsize를 사용한다.
그러나 bindsize 가 적은 경우 bindsize는 rows 를 많이 적재할 수
있으므로 항상 1 bindsize 에 몇 개의 rows 가 set 되었는지에 관계
없이 bindsize에 commit 이 수행된다.
Reference Document
------------------hi,
pls take a look at this document
http://www.petefinnigan.com/weblog/archives/00000020.htm
regards, -
Can we use Selection Criteria Screen to tell Query which SQL script to run?
Dear All,
When I run this code, it gives me the screen below:
declare @ScanOp4 nvarchar (30)
set @ScanOp4=
/*select T3.U_ScanOp4 from [dbo].[@SCANNING] T3 where T3.U_ScanOp4*/ '[%0]'
I have used Tools -> Customization to define a UDT and UDF
Query - Selection Criteria
Invoice / Credit Note? [----------------- ]
(there's a drop-down arrow with 2 choices:
Inv = Invoice
CN = Credit Note
[OK] [Cancel]
Now, I have 2 very similar queries; the only difference is that they use different tables because one is for
Purchases (OPCH/PCH1), and the other is for Credit Memos (ORPC/RPC1)
I want to put the above declaration together with my 2 queries all in a single query so that:
(a) If I select 'Invoice', the Invoice part is executed and only invoices are displayed,
(b) If I select 'Credit Note', the Credit Note part is executed and only Credit Notes are displayed.
Do you think such a Query is possible? If yes, please give me an idea how I can achieve it.
I don't want to use UNION ALL because one of my fields is a LINK field to which I have linked all PDF Scanned documents.
I want to preserve the links, since this is the reason I'm writing the query.
Thanks
Leon Lai
Here are my skeleton codes
1st Query: User selects 'Invoice' -
SELECT
T0.[TaxDate] AS 'Doc Dt',
T5.[TransType] AS 'Txn Type',
T0.[DocNum] AS 'Doc No.',
T0.[DocTotal] AS 'Amount'
FROM [dbo].[OPCH] T0
INNER JOIN [dbo].[PCH1] T1 ON T0.[DocEntry] = T1.[DocEntry]
INNER JOIN [dbo].[OJDT] T5 ON T0.[TransID] = T5.[TransID]
2nd Query: User selects 'Credit Note' -
SELECT
T0.[TaxDate] AS 'Doc Dt',
T5.[TransType] AS 'Txn Type',
T0.[DocNum] AS 'Doc No.',
T0.[DocTotal] AS 'Amount'
FROM [dbo].[ORPC] T0
INNER JOIN [dbo].[RPC1] T1 ON T0.[DocEntry] = T1.[DocEntry]
INNER JOIN [dbo].[OJDT] T5 ON T0.[TransID] = T5.[TransID]Try this:
declare @ScanOp4 nvarchar (30)
set @ScanOp4=
/*select T3.U_ScanOp4 from [dbo].[@SCANNING] T3 where T3.U_ScanOp4*/ '[%0]'
If @ScanOp4='Inv'
SELECT
T0.[TaxDate] AS 'Doc Dt',
T5.[TransType] AS 'Txn Type',
T0.[DocNum] AS 'Doc No.',
T0.[DocTotal] AS 'Amount'
FROM [dbo].[OPCH] T0
INNER JOIN [dbo].[PCH1] T1 ON T0.[DocEntry] = T1.[DocEntry]
INNER JOIN [dbo].[OJDT] T5 ON T0.[TransID] = T5.[TransID]
If @ScanOp4='CN'
SELECT
T0.[TaxDate] AS 'Doc Dt',
T5.[TransType] AS 'Txn Type',
T0.[DocNum] AS 'Doc No.',
T0.[DocTotal] AS 'Amount'
FROM [dbo].[ORPC] T0
INNER JOIN [dbo].[RPC1] T1 ON T0.[DocEntry] = T1.[DocEntry]
INNER JOIN [dbo].[OJDT] T5 ON T0.[TransID] = T5.[TransID] -
Sql*loader to select distinct data
Hi,
i am getting the following data from a csv file.
For repeated values of phone and dept, i am getting duplicate records of empno, empname and sal
I need to load the distinct record of empno,ename into a emp table
and then move the data salary and phone numbers into different table.
Is it possible to do at sql*loader level
>
EMPNO EMPNAME SAL PHONE DETP
1 TOM 2000 99999 20
1 TOM 2000 22222
2 BEN 3000 33333 30
2 BEN 3000 40
>
thanks
sunilsunil_dba wrote:
Hi,
thanks
sunilSo what's stopping you then to create primary key on empno column ? -
Filter data on GUI SQL Loader of 10g
I have a 10g and using the SQL developer to import data from an excel to a table.
after right click on the table and specify the file, i have to map the column, since there is no header info in the spreadsheet.
i then came into 2 problems
1) on column with data type, it will say the data is null or invalid format.
2) only a subset of the data in the sheet is needed, so, i like to place a where clause type criteria during the import.
how to i handle these two situations? is there step by step instructions to follow on each?
thanks.Your problem is most likely in decode - the return type in your expression will be character based on first search value ('null'), so it will be implicitly converted to character and then again implicitly converted to date by loading into date column. At some of this conversions you probably are loosing your time part. You can try instead use cast:
SQL> desc t
Name Null? Type
LASTWRITTEN DATE
CREATEDON DATE
LASTUPDATEDON DATE
SQL> select * from t;
no rows selected
SQL> !cat t.ctl
LOAD DATA
INFILE *
INTO TABLE T
TRUNCATE
FIELDS TERMINATED BY ',' OPTIONALLY ENCLOSED BY '"' TRAILING NULLCOLS
LASTWRITTEN
"decode(:LASTWRITTEN,'null',cast(Null as date),
to_date(:LASTWRITTEN,'YYYY-MM-DD HH24:MI:SS'))",
CREATEDON
"decode(:CREATEDON,'null',cast(Null as date),
to_date(:CREATEDON,'YYYY-MM-DD HH24:MI:SS'))",
LASTUPDATEDON
"decode(:LASTUPDATEDON,'null',cast(Null as date),
to_date(:LASTUPDATEDON,'DD/MM/YYYY HH24:MI:SS'))"
BEGINDATA
2007-02-15 15:10:20,null,null
null,2007-02-15 15:10:20,null
null,null,15/02/2007 15:10:20
SQL> !sqlldr userid=scott/tiger control=t.ctl log=t.log
SQL*Loader: Release 10.2.0.3.0 - Production on Fri Feb 29 00:20:07 2008
Copyright (c) 1982, 2005, Oracle. All rights reserved.
Commit point reached - logical record count 3
SQL> select * from t;
LASTWRITTEN CREATEDON LASTUPDATEDON
15.02.2007 15:10:20
15.02.2007 15:10:20
15.02.2007 15:10:20Best regards
Maxim -
How can we tell if SQL*Loader is working on a TABLE?
We have a process that requires comparing batches with LDAP information. Instead of using an LDAP lookup tool, we get a nightly directory file, and import the two COLUMNs we want via SQL*Loader (REPLACE) into an IOT. Out of three cases, two just check the first COLUMN, and the third needs the second COLUMN as well.
We did not think of using External TABLEs, because we cannot store files on the DB server itself.
The question arises, what to do while the file is being imported. The file is just under 300M, so it takes a minute or so to replace all the data. We found SQL*Loader waits until a transaction is finished before starting, but a query against the TABLE only waits while it is actually importing the data. At the beginning of SQL*Loader's process, however, a query against the TABLE returns no rows.
The solution we are trying right now is, to have the process that starts SQL*Loader flip a flag in another TABLE denoting that it is unavailable. When it is done, it flips it back, and notes the date. Then, the process that queries the information, exits if the flag is currently 'N'.
The problem, is, what if SQL*Loader starts inbetween the check of the flag, and the query against the TABLE. How do we guarantee that it is still not being imported.
I can think of three solutions:
1) LOCK the ldap information TABLE before checking the flag.
2) LOCK the record that the process starting SQL*Loader flips.
3) Add a clause to the query against the TABLE checks that there are records in the TABLE (AND EXISTS(SELECT * FROM ldap_information).
The problem with 3) is that the process has already tagged the batches (via a COLUMN). It could, technically reset them afterwards, but that seems a bit backwards.Just out of curiosity, are you aware that Oracle supplies a DBMS_LDAP package for pulling information from LDAP sources? It would obviously be relatively easy to have a single transaction that deletes the existing data, loads the new data via DBMS_LDAP, and commits, which would get around the problem you're having with SQL*Loader truncating the table.
You could also have SQL*Loader load the data into a staging table and then have a second process either MERGE the changes from the staging table into the real table (again in a transactionally consistent manner) or just delete and insert the data.
Justin -
SQL Loader Inserts chr(13) and chr(10) in the first column of every row.
Hi,
I have exported a data in a pipe delimited file using TOAD in one database. Now I want to load the data in my local database using SQL Loader. However every time I try to load the data a double quote followed by a new line is entered for the first column of each row. Unfortunately the delimited file is very big and hence can't be posted here. However I tried the same with a customized table and its data and found the same problem. Below are the table structures and control file that I used.
create table test_sql
a varchar2(30),
b date
insert into test_sql values('51146263',sysdate-3);
insert into test_sql values('51146261,sysdate-1);
EXPORTED PIPE DELIMITED FILE_
A|B|!##!
51146261|04/14/13 4:55:18 PM|!##!
51146263|04/12/13 4:55:32 PM|!##!
create table test_sql1 as select * from test_sql where 1=2;
CONTROL FILE_
OPTIONS(SKIP=1)
LOAD DATA
INFILE 'C:\Users\Prithwish\Desktop\Test.txt' "str '!##!'"
PRESERVE BLANKS
INTO TABLE TEST_SQL1
FIELDS TERMINATED BY '|' OPTIONALLY ENCLOSED BY '"'
TRAILING NULLCOLS
A CHAR(2000),
B DATE "MM/DD/YYYY HH12:MI:SS AM"
select * from TEST_SQL1;
After this when I paste it in notepad I get the following result
A B
51146261" 14-APR-0013 16:55:18
51146263" 12-APR-0013 16:55:32.
I have no idea how the quotes or the newline appear. Is this a Toad bug? Any help would be greatly appreciated. Really urgent.
Thanks in advance
RegardsHi Harry,
I actually thought that the str !##! was causing the problem. Actually my original export has some new lines in some specific columns so I can't keep the new line as my line terminator and hence I kept the !##! as my terminator.
When I put the same data in a notepad and load it there is no problem at all. For e.g I just typed the following in a notepad and the data loaded just fine.
A|B|!##!
51146261|01-01-01 10:10:10 AM|!##!
51146263|01-01-01 11:11:11 AM|!##!
Its just when I load the exported file there the problem arises though I have verified the file using UNIX as well using octal dump and found no hidden characters.
Regards,
Prithwish -
Selection criteria are not applied to summary fields on group footers.
I wonder if anyone can help me with this problem. I am using Crystal reports version 11.2, and my data source is a Sql Server view.
The records on the view have a date field, and I have selected all records within a given date range in "Selection Formulas".
The records are then grouped, and the Crystal summary facility used to summarise number fields on the group footers.
So for example, if my view contains four records, one with field "amount" = 2, one with field "amount" = 8, one with field "amount" = 6, one with field "amount" = 3, but only the first two records are within the valid date range, you would expect to see the first two records listed out at detail level, then field "amount" summarised at group level, with a summarised value of 10.
ie .... record1 2
record2 8
group level total 10
This works fine when I run the report using Crystal's "print preview" facility. However, when the report is run from within an application written in C#.NET, the selection criteria are not applied to the summary field, so you get ..
record1 2
record2 8
group level total 19
I tried putting the date selection criteria at both record and group level, but that did not work.
I googled the problem and found an article explaining that Crystal first performs the record-level selection, then it creates the groups and totals up any summary fields, and only then does it apply the group-level selection criteria, which can lead to problems like the one I have described above. However, since I have put my date selection criteria at both record and group level, I do not understand why I still get the problem.
In one report I got round this problem by creating a formula that returned zero if the record date was outside of the valid date range, and returned the number field to be summarised if the date was valid, then summarising that formula, instead of summarising the number field directly.
In other reports I created one formula to set a shared variable as zero, then another formula to accumulate it at detail record level, then another formula to display the variable at the group footer. In other words, I did not bother with the Crystal summary facility at all, but created my own summary facility.
While googling the problem to see what other people did in this situation, I noticed that most fixes used variations of the "shared variables and formulae" fix to get round the problem.
The problem is that I have lots of complex reports and it will take ages to replace the summarised fields with shared variables and formulae. The reports were initially tested with "Print Preview" so we did not notice this problem until the C#.Net application was ready to use them. And I can't believe that you are simply meant to ignore the summary facility and re-invent the wheel by doing it all manually.
Please tell me that there is something simple that I have been doing wrong!!! If I have not given enough information for you to answer, please let me know.
Thanks,
Anne-MarieHi, Anne-Marie;
You may be running into a common issue that is docuemented here:
[SelectionFormula|https://www.sdn.sap.com/irj/servlet/prt/portal/prtroot/com.sap.km.cm.docs/oss_notes_boj/sdn_oss_boj_erq/sap(bD1lbiZjPTAwMQ==)/bc/bsp/spn/scn_bosap/notes%7B6163636573733d36393736354636443646363436353344333933393338323636393736354637333631373036453646373436353733354636453735364436323635373233443330333033303331333233303334333833393335%7D.do]
Regards,
Jonathan
Edited by: Jonathan Parminter on Mar 16, 2009 8:03 AM -
Hello all,
I am getting error while running below sql loader command...
load data
infile *
into TABLE AP_SUPPLIER_SITES_INT
REPLACE
fields terminated by ","
OPTIONALLY ENCLOSED BY '"'
VENDOR_INTERFACE_ID expression "to_char('select VENDOR_INTERFACE_ID from AP_SUPPLIERS_INT where CUSTOMER_NUM=:CUSTOMER_NUM')",
VENDOR_SITE_INTERFACE_ID "to_char(ap_supplier_sites_int_s.NEXTVAL)",
LAST_UPDATE_DATE "SYSDATE",
LAST_UPDATED_BY,
VENDOR_SITE_CODE,
CREATION_DATE "SYSDATE",
CREATED_BY,
PURCHASING_SITE_FLAG,
PAY_SITE_FLAG,
ADDRESS_LINE1,
ADDRESS_LINE2,
ADDRESS_LINE3,
CITY,
STATE,
ZIP,
COUNTRY,
PHONE,
FAX,
PAYMENT_METHOD_LOOKUP_CODE,
TERMS_ID,
CREATE_DEBIT_MEMO_FLAG,
HOLD_UNMATCHED_INVOICES_FLAG,
EMAIL_ADDRESS,
MATCH_OPTION,
EXCLUDE_FREIGHT_FROM_DISCOUNT,
INVOICE_CURRENCY_CODE,
PAYMENT_CURRENCY_CODE,
COUNTRY_OF_ORIGIN_CODE,
FREIGHT_TERMS_LOOKUP_CODE,
PAY_GROUP_LOOKUP_CODE,
PAY_DATE_BASIS_LOOKUP_CODE,
ALWAYS_TAKE_DISC_FLAG,
ORG_ID)
begindata
1005,,SYSDATE,1132,Test MA Site_1,SYSDATE,1132,Y,Y,No#907 62nd Street ,10th Sector,KK Nagar,Chennai,TamilNadu,600078,IN,+91 44 33333333,044 40404040,CHECK,10000,Y,N,[email protected],R,Y,INR,INR,IN,TBD,STANDARD,DISCOUNT,Y,120
Log file:
Table "AP"."AP_SUPPLIER_SITES_INT", loaded from every logical record.
Insert option in effect for this table: REPLACE
Column Name Position Len Term Encl Datatype
VENDOR_INTERFACE_ID EXPRESSION
SQL string for column : "to_char('select VENDOR_INTERFACE_ID from AP_SUPPLIERS_INT where CUSTOMER_NUM=:CUSTOMER_NUM')"
VENDOR_SITE_INTERFACE_ID FIRST * , O(") CHARACTER
SQL string for column : "to_char(ap_supplier_sites_int_s.NEXTVAL)"
LAST_UPDATE_DATE NEXT * , O(") CHARACTER
SQL string for column : "SYSDATE"
LAST_UPDATED_BY NEXT * , O(") CHARACTER
VENDOR_SITE_CODE NEXT * , O(") CHARACTER
CREATION_DATE NEXT * , O(") CHARACTER
SQL string for column : "SYSDATE"
CREATED_BY NEXT * , O(") CHARACTER
PURCHASING_SITE_FLAG NEXT * , O(") CHARACTER
PAY_SITE_FLAG NEXT * , O(") CHARACTER
ADDRESS_LINE1 NEXT * , O(") CHARACTER
ADDRESS_LINE2 NEXT * , O(") CHARACTER
ADDRESS_LINE3 NEXT * , O(") CHARACTER
CITY NEXT * , O(") CHARACTER
STATE NEXT * , O(") CHARACTER
ZIP NEXT * , O(") CHARACTER
COUNTRY NEXT * , O(") CHARACTER
PHONE NEXT * , O(") CHARACTER
FAX NEXT * , O(") CHARACTER
PAYMENT_METHOD_LOOKUP_CODE NEXT * , O(") CHARACTER
TERMS_ID NEXT * , O(") CHARACTER
CREATE_DEBIT_MEMO_FLAG NEXT * , O(") CHARACTER
HOLD_UNMATCHED_INVOICES_FLAG NEXT * , O(") CHARACTER
EMAIL_ADDRESS NEXT * , O(") CHARACTER
MATCH_OPTION NEXT * , O(") CHARACTER
EXCLUDE_FREIGHT_FROM_DISCOUNT NEXT * , O(") CHARACTER
INVOICE_CURRENCY_CODE NEXT * , O(") CHARACTER
PAYMENT_CURRENCY_CODE NEXT * , O(") CHARACTER
COUNTRY_OF_ORIGIN_CODE NEXT * , O(") CHARACTER
FREIGHT_TERMS_LOOKUP_CODE NEXT * , O(") CHARACTER
PAY_GROUP_LOOKUP_CODE NEXT * , O(") CHARACTER
PAY_DATE_BASIS_LOOKUP_CODE NEXT * , O(") CHARACTER
ALWAYS_TAKE_DISC_FLAG NEXT * , O(") CHARACTER
ORG_ID NEXT * , O(") CHARACTER
value used for ROWS parameter changed from 64 to 31
Record 1: Rejected - Error on table "AP"."AP_SUPPLIER_SITES_INT", column VENDOR_INTERFACE_ID.
ORA-01722: invalid number
Please guide me what could be an issue...
Is there any other way to pass function in sql loader..
Thanks and Regards
MuthukumarI created function like below...... retrun value as number
create or replace function VDR_INF_F(V_NUM number)
return number is
VDR_INF_id AP_SUPPLIERS_INT.VENDOR_INTERFACE_ID%type;
begin
select VENDOR_INTERFACE_ID
into VDR_INF_id
from AP_SUPPLIERS_INT
where CUSTOMER_NUM = V_NUM;
return VDR_INF_id;
end;
And attached that into loader program...
load data
infile *
into TABLE AP_SUPPLIER_SITES_INT
REPLACE
fields terminated by ","
OPTIONALLY ENCLOSED BY '"'
VENDOR_SITE_INTERFACE_ID "to_char(ap_supplier_sites_int_s.NEXTVAL)",
LAST_UPDATE_DATE "SYSDATE",
LAST_UPDATED_BY,
VENDOR_SITE_CODE,
CREATION_DATE "SYSDATE",
CREATED_BY,
PURCHASING_SITE_FLAG,
PAY_SITE_FLAG,
ADDRESS_LINE1,
ADDRESS_LINE2,
ADDRESS_LINE3,
CITY,
STATE,
ZIP,
COUNTRY,
PHONE,
FAX,
PAYMENT_METHOD_LOOKUP_CODE,
TERMS_ID,
CREATE_DEBIT_MEMO_FLAG,
HOLD_UNMATCHED_INVOICES_FLAG,
EMAIL_ADDRESS,
MATCH_OPTION,
EXCLUDE_FREIGHT_FROM_DISCOUNT,
INVOICE_CURRENCY_CODE,
PAYMENT_CURRENCY_CODE,
COUNTRY_OF_ORIGIN_CODE,
FREIGHT_TERMS_LOOKUP_CODE,
PAY_GROUP_LOOKUP_CODE,
PAY_DATE_BASIS_LOOKUP_CODE,
ALWAYS_TAKE_DISC_FLAG,
ORG_ID,
VENDOR_INTERFACE_ID expression "VDR_INF_F(':CUSTOMER_NUM')"
begindata
1005,,SYSDATE,1132,Test MA Site_1,SYSDATE,1132,Y,Y,No#907 62nd Street ,10th Sector,KK Nagar,Chennai,TamilNadu,600078,IN,+91 44 33333333,044 40404040,CHECK,10000,Y,N,[email protected],R,Y,INR,INR,IN,TBD,STANDARD,DISCOUNT,Y,120,1005
1005,,SYSDATE,1132,Test MA Site_2,SYSDATE,1132,Y,Y,No#907 62nd Street ,10th Sector,KK Nagar,Chennai,TamilNadu,600078,IN,+91 44 33333333,044 40404040,CHECK,10000,Y,N,[email protected],R,Y,INR,INR,IN,TBD,STANDARD,DISCOUNT,Y,120,1005
1005,,SYSDATE,1132,Test MA Site_3,SYSDATE,1132,Y,Y,No#907 62nd Street ,10th Sector,KK Nagar,Chennai,TamilNadu,600078,IN,+91 44 33333333,044 40404040,CHECK,10000,Y,N,[email protected],R,Y,INR,INR,IN,TBD,STANDARD,DISCOUNT,Y,120,1005
1006,,SYSDATE,1132,Test1 M Site_1,SYSDATE,1132,Y,Y,No#907 62nd Street ,10th Sector,KK Nagar,Chennai,TamilNadu,600078,IN,+91 44 33333333,044 40404040,CHECK,10000,Y,N,[email protected],R,Y,INR,INR,IN,TBD,STANDARD,DISCOUNT,Y,120,1006
1007,,SYSDATE,1132,Test1 B Site_1,SYSDATE,1132,Y,Y,No#907 62nd Street ,10th Sector,KK Nagar,Chennai,TamilNadu,600078,IN,+91 44 33333333,044 40404040,CHECK,10000,Y,N,[email protected],R,Y,INR,INR,IN,TBD,STANDARD,DISCOUNT,Y,120,1007
Even now sql loader giving same error..
like below.....
able "AP"."AP_SUPPLIER_SITES_INT", loaded from every logical record.
Insert option in effect for this table: REPLACE
Column Name Position Len Term Encl Datatype
VENDOR_SITE_INTERFACE_ID FIRST * , O(") CHARACTER
SQL string for column : "to_char(ap_supplier_sites_int_s.NEXTVAL)"
LAST_UPDATE_DATE NEXT * , O(") CHARACTER
SQL string for column : "SYSDATE"
LAST_UPDATED_BY NEXT * , O(") CHARACTER
VENDOR_SITE_CODE NEXT * , O(") CHARACTER
CREATION_DATE NEXT * , O(") CHARACTER
SQL string for column : "SYSDATE"
CREATED_BY NEXT * , O(") CHARACTER
PURCHASING_SITE_FLAG NEXT * , O(") CHARACTER
PAY_SITE_FLAG NEXT * , O(") CHARACTER
ADDRESS_LINE1 NEXT * , O(") CHARACTER
ADDRESS_LINE2 NEXT * , O(") CHARACTER
ADDRESS_LINE3 NEXT * , O(") CHARACTER
CITY NEXT * , O(") CHARACTER
STATE NEXT * , O(") CHARACTER
ZIP NEXT * , O(") CHARACTER
COUNTRY NEXT * , O(") CHARACTER
PHONE NEXT * , O(") CHARACTER
FAX NEXT * , O(") CHARACTER
PAYMENT_METHOD_LOOKUP_CODE NEXT * , O(") CHARACTER
TERMS_ID NEXT * , O(") CHARACTER
CREATE_DEBIT_MEMO_FLAG NEXT * , O(") CHARACTER
HOLD_UNMATCHED_INVOICES_FLAG NEXT * , O(") CHARACTER
EMAIL_ADDRESS NEXT * , O(") CHARACTER
MATCH_OPTION NEXT * , O(") CHARACTER
EXCLUDE_FREIGHT_FROM_DISCOUNT NEXT * , O(") CHARACTER
INVOICE_CURRENCY_CODE NEXT * , O(") CHARACTER
PAYMENT_CURRENCY_CODE NEXT * , O(") CHARACTER
COUNTRY_OF_ORIGIN_CODE NEXT * , O(") CHARACTER
FREIGHT_TERMS_LOOKUP_CODE NEXT * , O(") CHARACTER
PAY_GROUP_LOOKUP_CODE NEXT * , O(") CHARACTER
PAY_DATE_BASIS_LOOKUP_CODE NEXT * , O(") CHARACTER
ALWAYS_TAKE_DISC_FLAG NEXT * , O(") CHARACTER
ORG_ID NEXT * , O(") CHARACTER
VENDOR_INTERFACE_ID EXPRESSION
SQL string for column : "VDR_INF_F(':CUSTOMER_NUM')"
value used for ROWS parameter changed from 64 to 31
Record 1: Rejected - Error on table "AP"."AP_SUPPLIER_SITES_INT", column VENDOR_INTERFACE_ID.
ORA-01722: invalid number
Record 2: Rejected - Error on table "AP"."AP_SUPPLIER_SITES_INT", column VENDOR_INTERFACE_ID.
ORA-01722: invalid number
Record 3: Rejected - Error on table "AP"."AP_SUPPLIER_SITES_INT", column VENDOR_INTERFACE_ID.
ORA-01722: invalid number
Record 4: Rejected - Error on table "AP"."AP_SUPPLIER_SITES_INT", column VENDOR_INTERFACE_ID.
ORA-01722: invalid number
Record 5: Rejected - Error on table "AP"."AP_SUPPLIER_SITES_INT", column VENDOR_INTERFACE_ID.
ORA-01722: invalid number
Please guide me, how to clear this issue?
Thanks and Regards,
Muthu -
ORA-12899 error from function invoked from SQL*Loader
I am getting the above error when I call a function from my SQL*Loader script, and I am not seeing what the problem is. As far as I can see, there should be no problem with the field lengths, unless the length of the automatic variable within my function is somehow being set at 30? Here are the details (in the SQL*Loader script, the field of interest is the last one):
====
Error:
====
Record 1: Rejected - Error on table TESTM8.LET_DRIVE_IN_FCLTY, column DIF_CSA_ID.
ORA-12899: value too large for column "TESTM8"."LET_DRIVE_IN_FCLTY"."DIF_CSA_ID" (actual: 30, maximum: 16)
=======
Function:
=======
CREATE OR REPLACE FUNCTION find_MCO_id (di_oid_in DECIMAL)
RETURN CHAR IS mco_id CHAR;
BEGIN
SELECT AOL_MCO_LOC_CD INTO mco_id
FROM CONV_DI_FLCTY
WHERE DIF_INST_ELMNT_OID = di_oid_in;
RETURN TRIM(mco_id);
END;
==============
SQL*Loader Script:
==============
LOAD DATA
INFILE 'LET_DRIVE_IN_FCLTY.TXT'
BADFILE 'LOGS\LET_DRIVE_IN_FCLTY_BADDATA.TXT'
DISCARDFILE 'LOGS\LET_DRIVE_IN_FCLTY_DISCARDDATA.TXT'
REPLACE
INTO TABLE TESTM8.LET_DRIVE_IN_FCLTY
FIELDS TERMINATED BY '~' OPTIONALLY ENCLOSED BY '"'
DIF_DRIVE_IN_OID DECIMAL EXTERNAL,
DIF_FCLTY_TYPE_OID DECIMAL EXTERNAL NULLIF DIF_FCLTY_TYPE_OID = 'NULL',
DIF_INST_ELMNT_OID DECIMAL EXTERNAL,
DIF_PRI_PERSON_OID DECIMAL EXTERNAL NULLIF DIF_PRI_PERSON_OID = 'NULL',
DIF_SEC_PERSON_OID DECIMAL EXTERNAL NULLIF DIF_SEC_PERSON_OID = 'NULL',
DIF_CREATE_TS TIMESTAMP "yyyy-mm-dd-hh24.mi.ss.ff6",
DIF_LAST_UPDATE_TS TIMESTAMP "yyyy-mm-dd-hh24.mi.ss.ff6",
DIF_ADP_ID CHAR NULLIF DIF_ADP_ID = 'NULL',
DIF_CAT_CLAIMS_IND CHAR,
DIF_CAT_DIF_IND CHAR,
DIF_DAYLT_SAVE_IND CHAR,
DIF_OPEN_PT_TM_IND CHAR,
DIF_CSA_ID CONSTANT "find_MCO_id(:DIF_DRIVE_IN_OID)"
============
Table Definitions:
============
SQL> describe CONV_DI_FLCTY;
Name Null? Type
DIF_INST_ELMNT_OID NOT NULL NUMBER(18)
AOL_MCO_LOC_CD NOT NULL VARCHAR2(3)
SQL> describe LET_DRIVE_IN_FCLTY;
Name Null? Type
DIF_DRIVE_IN_OID NOT NULL NUMBER(18)
DIF_INST_ELMNT_OID NOT NULL NUMBER(18)
DIF_FCLTY_TYPE_OID NUMBER(18)
DIF_ADP_ID VARCHAR2(10)
DIF_CAT_DIF_IND NOT NULL VARCHAR2(1)
DIF_CAT_CLAIMS_IND NOT NULL VARCHAR2(1)
DIF_CSA_ID VARCHAR2(16)
DIF_DAYLT_SAVE_IND NOT NULL VARCHAR2(1)
DIF_ORG_ENTY_ID VARCHAR2(16)
DIF_OPEN_PT_TM_IND NOT NULL VARCHAR2(1)
DIF_CREATE_TS NOT NULL DATE
DIF_LAST_UPDATE_TS NOT NULL DATE
DIF_ITM_FCL_MKT_ID NUMBER(18)
DIF_PRI_PERSON_OID NUMBER(18)
DIF_SEC_PERSON_OID NUMBER(18)
=========================
Thanks for any help with this one!I changed one line of the function to:
RETURN CHAR IS mco_id VARCHAR2(16);
But I still get the same error:
ORA-12899: value too large for column "TESTM8"."LET_DRIVE_IN_FCLTY"."DIF_CSA_ID" (actual: 30, maximum: 16)
I just am not seeing what is being defined as 30 characters. Any ideas much appreciated! -
How to have more than one condition on same column --- using SQL Loader
Hi All,
I am stuck with SQL Loader..
How do I filter records before loading in the table using when clause..
i should load data only when
field1 = 'AC' or 'VC'
field2 is NULL
i used various combinations in when clause like
a) when field1='AC' or field1='VC' and field2 = BLANKS
b) when (field1='AC') and (field2 = BLANKS )
& similar...
In all the cases I tried I could not implement OR condition with field1 and null condition with field2
but my main concern is can we use OR or IS NULL things in when clause of SQL Loader..
is it possible to check this anywhere??
any alternate solution u could suggest??
Thanks
DikshitOk I'll try that, although I did try it earlier when I had iTunes 5.xx loaded, I think.
As to size of playlists, I have a master (900 songs) that defines what will fit onto the ipod , I then generate all the others as subsets of the master (not of the library)- hence I know they will all fit
Can you also clarify something for me: the dialogue box we are discussing is intended, I think, so that one can set the automatic synching of certain playlists between the PC & the ipod. Is that the only way one can select other playlists to go to the ipod - i.e. as static once-offs, not synchronised ?
Apple' docs, I think, are poor in this regard - they assume most ipods are bigger then the users song library and they gloss over the details of this alternate mode of playlist synching.
Thanks - Nick
Maybe you are looking for
-
Open PR & PO migration using LSMW
Hi All, is it possible to migrate open PO & PR using LSMW method. I have already migrated material master by using LSMW( Recording) . but it's not possible to migrate open PR or PO using LSMW recording method. can i use direct input method to uplo
-
[FLASH MX] problem with textfield et numeric variable
hi everyone I want to make an automatic slideshow i ve an editable textfield ("tempo") in wich the user write numbers ... for me this number should be a variable the user can change This value will allow me to deal as a tempo that will load picture e
-
UTLite33.exe wont start
Hi, UTLite33.exe from Campus Manager 3.3 does not want to start, it gives the following: "UTLite33.exe is not a valid Win32 application" Thanks
-
How can I sync my devices with a new computer?
I have just purchased a Macbook Pro and I want to back up my devices and sync them with the new computer. How can I change the set up of my iphone to sync with my new computer instead of the old Dell desktop that I had?
-
Hi folks, I have a requirement in ALV format where the workcenters should be displayed in the first row.. and the corresponding Procurement & setup should be displayed under that corresponding workcenter. WOrk Center