首页 > 数据库 > Oracle > 正文

ORACLE大數据類型的操作之一CLOB

2024-08-29 13:30:40
字体:
来源:转载
供稿:网友

       oracle大數据類型的操作之一clob

作者: ccbzzp


    大家在應用oracle的時候, 可能經常會用到對大數据類型的操作, 在這里我簡單的總結一下, 希望對大家能有所幫助! 也歡迎大家一起來探討, 以便共同進步, 共同發展!
    本文對oracle的高手來說是不用看的.

 1. 如何創建帶有clob類型字段的表?
     create table test2 (aaa clob);

 2. 如何對帶有clob類型字段的表增加記錄?
     insert into test2 values('ccbzzpccbzzp');

 3. 如何select帶有clob類型字段的表?
     select * from test2;
     select * from test2 where dbms_lob.instr(test2.aaa,'b',1,1)>0;

 4. 如何對帶有clob類型字段的表更換表空間?
     alter table  test2 move tablespace users;

 5. 如何exp帶有clob類型字段的表?
     exp user/password file=a.dmp  tables=(test2);

 6. 如何imp帶有clob類型字段的表?
     imp user/password file=a.dmp full=y;

 7. 從哪個版本開始支持clob,blob等大字段?
     8.0

 以上測試環境為oracle92

sql*plus: release 9.2.0.1.0 - production on 星期四 9月 4 12:02:00 2003

copyright (c) 1982, 2002, oracle corporation.  all rights reserved.


連線到:
oracle9i enterprise edition release 9.2.0.1.0 - production
with the partitioning, olap and oracle data mining options
jserver release 9.2.0.1.0 - production

sql> drop table test2;
drop table test2
           *
 error 在行 1:
ora-00942: 表格或視觀表不存在


sql>  create table test2 (aaa clob);

已建立表格.

sql> insert into test2 values('ccbzzpccbzzp');

已建立 1 個資料列.

sql> select * from test2;

aaa
--------------------------------------------------------------------------------
ccbzzpccbzzp

sql> select * from test2 where dbms_lob.instr(test2.aaa,'b',1,1)>0;

aaa
--------------------------------------------------------------------------------
ccbzzpccbzzp

sql> alter table  test2 move tablespace users;

已更改表格.

sql>
 d:> exp test/test file=a.dmp tables=(test2)

......
 
export done in zht16big5 character set and zht16big5 nchar character set
 
about to export specified tables via conventional path ...
. . exporting table                          test2          0 rows exported
export terminated successfully without warnings.

sql> drop table test2;

已刪除表格.

d:> imp test/test file=a.dmp tables=(test2);
 
......
import done in zht16big5 character set and zht16big5 nchar character set
. importing test's objects into test
. . importing table                        "test2"          0 rows imported
import terminated successfully without warnings.


    待續...

 


 
发表评论 共有条评论
用户名: 密码:
验证码: 匿名发表