Avatar of BILL Carlisle
BILL CarlisleFlag for United States of America

asked on 

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?
jQuerySQL

Avatar of undefined
Last Comment
BILL Carlisle
ASKER CERTIFIED SOLUTION
Avatar of BILL Carlisle
BILL Carlisle
Flag of United States of America image

Blurred text
THIS SOLUTION IS ONLY AVAILABLE TO MEMBERS.
View this solution by signing up for a free trial.
Members can start a 7-Day free trial and enjoy unlimited access to the platform.
See Pricing Options
Start Free Trial
SQL
SQL

SQL (Structured Query Language) is designed to be used in conjunction with relational database products as of a means of working with sets of data. SQL consists of data definition, data manipulation, and procedural elements. Its scope includes data insert, query, update and delete, schema creation and modification, and data access control.

61K
Questions
--
Followers
--
Top Experts
Get a personalized solution from industry experts
Ask the experts
Read over 600 more reviews

TRUSTED BY

IBM logoIntel logoMicrosoft logoUbisoft logoSAP logo
Qualcomm logoCitrix Systems logoWorkday logoErnst & Young logo
High performer badgeUsers love us badge
LinkedIn logoFacebook logoX logoInstagram logoTikTok logoYouTube logo