Results 1 to 3 of 3
  1. #1
    Join Date
    Mar 2004
    Posts
    11

    Unanswered: dropping table in Oracle9i

    Hi,
    I need to check whether a table exists and if so, I need to drop it.
    I tried
    create or replace table table_name(..........)

    but it does not work.


    Thanx in advance,

  2. #2
    Join Date
    Jan 2004
    Location
    India
    Posts
    191
    Hi,

    try this

    Sql> desc table_name;

    if table exists it will show details about the table else it will say table does not exists.

    "Create or replace" can not be used for table creation . It is only used for stored subprograms, triggers etc etc

    Thanks,
    Pagnint
    (No need to search web before posting new question)

  3. #3
    Join Date
    Mar 2004
    Posts
    11
    Hi,
    I need to write the code for checking the existence of the table_name in a sql file :

    if table_name exists
    then drop table_name;
    create table table_name


    How do I incorporate "desc table_name" in the code. or is there some way to check the error and then going ahead?

    Thanks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •