甲骨文:LONG RAW 到?

发布于 2024-08-11 05:45:43 字数 531 浏览 1 评论 0原文

我正在用java编写一个程序,我需要创建一个表的副本(没有数据)。为此,我使用以下查询,

CREATE TABLE NEW_TABLE AS
SELECT * FROM OLD_TABLE

我遇到了一个表,其中一列的数据类型为LONG RAW,该类型已被废弃。

我尝试使用下面的查询,但它不起作用。 (ORA-01003:未解析任何语句 )

CREATE TABLE NEW_TABLE AS
SELECT ID, COL1, COL2, TO_LOB(COL3) FROM OLD_TABLE

有人可以告诉我一个简单的查询吗?它应该能够存储上一个表中的值。我正在使用 oracle 10g

提前致谢。

编辑:

抱歉,这是我的错误,上面的查询工作正常,但我调用的是 executeQuery 而不是 executeUpdate

I am writing a program in java where I need to create a copy of a table (without data). for that I am using the following query

CREATE TABLE NEW_TABLE AS
SELECT * FROM OLD_TABLE

I have come across a table where one of the columns has the data type LONG RAW which is depricated.

I tried using the query below but it did not work. (ORA-01003: no statement parsed
)

CREATE TABLE NEW_TABLE AS
SELECT ID, COL1, COL2, TO_LOB(COL3) FROM OLD_TABLE

Can someone tell me a simple query for this. It should be able to store the values from the previous table. I am using oracle 10g

Thanks in advance.

EDIT:

Sorry it was my mistake, the above query worked fine but I was calling executeQuery instead of executeUpdate

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(2

枯寂 2024-08-18 05:45:43

也许此讨论会有所帮助。

Perhaps this discussion would help.

久光 2024-08-18 05:45:43

抱歉,这是我的错误,上面的查询工作正常,但我调用的是 executeQuery 而不是 executeUpdate,后者抛出了 SQLException

Sorry it was my mistake, the above query worked fine but I was calling executeQuery instead of executeUpdate which was throwing an SQLException

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文