2

I am working with APEX 4.2.1.00.08 and I keep getting the validation error "LOV query is invalid, a display and a return value are needed, the column names need to be different. If your query contains an in-line query, the first FROM clause in the SQL statement must not belong to the in-line query.". I'm not sure what's causing this. My sql is:

SELECT u1.name d, susu.subunitid r
FROM basic.subunitsuperunit susu
INNER JOIN basic.unit u1 ON susu.subunitid = u1.unitid
INNER JOIN basic.unit u2 ON susu.superunitid = u2.unitid
WHERE level = 3
AND u1.name != 'XYZ'
CONNECT BY PRIOR subunitid = superunitid
START WITH u1.name = (SELECT u3.name FROM basic.unit u3 WHERE u3.unitid = (SELECT TO_NUMBER(gp.value) FROM basic.global_parameters gp WHERE gp.name = 'A_UNIT'))
ORDER BY u1.name

I have made sure there was no semicolon, and I have checked this query in SQL Developer and it runs fine. I already realize those subqueries aren't optimal, but what am I doing wrong here?

4

3 回答 3

1

尝试使用您的查询创建一个 apex_collection 或数据库视图,然后根据新对象创建您的 lov。我在其他查询中也面临同样的困难,我总是这样解决。

于 2013-02-14T12:49:14.473 回答
0

如果您使用 WITH 子句开始查询,也会发生这种情况。你可以用 SELECT name d, ID r From (your query here)

于 2013-04-27T09:33:59.807 回答
0

我看到这篇文章很旧,但我在应用程序的“值列表”部分遇到了同样的错误。我的问题恰好是应用程序以用户身份运行时缺少授权。

于 2017-11-02T22:24:29.347 回答