在 Oracle APEX PL/SQL 中传递变量
我正在 APEX 中构建一个简单的应用程序。我的其中一个页面是一份报告,对于区域源,我有一些实现此效果的代码。我收到的错误消息
ORA-00904: "var_out": invalid identifier
本质上是变量 :form_variable 来自搜索框,我可以将其传递到查询字符串中(即将“variable”替换为“:form_variable”,但我想将其传递到首先使用函数并将输出放入字符串中,我确信这很简单,但我无法弄清楚该怎么做,
DECLARE
variable VARCHAR2(10);
query VARCHAR2(1000);
-- Where var_out is an output
BEGIN
myfunction(:form_variable, var_out);
variable := var_out;
query := 'SELECT * FROM TABLE WHERE column = variable';
RETURN query;
END;
谢谢。
I'm building a simple application in APEX. One of my pages is a report and for the region source I have some code to this effect. The error message I'm receiving is
ORA-00904: "var_out": invalid identifier
Essentially the variable :form_variable is coming from a search box, and I can pass that into the query string fine (i.e. replacing "variable" with ":form_variable", but I want to pass it into a function first and put that output into the string instead. I'm sure this is something simple but for the life of me I can't work out what to do.
DECLARE
variable VARCHAR2(10);
query VARCHAR2(1000);
-- Where var_out is an output
BEGIN
myfunction(:form_variable, var_out);
variable := var_out;
query := 'SELECT * FROM TABLE WHERE column = variable';
RETURN query;
END;
Thanks
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
您需要在声明块中声明输出变量
var_out
。此外,您的查询字符串在您的示例中没有进行任何替换。如果您的过程 myfunction 输出清理了该变量,您可以将其连接起来。
You need to declare your out variable,
var_out
, in your declaration block.Also, your query string is not doing any replacement in your example. You could concatenate it if your procedure myfunction output cleans the variable.