ITPub博客

首页 > Linux操作系统 > Linux操作系统 > external table

external table

原创 Linux操作系统 作者:yhj20041128001 时间:2011-09-29 09:30:11 0 删除 编辑
SQL>grant create any directory to scott;
SQL>connec scott/tiger;
SQL>create directory mydir as '/tmp/test';

Put the data.txt in above directory.
1,Tom,90,20090420
2,Jack,85,20090418

SQL>create table score(sno number(10),sname varchar2(10),score number(3),sdate date)
organization external(type oracle_loader default directory mydir
access parameters(records delimited by newline fields terminated by ',' (sno char,sname char,score char,sdate char date_format date mask "yyyymmdd"))
location ('data.txt')) reject limit unlimited;

SQL>select * from score;

[oracle@nascds8 etc]$ df | awk 'BEGIN {OFS="|";}{print $1,$2,$3,$4,$5,$6}'

来自 “ ITPUB博客 ” ,链接:https://blog.itpub.net/23757700/viewspace-708484/ ,如需转载,请注明出处,否则将追究法律责任。

请登录后发表评论 登录
全部评论

注册时间:2010-09-17

  • 博文量
    174
  • 访问量
    390261