I am trying to get the cards report view working with Oracle Apex, but due to a bug mentioned in this SO question I am trying to work with a query that is parsed at runtime.
"Use Generic Column Names (parse query at runtime only)" is selected for the query.
Unfortunately the cards view requires the right column headers to work. Here is my code:
DECLARE
l_query VARCHAR2(4000);
l_app number := v('APP_ID');
l_session number := v('APP_SESSION');
--Bug happens on the ':11:' part, page 1 works fine
l_url VARCHAR2(500) := (APEX_UTIL.PREPARE_URL(
p_url => 'f?p=' || l_app || ':11:' || l_session || '::NO:::'
));
BEGIN
l_query:=
'SELECT
post_id,
user_id as "CARD_SUBTEXT",
image as "CARD_IMAGE",
title as "CARD_TITLE",
''' || l_url || ''' as "CARD_LINK",
text as "CARD_TEXT"
FROM posts';
IF v('P1_TEXT_SEARCH') IS NOT NULL THEN
l_query := l_query||' '||'
WHERE
(
CONTAINS(title, ''$' || :P10_TEXT_SEARCH || ''') > 0
) OR
(
CONTAINS(text, ''$' || :P10_TEXT_SEARCH || ''') > 0
)
';
END IF;
htp.p(l_query);
RETURN l_query;
END;
Which looks like the following:
Any ideas how I can get this to work?
#CARD_TEXT#
etc. to#COL01#
etc. as appropriate in the new template? – Tony Andrews