Oracle FAQ Your Portal to the Oracle Knowledge Grid
HOME | ASK QUESTION | ADD INFO | SEARCH | E-MAIL US
 

Home -> Community -> Mailing Lists -> Oracle-L -> & symbol in PL/SQL

& symbol in PL/SQL

From: Hand, Michael T <HANDM_at_polaroid.com>
Date: Wed, 11 Aug 2004 13:01:01 -0400
Message-ID: <1357B9FD14F9D41187800008C7A47B350336A5F9@corpa1.polaroid.com>

I don't write much PL/SQL as so it took many years before I ran into this one. Pardon me is this is well known. Tested in 7.3.4 \& 9iR2

SQL> show define
define "&" (hex 26)

SQL> -- Comment line with & symbol in it

SQL> declare
  2 c varchar2(1);
  3 begin
  4 select 'R' into c from dual;
  5 -- comment line with a & symbol in it   6 -- comment line with a \& symbol escaped   7 dbms_output.put_line(c);
  8 end;
  9 /
Enter value for symbol: e
old 5: -- comment line with a & symbol in it new 5: -- comment line with a e in it
R

PL/SQL procedure successfully completed.

Why does the PL/SQL parser interpret the define symbol before comment delimeters? So one can't comment out a line of PL/SQL code containing a & without also using the escape? And worst of all, I can't use the & as shorthand for AND in my embedded comments. Open a TAR. Call out the National Guard.

Mike Hand
Polaroid Corp.

--

This transmission is intended only for use by the addressee(s) named herein and may contain information that is proprietary, confidential and/or legally privileged. If you are not the intended recipient, you are hereby notified that any disclosure, copying, distribution, or use of the information contained herein (including any reliance thereon) is STRICTLY PROHIBITED. If you received this transmission in error, please immediately contact the sender and destroy the material in its entirety, whether in electronic or hard copy format. Thank you.



Please see the official ORACLE-L FAQ: http://www.orafaq.com

To unsubscribe send email to: oracle-l-request_at_freelists.org put 'unsubscribe' in the subject line.
--

Archives are at http://www.freelists.org/archives/oracle-l/ FAQ is at http://www.freelists.org/help/fom-serve/cache/1.html
Received on Wed Aug 11 2004 - 11:57:46 CDT

Original text of this message

HOME | ASK QUESTION | ADD INFO | SEARCH | E-MAIL US