Home » SQL & PL/SQL » Client Tools » Comment on Column with & symbol (Oracle 11.1 / AIX)
Comment on Column with & symbol [message #562314] Tue, 31 July 2012 05:17 Go to next message
sbmk_design
Messages: 86
Registered: April 2007
Location: CHENNAI
Member
Hi,
I wanted to Comment on Column with & symbol. Can u pls correct the syntax

Syntax
SQL> comment on column scott.emp.empname is ' Jerry&Tom. ' ;

ERROR
Enter value for t:
SP2-0546: User requested Interrupt or EOF detected.

Thanks in advance
sbmk
Re: Comment on Column with & symbol [message #562320 is a reply to message #562314] Tue, 31 July 2012 05:27 Go to previous messageGo to next message
Littlefoot
Messages: 19526
Registered: June 2005
Location: Croatia, Europe
Senior Member
Account Moderator
SET DEFINE OFF, maybe (either in SQL*Plus or in a tool you use)?
SQL> create table test (col varchar2(20));

Table created.

SQL> set define off
SQL>
SQL> comment on column test.col is 'Tom & Jerry';

Comment created.

SQL> select * from user_col_comments where table_name = 'TEST';

TABLE_NAME      COLUMN_NAME                    COMMENTS
--------------- ------------------------------ ------------------------------
TEST            COL                            Tom & Jerry

SQL>
Re: Comment on Column with & symbol [message #565258 is a reply to message #562320] Sun, 02 September 2012 07:06 Go to previous messageGo to next message
rvijayaragavan86
Messages: 6
Registered: September 2012
Location: Bangalore
Junior Member
You could also use
SET ESCAPE '\'

or
SET SCAN OFF
Re: Comment on Column with & symbol [message #565308 is a reply to message #565258] Mon, 03 September 2012 06:17 Go to previous messageGo to next message
cookiemonster
Messages: 10929
Registered: September 2008
Location: Rainy Manchester
Senior Member
rvijayaragavan86 wrote on Sun, 02 September 2012 13:06
You could also use
SET ESCAPE '\'

Maybe you should try that before posting it. It doesn't work.
Re: Comment on Column with & symbol [message #565310 is a reply to message #565308] Mon, 03 September 2012 06:34 Go to previous messageGo to next message
rvijayaragavan86
Messages: 6
Registered: September 2012
Location: Bangalore
Junior Member
forgot to mention. After setting the below, escape the & with \ as below:

set Escape '\'

comment on column hr.t.y is 'TOM \& Jerry';

It worked in my hr schema table T with a column name Y
Re: Comment on Column with & symbol [message #565313 is a reply to message #565310] Mon, 03 September 2012 06:41 Go to previous message
Michel Cadot
Messages: 58938
Registered: March 2007
Location: Nanterre, France, http://...
Senior Member
Account Moderator
It is better to show your test than to tell it:
SQL> set Escape '\'
SQL> comment on column t.id is 'TOM \& Jerry';

Comment created.

then we are sure there is no error in your test and it fits what you say, and it is easier to follow.

Regards
Michel

[Updated on: Mon, 03 September 2012 06:42]

Report message to a moderator

Previous Topic: Splitting a column into multiple columns
Next Topic: view SQL*Plus generated *.csv on iPhone (iOS) with default app. Howto modify *.csv?
Goto Forum:
  


Current Time: Sat Aug 30 08:12:05 CDT 2014

Total time taken to generate the page: 0.05224 seconds