Oracle FAQ | Your Portal to the Oracle Knowledge Grid |
Home -> Community -> Usenet -> c.d.o.server -> Re: PL/SQL question
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;
for x in ( select variance from t ) loop *
ops$tkyte_at_8i> begin
2 for x in ( select "VARIANCE" from t ) loop 3 dbms_output.put_line( x.variance ); 4 end loop;
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