ORACLE SQL, jQuery, and Single-Quotes - Fun?

Condensed demo of the real situation but this shows my issue:
ORACLE SQL likes this statement:
SELECT '<tr><td><a href="javascript:apex.event.trigger(document, ''''editXtra''''}]);void(0);"></a></td></tr>'
from dual;

Open in new window

Output is:
<tr><td><a href="javascript:apex.event.trigger(document, ''editXtra''}]);void(0);"></a></td></tr>

Open in new window

I pass this to the client via dynamic Action (AJAX) but jQuery doesn't like the 2 single-quotes and gives a "Uncaught SyntaxError: missing ) after argument list" error.
$('[summary="SITE"] tr:last').after('<tr><td><a href="javascript:apex.event.trigger(document, ''editXtra''}]);void(0);"></a></td></tr>');

Open in new window

Uncaught SyntaxError: missing ) after argument list

jQuery does like a single-quote escaped \'
$('[summary="SITE"] tr:last').after('<tr><td><a href="javascript:apex.event.trigger(document, \'editXtra\'}]);void(0);"></a></td></tr>');

Open in new window


BUT the way I'm doing it in SQL it gives error:
 
SELECT '<tr><td><a href="javascript:apex.event.trigger(document, \'editXtra\'}]);void(0);"></a></td></tr>'
from dual;
 

Open in new window

ORA-00911: invalid character

I feel like I am missing the obvious.. any ideas?
LVL 2
BILL CarlisleAPEX DeveloperAsked:
Who is Participating?

[Product update] Infrastructure Analysis Tool is now available with Business Accounts.Learn More

x
I wear a lot of hats...

"The solutions and answers provided on Experts Exchange have been extremely helpful to me over the last few years. I wear a lot of hats - Developer, Database Administrator, Help Desk, etc., so I know a lot of things but not a lot about one thing. Experts Exchange gives me answers from people who do know a lot about one thing, in a easy to use platform." -Todd S.

BILL CarlisleAPEX DeveloperAuthor Commented:
Found the answer: (Wish it was called something different since my use has nothing to do with LDAP)
SELECT apex_escape.ldap_dn('<tr><td><a href="javascript:apex.event.trigger(document, ''editXtra''}]);void(0);"></a></td></tr>','''') xx
from dual;

Open in new window

Output:
<tr><td><a href="javascript:apex.event.trigger(document, \'editXtra\'}]);void(0);"></a></td></tr>

Open in new window


LDAP_DN Function

Experts Exchange Solution brought to you by

Your issues matter to us.

Facing a tech roadblock? Get the help and guidance you need from experienced professionals who care. Ask your question anytime, anywhere, with no hassle.

Start your 7-day free trial
It's more than this solution.Get answers and train to solve all your tech problems - anytime, anywhere.Try it for free Edge Out The Competitionfor your dream job with proven skills and certifications.Get started today Stand Outas the employee with proven skills.Start learning today for free Move Your Career Forwardwith certification training in the latest technologies.Start your trial today
SQL

From novice to tech pro — start learning today.