infile * 不能和str屬性連用

perfychi發表於2012-10-30
[oracle@yitai ~]$ sqlplus scott/oracle

SQL*Plus: Release 10.2.0.4.0 - Production on Tue Oct 30 14:19:09 2012

Copyright (c) 1982, 2007, Oracle.  All Rights Reserved.


Connected to:
Oracle Database 10g Enterprise Edition Release 10.2.0.4.0 - Production
With the Partitioning, OLAP, Data Mining and Real Application Testing options

SQL> desc test;
 Name                                      Null?    Type
 ----------------------------------------- -------- ----------------------------
 ID                                                 VARCHAR2(10)
 AGE                                                VARCHAR2(10)
 USERNAME                                           VARCHAR2(10)

[oracle@yitai ~]$ vi test.ctl

load data
infile *   "str x'2a2a0a'"
truncate into table test
fields terminated by ','
(
id ,
age  ,
username
)
1,24,Jack**
2,25,Tom**
3,26,Jane**


[oracle@yitai ~]$ sqlldr scott/oracle control=test.ctl

SQL*Loader: Release 10.2.0.4.0 - Production on Tue Oct 30 14:19:50 2012

Copyright (c) 1982, 2007, Oracle.  All rights reserved.

SQL*Loader-283: file processing string "str x'2a2a0a'" ignored for INFILE *
SQL*Loader-350: Syntax error at line 10.
Expecting keyword INTO or keyword BEGINDATA, found "1".
1,24,Jack**
^

根據測試結果:控制檔案test.ctl裡infile * 不能和str屬性連用。

來自 “ ITPUB部落格 ” ,連結:http://blog.itpub.net/27042095/viewspace-747932/,如需轉載,請註明出處,否則將追究法律責任。

相關文章