在过程中创建表时出错 [英] error while creating table in procedure

查看:105
本文介绍了在过程中创建表时出错的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

HI 我想创建一个可以在其中创建表的过程.
所以我已经做到了

HI i want to create a procedure in which i can create a table.
so i have done this

CREATE OR REPLACE PROCEDURE test_proc

BEGIN
execute immediate 'CREATE TABLE ABC_TABLE AS SELECT * FROM XYZ_TABLE WHERE 1=0';
END;



但是编译后出现以下错误.


当期望以下情况之一时遇到符号"BEGIN":(;使用已编译的包装外部确定性parallel_enable流水线将authid作为簇压缩顺序使用符号"is"代替"BEGIN"继续.


谁能告诉我这样做的原因以及如何在过程中创建表.

在此先感谢...



but after compiling i get following error.


Encountered the symbol "BEGIN" when expecting one of the following: ( ; is with authid as cluster compress order using compiled wrapped external deterministic parallel_enable pipelined The symbol "is" was substituted for "BEGIN" to continue.


can any one tell me reason for this and how to create the table in procedure.

thanks in advance...

推荐答案

在此过程中是否有创建表的特定原因?我认为您应该只在过程外部创建一次表,然后在过程中使用它.

这是选择进入的示例..

http://www.mkyong.com/oracle/oracle-stored-procedure-select -into-example/ [ ^ ]
Is there any specific reason to create table in the procedure? I think you should create table only once outside your procedure and then use it in your procedure.

here is an example of select into..

http://www.mkyong.com/oracle/oracle-stored-procedure-select-into-example/[^]


我认为您的语法不正确,请参考以下链接以获取一些想法


http://www.dbforums.com/ansi-sql/681463- storage-procedure-create-table-variable.html [ ^ ]

http://forums.devx.com/showthread.php?t=17250 [ ^ ]


http://social.msdn.microsoft.com /forums/en-US/transactsql/thread/d176f436-6433-4ac0-89d8-e28477759ee5/ [
I think your syntax is not correct please refer the following links to get some idea


http://www.dbforums.com/ansi-sql/681463-stored-procedure-create-table-variable.html[^]

http://forums.devx.com/showthread.php?t=17250[^]


http://social.msdn.microsoft.com/forums/en-US/transactsql/thread/d176f436-6433-4ac0-89d8-e28477759ee5/[^]


这篇关于在过程中创建表时出错的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆