通过SQL语句向Oracle数据库导入外部表和内部表

SQL语句在数据库建外部表导入数据库

通过以下语句对SQL建表进行操作,如下:

create table TDL_测试
(
  field1 VARCHAR2(200),
  field2 VARCHAR2(200),
field3 VARCHAR2(200),
field4 VARCHAR2(200),
  field5 VARCHAR2(200),
field6 VARCHAR2(200),
field7 VARCHAR2(200),
  field8 VARCHAR2(200),
field9 VARCHAR2(200),
field10 VARCHAR2(200),
  Field11 VARCHAR2(200),
Field12 VARCHAR2(200)
)
organization external
(
  type ORACLE_LOADER
  default directory MINE
  access parameters 
  (
    records delimited by newline NOBADFILE  NOLOGFILE fields terminated by X'09' missing field values are null
  )
  location (MINE:'测试.txt')
)
reject limit 0;

SQL语句在数据库建内部表

create table 测试2
(
  filed1   VARCHAR2(200),
  filed2 VARCHAR2(200),
  filed3   VARCHAR2(200),
filed4  VARCHAR2(200),
filed5  VARCHAR2(200)
)
tablespace USERS
  pctfree 10
  initrans 1
  maxtrans 255
  storage
  (
    initial 64K
    next 1M
    minextents 1
    maxextents unlimited
  );

猜你喜欢

转载自blog.csdn.net/tandelin/article/details/88630029
今日推荐