Apex – Column Linking with data that includes commas
February 5, 2008
You want to define a link between one page an another via a report column. Everything works great until you try a link where the source column value includes a comma, like:
Smith, Fred, A.
Then the link doesn’t work!
I found the answer in the Oracle Apex forum. This is documented in the 3.0 User Guide under itemValues as:
To pass a comma in an item value, enclose the characters
with backslashes. For example:
\123,45\
You need to put ‘\’ (backslash, not slash) on both sides of the column value you’re passing, simple as that. You don’t need to change the query on the receiving end at all.
Forum user Chet Justice even wrote up a sample query:
SELECT my_column_with_commas, –use this one to display
‘\’ || my_column_with_commas || ‘\’ my_commas –user this one for the link
FROM table_with_columns_of_commas;
Then change your column link to pass the my_commas value.
Piece of cake, once you know!
May 20, 2008 at 4:44 pm
Hey Stewstryker,
This tip helped 🙂 Do you have any pointers on how I can pass ampersands (&) in item values? I have a select list with names of companies, like “ABC & Sons” and I need to pass these values into a page item.
Any help appreciated.
May 20, 2008 at 10:13 pm
Gauri,
I guess I’d try it as you presented it & amp ;. What happens when you try that? You’d need to decode it with a calculation on the receiving end.
Another idea that comes to mind would be to encode it to some other character sequence before passing then decode after passing.
January 28, 2016 at 7:31 am
Perfect – Thank you!
in column link I now have: \#LINK_TO_MAP#\ and this works perfectly.
May 3, 2017 at 11:59 pm
only when i put \ (backslash) in url link-value, it works perfectly. thanks.
Example: \#report_column#\
January 29, 2018 at 8:36 am
You saved my day!