暂无图片
暂无图片
暂无图片
暂无图片
暂无图片

Can Oracle prompt the user for input from a procedure ?

2011-01-01
695

The Oracle (tm) Users' Co-Operative FAQ

Can Oracle prompt the user for input from a procedure?


Author's name: Keith_Jamieson

Author's Email: Keih_Jamieson@hotmail.com

Date written: 22 Sep 2003

Oracle version(s): 9.2.0.1.0

There have been several questions in the newsgroups requesting how to go about this, and certainly, you cannot do this with pure PLSQL but we can work around the problem. There have been several questions in the newsgroups requesting how to go about this, and certainly, you cannot do this with pure PLSQL but we can work around the problem.


Firstly, while it is possible to request a prompt from a user, by calling an external procedure or Java Stored Procedure, it is a very bad idea, as it can end up leaving a transaction or a piece of PL/SQL code waiting for ever.  It should never be implemented in a production environment.  So why would you want to do this then. Well, typically to test your procedure, feed in different values and determine different execution paths.

 

OK, so how do you do it then.  The answer is you call an executable piece of code, eg a JAVA Stored Procedure which calls some Java Code or an external procedure(In whichever 3GL is supported on your system, eg C. The executable will then prompt you.  Typically, you could use Java to prompt for a value, return this to the Java Stored Procedure, which would inturn return to the calling PL/SQL module.


Further reading: External procedures, Java Stored Procedures



最后修改时间:2020-04-16 15:12:47
【版权声明】本文为墨天轮用户原创内容,转载时必须标注文章的来源(墨天轮),文章链接,文章作者等基本信息,否则作者和墨天轮有权追究责任。如果您发现墨天轮中有涉嫌抄袭或者侵权的内容,欢迎发送邮件至:contact@modb.pro进行举报,并提供相关证据,一经查实,墨天轮将立刻删除相关内容。

评论