尝试分配和使用过程中的变量时,无法安全重播调用
我正在尝试将来自一个表中的列中的数据用作另一个表的列别名。
DECLARE
var1 VARCHAR(20),
var2 VARCHAR(20);
BEGIN
WITH
TABLE1 AS (SELECT ROWNUM RN, * FROM TABLE)
,A1 AS (SELECT TO_CHAR(VALUE) INTO var1 FROM TABLE1 WHERE RN = 1)
,A2 AS (SELECT TO_CHAR(VALUE) INTO var2 FROM TABLE1 WHERE RN = 2)
SELECT
COL1 AS var1,
COL2 AS var2
FROM TABLE2;
END;
/
显然,这是我的实际过程的简化版本,但是我有机会获得一些帮助来理解为什么我从中收到以下错误:
ORA-25408:无法安全重播呼叫
,建议也非常欢迎!
I am trying use the data from a column in one table as column aliases of another table.
DECLARE
var1 VARCHAR(20),
var2 VARCHAR(20);
BEGIN
WITH
TABLE1 AS (SELECT ROWNUM RN, * FROM TABLE)
,A1 AS (SELECT TO_CHAR(VALUE) INTO var1 FROM TABLE1 WHERE RN = 1)
,A2 AS (SELECT TO_CHAR(VALUE) INTO var2 FROM TABLE1 WHERE RN = 2)
SELECT
COL1 AS var1,
COL2 AS var2
FROM TABLE2;
END;
/
This is obviously a simplified version of my actual procedure, but is there a chance I can get some help in understanding why I am receiving the following error from this:
ORA-25408: can not safely replay call
If there is an easier way to go about this task to begin with, suggestions are more than welcome as well!
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
您的查询不会给出该错误。
;
而不是,表
是一种用于表收集表达式而不是标识符的关键字对于桌子。*
与其他列一起使用,而无需将其与表别名前缀。pl/sql:ora-01744:不适当地从
Oracle 12中> 中,您可以从表格
code> table_name <的表中选择第一个和第二个值/code>使用:
但是,您通常还会使用子句的
顺序,而不是按照数据文件读取的任何顺序来订购
条款。db&lt;&gt;&gt;
Your query does not give that error.
;
and not,
TABLE
is a keyword used for table collection expressions and not for an identifier for a table.*
with other columns without prefixing it with a table alias.PL/SQL: ORA-01744: inappropriate INTO
From Oracle 12, you can select the first and second values from a table with the name
TABLE_NAME
into the variables using:However, you would normally also use an
ORDER BY
clause rather than taking the rows in whatever order they are read from the data files.db<>fiddle here