Monday, November 3, 2008

Double Quoted Identifiers

Reserved words not alloewed to be declare as an Identifiers. But it is allowed when identifiers are sorrounded by Double quatotion(") mark. When you enclose quatotion mark by double quote the that Identifier becomes case sensitive.

Example:
10:59:03 SQL> ed
Wrote file afiedt.buf
1 declare

2 "select" varchar2(20) := 'select * from emp;';
3 begin
4 dbms_output.put_line("select");
5* end;
11:01:42 SQL> /
select * from emp;
PL/SQL procedure successfully completed.
Elapsed: 00:00:00.0311:01:43


See Another Example:

SQL> ed
Wrote file afiedt.buf
1 declare

2 "select" varchar2(20) := 'select * from emp;';
3 begin 4 dbms_output.put_line("Select"); -- Note S in 'Select' is in Upper Case.
5* end;
11:03:34 SQL> /
dbms_output.put_line("Select");
*
ERROR at line 4:ORA-06550: line 4,
column 23:PLS-00201: identifier 'Select' must be declaredORA-06550: line 4,
column 2:PL/SQL: Statement ignored
Elapsed: 00:00:00.04

11:03:35 SQL>

No comments: