简体   繁体   中英

LOV query is invalid

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?

Try to create an apex_collection or a database view with your query and then create your lov based on the new object. I too face same kind of difficulties with other queries and I always solved it so.

This happens also if you begin your query using the WITH clause. You can wrap the whole lot up with SELECT name d, ID r From ( your query here )

I see this post is old, but I ran into the same error in the "Lists of Values" portion of the application. My issue happened to be that a grant was missing for the applicaton's run as user.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM