For most purposes there is no difference. There are a few cases where it does matter though.
In the "must be is corner", we have:
Explicit cursorsdeclare
cursor c as select * from dual;
begin
null;
end;
/
PLS-00103: Encountered the symbol "AS" when expecting one of the following:
PL/SQL array typesSQL> declare
2 type typ as table of pls_integer;
3 begin
4 null;
5 end;
6 /
type typ as table of pls_integer;
*
ERROR at line 2:
ORA-06550: line 2, column 15:
PLS-00103: Encountered the symbol "TABLE" when expecting one of the following:
object opaque
Though this only applies in PL/SQL. SQL nested tables can use either:
SQL> create or replace type typ as object (x int);
2 /
Type created.
SQL> create or replace type typ_arr as table of typ;
2 /
Type created.
SQL> create or replace type typ_arr2 is table of typ;
2 /
Type created.
-----
And in the "must be as" corner we have:
Create table as selectIt's implied in the name - you can't "create table is select"!
SQL> create table t is
2 select rownum x from dual;
create table t is
*
ERROR at line 1:
ORA-00922: missing or invalid option
Materialized ViewsSQL> create materialized view mv is
2 select 1 n from dual;
create materialized view mv is
*
ERROR at line 1:
ORA-00905: missing keyword
Standard ViewsSQL> create or replace view v is
2 select 1 n from dual;
create or replace view v is
*
ERROR at line 1:
ORA-00905: missing keyword
DirectoriesSQL> create or replace directory dir is '/tmp';
create or replace directory dir is '/tmp'
*
ERROR at line 1:
ORA-00905: missing keyword
PS - thanks for using LiveSQL!