How|How do I move a LONG column from one table to another(zt)
from http://asktom.oracle.com/~tkyte/Misc/MoveLongs.html
Moving LONGS Around
The question "How do I move a LONG column from one table to another" comes up from time to time.The following shows how to use SQLPlus to copy longs from table to table or database to database.Note that this does not work for long raws.There simply are no good solutions for long raws without coding C.
The sql*plus copy command will do it for longs.You need a sql*net connect string that loops back to your local database (not a dblink, a sqlplus connect string, you need to be able to "sqlplus scott/tiger@yourdatabase"...
For example, I just:
【How|How do I move a LONG column from one table to another(zt)】create table foo
( The_Whole_Viewvarchar2(65),
TextLengthnumber,
TheTextLong )
/
which is a table, sort of like all_views (which has a long)...Then I:
SQL> copy from tkyte/tkyte@aria insert foo (the_whole_view, textlength, thetext ) using select owner||'.'||view_name, text_length, text from all_views;
So the sqlplus command transformed the table for me (the columns are not the
same).Also, I could have used a where clause to pick off just some rows.
You'll want to set
set arraysize N -- amount of rows the copy command will copy with each fetch
set long N -- size of your longest long
set copycommit M -- number of fetches to do before commit (N*M rows!!)
in plus before doing this.see the manual for all the options....
来自 “ ITPUB博客 ” ,链接:http://blog.itpub.net/29987/viewspace-51670/,如需转载,请注明出处,否则将追究法律责任。
转载于:http://blog.itpub.net/29987/viewspace-51670/
推荐阅读
- LeetCode(03)Longest|LeetCode(03)Longest Substring Without Repeating Characters
- How|How Fear Works(PartⅡ)
- vue中的条件判断详解v-if|vue中的条件判断详解v-if v-else v-else-if v-show
- 由Uncaught|由Uncaught TypeError: this.player.startMoveAt is not a function引申
- 清晨朗读327(How|清晨朗读327:How Successful People Network with Each Other)
- grep|grep 时 Argument list too long
- vue.js|vue.js window.removeEventListener 移除
- 90天30个TED演讲|90天30个TED演讲 - Day 25: How to get your ideas to spread
- How|How to make tomato and egg noodles.
- jQuery动画