高分悬赏

jill_yang 2000-07-26 12:41:00
如何把LONG型数据从一个库中的一个表,导入到另一个库中的一个表
...全文
214 8 打赏 收藏 转发到动态 举报
写回复
用AI写文章
8 条回复
切换为时间正序
请发表友善的回复…
发表回复
Tyro 2000-07-26
  • 打赏
  • 举报
回复
太简略了吧,怎么也该说得详细点呀!
zzh 2000-07-26
  • 打赏
  • 举报
回复
最简单的方法就是复制粘贴了,当然,如果你想写程序,编一段代码也可以啊。
Tommy Chang 2000-07-26
  • 打赏
  • 举报
回复
Within a single SQL statement, all LONG columns, updated tables, and locked tables must be located on the same database.

这是官方文档找到的,连oracle都希望你放弃long,转成lob
全文如下:

LONG Datatype
LONG columns store variable-length character strings containing up to 2 gigabytes, or 231-1 bytes. LONG columns have many of the characteristics of VARCHAR2 columns. You can use LONG columns to store long text strings. The length of LONG values may be limited by the memory available on your computer.


--------------------------------------------------------------------------------
Note:
Oracle Corporation strongly recommends that you convert LONG columns to LOB columns. LOB columns are subject to far fewer restrictions than LONG columns. For more information, see "TO_LOB".

--------------------------------------------------------------------------------




You can reference LONG columns in SQL statements in these places:

SELECT lists

SET clauses of UPDATE statements

VALUES clauses of INSERT statements

The use of LONG values is subject to some restrictions:

A table cannot contain more than one LONG column.

You cannot create an object type with a LONG attribute.

LONG columns cannot appear in integrity constraints (except for NULL and NOT NULL constraints).

LONG columns cannot be indexed.

A stored function cannot return a LONG value.

Within a single SQL statement, all LONG columns, updated tables, and locked tables must be located on the same database.

LONG columns cannot appear in certain parts of SQL statements:

WHERE clauses, GROUP BY clauses, ORDER BY clauses, or CONNECT BY clauses or with the DISTINCT operator in SELECT statements

The UNIQUE operator of a SELECT statement

The column list of a CREATE CLUSTER statement

The CLUSTER clause of a CREATE MATERIALIZED VIEW statement

SQL functions (such as SUBSTR or INSTR)

Expressions or conditions

SELECT lists of queries containing GROUP BY clauses

SELECT lists of subqueries or queries combined by set operators

SELECT lists of CREATE TABLE ... AS SELECT statements

SELECT lists in subqueries in INSERT statements

Triggers can use the LONG datatype in the following manner:

A SQL statement within a trigger can insert data into a LONG column.

If data from a LONG column can be converted to a constrained datatype (such as CHAR and VARCHAR2), a LONG column can be referenced in a SQL statement within a trigger.

Variables in triggers cannot be declared using the LONG datatype.

:NEW and :OLD cannot be used with LONG columns.

You can use the Oracle Call Interface functions to retrieve a portion of a LONG value from the database. See Oracle Call Interface Programmer's Guide.

guostong 2000-07-26
  • 打赏
  • 举报
回复
ORACLE的包可以做,给分的话可以给你源代码
jill_yang 2000-07-26
  • 打赏
  • 举报
回复
但对LONG型这样做,ORACLE认为是非法操作,在ORACLE中不支持对LONG型这种操作
haihong 2000-07-26
  • 打赏
  • 举报
回复
huntout这样是不行的。
应该用copy解决
copy from usr/pwd@db to usr/pwd@db insert table2 (name) using select name from table1
huntout 2000-07-26
  • 打赏
  • 举报
回复
select name into databse2..table2 from database1..table1
jill_yang 2000-07-26
  • 打赏
  • 举报
回复
比如TABLE1中有个字段NAME是LONG型,TABLE2里有个字段NAME,要将TABLE1中的NAME的数据导入到TABLE2的NAME中去,如何办?

34,588

社区成员

发帖
与我相关
我的任务
社区描述
MS-SQL Server相关内容讨论专区
社区管理员
  • 基础类社区
  • 二月十六
  • 卖水果的net
加入社区
  • 近7日
  • 近30日
  • 至今
社区公告
暂无公告

试试用AI创作助手写篇文章吧