2015-05-11 63 views
0

我有一個ctl文件使用sqlldr,但表達式的長度大於258,並且是我可以在查詢中獲得的最小長度,這對我來說是不可能的。少字符。oracle sql loader表達式的最大大小

我CTL是:

OPTIONS (PARALLEL=TRUE, SILENT=(HEADER,FEEDBACK), ERRORS=1000000) 
LOAD DATA 
INFILE 'file.csv' 
--BADFILE 'file.bad' 
APPEND INTO TABLE table1 
FIELDS TERMINATED BY "|" 
TRAILING NULLCOLS 
(
    id_user CONSTANT 2, 
    number_user , 
    FULL_TIMESTAMP date "YYYY-MM-DD HH24:MI:SS", 
    id_date , 
    id_time , 
    pn BOUNDFILLER, 
    service_name EXPRESSION "select service_name from pack_table where service_name in (select service_name from table_2 where id_number in (select id_number from table_3 WHERE id_user=2 and (id_date between to_char(to_date(:id_date,'YYYYMMDD')-1,'YYYYMMDD') and :id_date) and number_user= :number_user))", 
    bill_response , 
    joined CONSTANT 0 
) 

甲骨文說我是一個表達式的最大長度爲258 =(

我不能改變表的柱的側向承載力名

我的想法是使用其他表達BOUNDFILLER,但它不適用於我='(

OPTIONS (PARALLEL=TRUE, SILENT=(HEADER,FEEDBACK), ERRORS=1000000) 
LOAD DATA 
INFILE '_INFILE_' 
--BADFILE '_INFILE_.bad' 
APPEND INTO TABLE table1 
FIELDS TERMINATED BY "|" 
TRAILING NULLCOLS 
(
    id_user CONSTANT _MNO_, 
    number_user , 
    FULL_TIMESTAMP date "YYYY-MM-DD HH24:MI:SS", 
    id_date , 
    id_time , 
    pn BOUNDFILLER, 
    ic "select id_number from (select id_number from table_3 WHERE id_user=2 and (id_date between to_char(to_date(:id_date,'YYYYMMDD')-1,'YYYYMMDD') and :id_date) and number_user= :number_user order by id_date asc) where rownum=1" BOUNDFILLER, 
    service_name EXPRESSION "select service_name from pack_table where service_name in (select service_name from table_2 where id_number = :ic)", 
    bill_response , 
    joined CONSTANT 0 
) 

我不知道我能做什麼。

誰能幫幫我?

感謝

回答

1

移動select語句的功能和使用select myfunction(params) from dual代替