在具有外部嵌入式视图的select中,当(1:5)要求绑定变量时加载

问题描述 投票:0回答:1

我在SQL Developer中没有找到打开绑定的开关:

我创建了一个csv文件:

    declare  
       v_file utl_file.file_type;
    begin  
       v_file := utl_file.fopen('DATA_FILE_DIR', 'example2.csv', 'W');
       utl_file.put_line(v_file, 'colid|colstring|colnumber|coldate');  
       utl_file.put_line(v_file, '1|"nothing"|231.12|2019-01-03 23:43:32');
       utl_file.put_line(v_file, '2|"not more"|121|2020-10-05 14:33:15');
       utl_file.FFLUSH(v_file);  
       utl_file.fclose(v_file);  
    end;

我想以内联选择方式阅读:

select c_001,c_002, c_003, c_004 from external
((   c_001 varchar2(200)
   , c_002 varchar2(200)
   , c_003 varchar2(200)
   , c_004 varchar2(200)
     )
    TYPE oracle_loader
    default directory DATA_FILE_DIR
    access parameters (
         RECORDS DELIMITED BY newline
         load when (1:5) != 'colid'
         LOGFILE DATA_FILE_DIR:'inline_ext_tab_%a_%p.log'
         FIELDS CSV WITH EMBEDDED TERMINATED BY '|' OPTIONALLY ENCLOSED BY '"'
         MISSING FIELD VALUES ARE NULL(
             c_001
           , c_002
           , c_003 
           , c_004 
         )
    )
    location ('example2.csv')
    reject limit unlimited
    )

我得到的问题是load when (1:5) != 'colid'要求绑定替换。

set define off;
set escape off;

对我来说没有帮助。有什么想法可以防止这种行为吗?由于错误29420254没有选项,因此使用跳过1。

oracle oracle-sqldeveloper sql-loader
1个回答
0
投票

您还必须使用:将扫描设为关闭

告诉sqlplus不要扫描':'

© www.soinside.com 2019 - 2024. All rights reserved.