What would be the oracle equivalent of the following?
I've tried
and the result is
from the SQLPlus worksheet.
What would I be doing wrong?
-----------------------------------
"Programming today is a race between software engineers striving to build bigger and better idiot-proof programs, and the Universe trying to produce bigger and better idiots. So far, the Universe is winning." - Rich Cook
Code:
if exists (select * from dbo.sysindexes where name='myindex_idx' and id=Object_id('dbo.mytable'))
drop index dbo.mytable.myindex_idx
go
Code:
if exists(select * from user_objects where object_type = 'INDEX' and object_name = 'mytable_myindex_idx')
drop index mytable_myindex_idx
end if;
Code:
SP2-0734: unknown command beginning "if exists(..." - rest of line ignored.
end if
*
ERROR at line 2:
ORA-00933: SQL command not properly ended
What would I be doing wrong?
-----------------------------------
"Programming today is a race between software engineers striving to build bigger and better idiot-proof programs, and the Universe trying to produce bigger and better idiots. So far, the Universe is winning." - Rich Cook