How can I escape these apostrophes?

SQL> create table emp_dtl
  2  (empid number,
  3  empdesc varchar2(500)
  4  );

Table created.

insert into emp_dtl values (99,'Quick learner');
When I try to do the next update, I get the following error.
SQL> insert into emp_dtl values (99,'Quick learner');

1 row created.

SQL> commit;

Commit complete.

SQL> update emp_dtl set empdesc = 'This employe has got  'Tremondous' and 'Admirable' potential'
  2   where emp_id=99
  3  /
update emp_dtl set empdesc = 'This employe has got  'Tremondous' and 'Admirable' potential'
                                                      *
ERROR at line 1:
ORA-00933: SQL command not properly ended
How do I escape the single massive and Admirable quote (do understand that these single quotes are literals in oracle)

You can escape quotes in a string by using double quotes (2 apostrophes):

update emp_dtl
set empdesc = 'This employe has got ''Tremondous'' and ''Admirable'' potential'
where emp_id=99;

Tags: Database

Similar Questions

Maybe you are looking for