Search code examples
sqloracle-databaseoracle-apexoracle-apex-5

Page Items and Variables


SELECT
    t.*,
    t.rowid
FROM
    table.column t
WHERE
    fullorderno LIKE SUBSTR('${ORD}$',1,8) || '%' 

When I run this SQL query using DB visualizer it shows up a popup dialog for me to key in the ORD value but when I use this with Oracle-APEX and change the query to be this where I change the variable to the page item number it doesn't return a value. The region I am running this SQL query at in APEX is a classic report and page item is P12_NUM

SELECT
    t.*,
    t.rowid
FROM
    table.column t
WHERE
    fullorderno LIKE SUBSTR('${:p12_num}$',1,8) || '%' 

Solution

  • Wouldn't that be as simple as

    ... WHERE fullorderno LIKE SUBSTR(:P12_NUM, 1, 8) || '%'