sql loader ¹¤¾ßËü¿ÉÒÔ°ÑһЩÒÔÎı¾¸ñʽ´æ·ÅµÄÊý¾Ý˳ÀûµÄµ¼Èëµ½oracleÊý¾Ý¿âÖУ¬ÊÇÒ»ÖÖÔÚ²»Í¬Êý¾Ý¿âÖ®¼ä½øÐÐÊý¾ÝǨÒƵķdz£·½±ã¶øÇÒͨÓõŤ¾ß¡£È±µã¾ÍËٶȱȽÏÂý£¬ÁíÍâ¶ÔblobµÈÀàÐ͵ÄÊý¾ÝÓеãÂé·³¡£
ÔÚDOCÏÂÃæÊäÈ룺sqlldr userid=user/password@sid control=result.ctl
Àý×Ó:
SQLLDR USERID=zero/zero@ORACLE CONTROL=d:£Ütest£Ücon.ctl log=D:£Ütest£Ülog£ÜSE004.log
Ò»¡¢¿ØÖÆÎļþд·¨
LOAD DATA
INFILE 'input_File.csv’
BADFILE 'C:\test\WMCOUNTRY.BAD'
DISCARDFILE 'C:\test\WMCOUNTRY.DSC'
INTO TABLE tableName
FIELDS TERMINATED BY ","
(field1,field2,field3,field4)
½âÊÍ£º
1¡¢infileÖ¸Êý¾ÝÔ´ÎļþÕâÀïÎÒÃÇÊ¡ÂÔÁËĬÈϵÄdiscardfile¡¢result.dsc¡¢badfile¡¢result.bad¡£
2¡¢into table tableName ĬÈÏÊÇINSERT£¬Ò²¿ÉÒÔ APPEND into table tableName Ϊ׷¼Ó·½Ê½£¬»òREPLACE
×¢Ò⣺
1¡¢insert£¬ /****Ϊȱʡ·½Ê½£¬ÔÚÊý¾Ý×°ÔØ¿ªÊ¼Ê±ÒªÇó±íΪ¿Õ****/
2¡¢append£¬ /****ÔÚ±íÖÐ×·¼ÓмǼ****/
3¡¢replace£¬ /****ɾ³ý¾É¼Ç¼£¬Ìæ»»³ÉÐÂ×°ÔصļǼ****/
4¡¢truncate£¬ /****ͬÉÏ****/
terminated by ',' /****Ö¸ÓöººÅ·Ö¸ô****/
terminated by whitespace¡¡ /****½áβÒÔ¿Õ°×·Ö¸ô****/
fields terminated by X'09'¡¡¡¡/****×Ö¶ÎÖÕÖ¹ÓÚX'09'£¬ÊÇÒ»¸öÖƱí·û£¨TAB£©****/
tableName£º /****Êý¾Ý±í****/
(field1,field2,field3,field4)£º/****Êý¾Ý±íµ¼Èë×Ö¶Î****/
×¢Ò⣺Èç¹ûµ±infile *ʱ£¬µ¼ÈëÊý¾Ý¾ÍÔÚ¿ØÖÆÎļþÖУ¬Àý×Ó£º
È磺
LOAD DATA
INFILE *
APPEND INTO TABLE tableName
FIELDS TERMINATED BY "," Optionally enclosed by '"'
(field1,field2,field3,field4)
BEGINDATA
field1_data,field2_data,field3_data,field4_data
field1_data,field2_data,field3_data,field4_data
field1_data,field2_data,field3_data,field4_data
×¢:"*" ´ú±íÊý¾ÝÎļþÓë´ËÎļþͬÃû£¬¼´ÔÚºóÃæʹÓÃBEGINDATA¶ÎÀ´±êʶÊý¾Ý
¶þ¡¢Àý×Ó
¿ØÖÆÎļþ£º
Ò»¸ö¿ØÖÆÃüÁîµÄ½Å±¾Îļþ£¬Í¨³£Ò