Home » SQL & PL/SQL » Client Tools » query for select and update (oracle Database 10g)
query for select and update [message #617525] Tue, 01 July 2014 04:54 Go to next message
furqan
Messages: 112
Registered: January 2012
Location: Hyderabad
Senior Member
Respected Sirs

i have a column value in a table 'C C&R'.
when i am trying to select and update column value using sql query,
not able to do so.

my query is

SELECT * FROM <tablename> WHERE <columnname>='C C&R';
above query not getting executed.first time i came across such column values.
please help.
thanks.
Re: query for select and update [message #617526 is a reply to message #617525] Tue, 01 July 2014 04:57 Go to previous messageGo to next message
Lalit Kumar B
Messages: 2405
Registered: May 2013
Location: World Wide on the Web
Senior Member
In SQL*Plus :

set define off;
Re: query for select and update [message #617528 is a reply to message #617526] Tue, 01 July 2014 05:03 Go to previous messageGo to next message
furqan
Messages: 112
Registered: January 2012
Location: Hyderabad
Senior Member
thank you very much sir for your quick and correct response and answer
grateful to you..thanks again.
Re: query for select and update [message #617530 is a reply to message #617528] Tue, 01 July 2014 05:29 Go to previous messageGo to next message
Lalit Kumar B
Messages: 2405
Registered: May 2013
Location: World Wide on the Web
Senior Member
Or another way :

SQL> WITH DATA AS(
  2  SELECT 'C C&' || 'R' t FROM DUAL)
  3  SELECT * FROM DATA WHERE t='C C&' || 'R';
T
-----
C C&R
Re: query for select and update [message #617531 is a reply to message #617530] Tue, 01 July 2014 05:37 Go to previous messageGo to next message
Michel Cadot
Messages: 59276
Registered: March 2007
Location: Nanterre, France, http://...
Senior Member
Account Moderator

Or:
SQL> SELECT 'C C'||chr(38)||'R' from dual;
'CC'|
-----
C C&R

Re: query for select and update [message #617545 is a reply to message #617531] Tue, 01 July 2014 07:51 Go to previous message
Lalit Kumar B
Messages: 2405
Registered: May 2013
Location: World Wide on the Web
Senior Member
Or one more way :

SQL> set escape;
ESCAPE character is \

SQL> set scan off;
SQL> 
SQL> WITH DATA AS(
  2  SELECT 'CC&R' t FROM DUAL)
  3  SELECT * FROM DATA WHERE t='CC&R';
T
----
CC&R
Previous Topic: Unable to see database list in dropdown of pl/sql developer
Next Topic: Issue in connecting from SQL Developer 3.2
Goto Forum:
  


Current Time: Tue Sep 30 11:38:47 CDT 2014

Total time taken to generate the page: 0.05703 seconds