Skip to Main Content

APEX

Announcement

For appeals, questions and feedback about Oracle Forums, please email oracle-forums-moderators_us@oracle.com. Technical questions should be asked in the appropriate category. Thank you!

Interested in getting your voice heard by members of the Developer Marketing team at Oracle? Check out this post for AppDev or this post for AI focus group information.

Button with URL Redirect - Single Quote Bug

trentFeb 10 2011 — edited Mar 3 2011
Hi,

Not really sure if you are going to consider this a bug or not, but anywhoo, just ran into this issue.

The situation:

Page items on a page that are computed to some values
Button to redirect to another page, passing the values for page items

The issue:

For a button redirect, a javascript redirect is called, where the underlying URL is enclosed in single quotes. All fine, until your page item contains a single quote. As the function is expecting it to be the end of the function parameter, when it is not.

Demo:

http://apex.oracle.com/pls/apex/f?p=23834:500

Page 500

One item. P500_GYM_NAME
Default value - SQL Query: select 'Barry''s Fitness Shop' from dual
Button created as outlined above (to page 501).

Workaround:

When populating the values, escape the single quote. i.e. select replace(column_name, '''', '\''') column_name from table; or replace the sing quote using the URL (percent) encoding for a single quote (%27) as outlined here: http://en.wikipedia.org/wiki/Percent-encoding#Percent-encoding_reserved_characters (preferred method, imo) i.e. select replace(column_name, '''', '%27') column_name from table

..

So, would be good if support was added to encode a single quote character when constructing the URL.

That is all,

Thanks,
Trent
Comments
Locked Post
New comments cannot be posted to this locked post.
Post Details
Locked on Mar 31 2011
Added on Feb 10 2011
1 comment
526 views