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

Home -> Community -> Usenet -> c.d.o.server -> Re: PL/SQL question

Re: PL/SQL question

From: Thomas Kyte <tkyte_at_us.oracle.com>
Date: Fri, 04 Feb 2000 19:58:25 -0500
Message-ID: <nbtm9skkngp67sfj9kn85m9prflcj6dmba@4ax.com>


A copy of this was sent to stuarti <stuirvineNOstSPAM_at_hotmail.com.invalid> (if that email address didn't require changing) On Fri, 04 Feb 2000 12:49:54 -0800, you wrote:

>I have a column in a table called "variance" (the same as the
>function) when I try to select the column into a variable in a
>PL/SQL block I get a compile error because PL/SQL is expecting
>a "(" because variance is a function name.
>
>Does anybody have any suggestions on how to get around this,
>other than recreating the table. (I did not create the table)
>
>Stuart
>
>
>

Use quoted identifiers. Here is an example showing it failing and then succeeding:

ops$tkyte_at_8i> create table t ( variance int );

Table created.

ops$tkyte_at_8i>
ops$tkyte_at_8i> begin

  2          for x in ( select variance from t ) loop
  3                  dbms_output.put_line( x.variance );
  4          end loop;

  5 end;
  6 /
        for x in ( select variance from t ) loop
                                   *

ERROR at line 2:
ORA-06550: line 2, column 29:
PLS-00103: Encountered the symbol "FROM" when expecting one of the following: (

ops$tkyte_at_8i> begin

  2          for x in ( select "VARIANCE" from t ) loop
  3                  dbms_output.put_line( x.variance );
  4          end loop;

  5 end;
  6 /

PL/SQL procedure successfully completed.

When using quoted identifiers -- case matters -- upper

>
>
>
>* Sent from RemarQ http://www.remarq.com The Internet's Discussion Network *
>The fastest and easiest way to search and participate in Usenet - Free!

--
See http://osi.oracle.com/~tkyte/ for my columns 'Digging-in to Oracle8i'... Current article is "Part I of V, Autonomous Transactions" updated June 21'st  

Thomas Kyte                   tkyte_at_us.oracle.com
Oracle Service Industries     Reston, VA   USA

Opinions are mine and do not necessarily reflect those of Oracle Corporation Received on Fri Feb 04 2000 - 18:58:25 CST

Original text of this message

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