Oracle FAQ | Your Portal to the Oracle Knowledge Grid |
Home -> Community -> Usenet -> c.d.o.server -> Re: Ignore ORA 942 Error
Louis Frolio wrote:
> nmdavies1104_at_hotmail.com (Neil) wrote in message
> news:<caef6318.0410120207.4ae42d2a_at_posting.google.com>...
>> I have a unix script that includes a DROP TABLE and CREATE TABLE >> command in SQL Plus.it works fine if the table to drop is there. If >> not the script ends. Can anyone advise how I can ignore the >> "ORA-00942: table or view does not exist" error and continue to the >> next command?
You mean run something like
SPOOL DROPEM.SQL
SELECT 'DROP TABLE '|| table_name || ' CASCADE;'
FROM USER_TABLES
WHERE TABLE_NAME IN ('A', 'B', 'C')
/
SPOOL OFF
@DROPEM
at the beginning of the unix script? (with appropriate SQLPLus settings and
column formatting as described in the manual) and then running all the
creates <g>
/Hans Received on Tue Oct 12 2004 - 10:08:49 CDT