这个存储过程正确吗? [英] is this stored procedure is correct ?
本文介绍了这个存储过程正确吗?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
大家好,
我在oracle中编写一个存储过程,但未创建.
Hi all,
i am writing one stored procedure in oracle but it''s not creating.
CREATE OR REPLACE PROCEDURE procPrintHelloWorld
IS
BEGIN
select * from vikash;
END;
execute procedure procprinthelloworld;
在创建该语句时出现错误
以及如何执行此操作?
请帮助我.
while creating it''s giving error on this statement
and how to execute this?
please help me.
推荐答案
您的过程对于SQL Server是正确的.但这在oracle中是完全错误的..
因为oracle不能直接从过程中返回行,所以我们必须使用SYS_REFCURSOR ..
有关oracle过程的详细信息,请查看以下链接.
http://docs.oracle.com/cd/B19306_01/server.102/b14200/statements_6009.htm [ ^ ]
Your procedure is correct for SQL server. but it is totaly wrong in oracle..
because oracle not directly returns row from procedure for that we have to use SYS_REFCURSOR..
for oracle procedure details have a look on below links.
http://docs.oracle.com/cd/B19306_01/server.102/b14200/statements_6009.htm[^]
http://www.oracle-base.com/articles/misc/using-ref-cursors-to-return-recordsets.php[^]
这篇关于这个存储过程正确吗?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文