Home » SQL & PL/SQL » SQL & PL/SQL » string leteral updation (Oracle 11g xp)
string leteral updation [message #607805] Wed, 12 February 2014 03:50 Go to next message
sunilreddy
Messages: 37
Registered: September 2011
Location: Hyderabad
Member
Hi All,
i want to execute the below statement in plsql code , can any one help me on this.

UPDATE emp
SET instruction = 'Don't go away, we'll get back to you'
where emp_id = 'Sunil';

when this statement comes to execute geting invalid sql statement exception. please help me on this.
Re: string leteral updation [message #607807 is a reply to message #607805] Wed, 12 February 2014 03:53 Go to previous messageGo to next message
gazzag
Messages: 1118
Registered: November 2010
Location: Bedwas, UK
Senior Member
EXECUTE IMMEDIATE

HTH
-g
Re: string leteral updation [message #607808 is a reply to message #607807] Wed, 12 February 2014 03:55 Go to previous messageGo to next message
sunilreddy
Messages: 37
Registered: September 2011
Location: Hyderabad
Member
That whole statement i had taken into one string and used executeimmediate then only i got that error.
Re: string leteral updation [message #607809 is a reply to message #607808] Wed, 12 February 2014 03:58 Go to previous messageGo to next message
gazzag
Messages: 1118
Registered: November 2010
Location: Bedwas, UK
Senior Member
Can you show us what you've done, please? Copy and Paste your SQL*Plus session.
Re: string leteral updation [message #607810 is a reply to message #607805] Wed, 12 February 2014 03:58 Go to previous message
Littlefoot
Messages: 21807
Registered: June 2005
Location: Croatia, Europe
Senior Member
Account Moderator
It is about "we'll" which is located within single quotes (that terminate the whole sentence). There are a few options to fix it, such as
SQL> SELECT
  2    'we''ll'                  two_single_quotes,
  3     q'[we'll]'               quoting_character_literals,
  4     'we' || chr(39) ||'ll'   single_quote_CHR
  5  FROM DUAL;

TWO_S QUOTI SINGL
----- ----- -----
we'll we'll we'll

SQL>


Pick one.

[Updated on: Wed, 12 February 2014 03:58]

Report message to a moderator

Previous Topic: Sorting data in Nested table
Next Topic: Oracle SQL help needed
Goto Forum:
  


Current Time: Fri Apr 19 05:02:33 CDT 2024