Click to See Complete Forum and Search --> : views & order by


ocpdude
11-08-2000, 11:07 AM
I am trying to create a view using a select statment
which has order by clause. I keep getting this message
ORA-00933: SQL command not properly ended.
if I take out order by from the select it works fine.
Any Idea on how to do create views with order by??
thanks in advance

omegamark
11-08-2000, 11:32 AM
No in views you can give order by

ocpdude
11-08-2000, 01:17 PM
here is the statment I am using

SQL> ed
Wrote file afiedt.buf

1 create or replace view test_v as
2 select obl_num from obl
3* order by obl_num
SQL> /
order by obl_num
*
ERROR at line 3:
ORA-00933: SQL command not properly ended

[Edited by ocpdude on 11-08-2000 at 02:09 PM]

ganesh
11-08-2000, 06:18 PM
While u r editing , make sure that the script ends with /
i.e in ur edit file
it should be like

create or replace view test_v as
select obl_num from obl
order by obl_num
/


Hope it helps..

Anna
11-08-2000, 09:12 PM
You cannot create view with order by clause. Oracle does not support this.

akkerend
11-09-2000, 04:25 PM
Oracel supports order by in views in Oracle 8i.

omegamark
11-09-2000, 04:51 PM
Thanks !

yes it works in 8i .I just tried it...