I keep getting the following message every time I try to run this code in oracle. The code is as follows:
DROP TABLE movie;
CREATE TABLE movie (movie_id NUMB
Try Oracle's quoting mechanisms :
The mechanism is invoked with a simple "q" in PL/SQL only.
The syntax is q'[...]', where the "[" and "]" characters can be any of the following as long as they do not already appear in the string.
•!
•[ ]
•{ }
•( )
•< >
Here For Example ,
INSERT INTO movie (movie_id, title, description, released_by, released_on)
VALUES('4', 'Godzilla', q'[The legendary tale of Godzilla comes roaring back to
life. This time, it's the modern era, and Godzilla is a giant lizard who has
been made fearsome through the interference of radiation.]', '1', '16-SEP-
2014');
It's always headache to find all single quotes and replace it with escape character.
For more Reference Follow : THIS
My solution try:
<br>
pelicula = array("titulo"=>"it's the modern era");
<br>
and insert this array.
INSERT(%%%,pelicula["titulo"],%%%).
Explicacion: Para evitar el problema de la comilla, copia la cadena a un array, inserta el nombre a traves de este array y el problema se acaba.
Escape single quotes:
INSERT INTO movie (movie_id, title, description, released_by, released_on)VALUES('4', 'Godzilla', 'The legendary tale of Godzilla comes roaring back to life. This time, it''s the modern era, and Godzilla is a giant lizard who has been made fearsome through the interference of radiation.', '1', '16-SEP-2014');
Notice the it''s
instead of it's
.