Results 1 to 6 of 6
  1. #1
    Join Date
    Oct 2009
    Posts
    5

    Question Unanswered: Check if tables exists in the database

    Hi,

    Do we have any inbuilt oracle plsql function which can be directly used to check whether the <table name> passed to the function exists in the database or not.

    Plz quote some example to demonstrate the usage.

    Thanks !!

  2. #2
    Join Date
    Oct 2009
    Posts
    6
    What about: SELECT COUNT(*) FROM ALL_TABLES WHERE TABLE_NAME = '<TableName>'?

  3. #3
    Join Date
    Oct 2009
    Posts
    5
    Thanks !!

    Actually I am looking for an inbuilt plsql function, to which I will just pass the table name and result will be returned as true or false.

  4. #4
    Join Date
    Jun 2004
    Location
    Liverpool, NY USA
    Posts
    2,509
    Then make the select into a function.
    Bill
    You do not need a parachute to skydive. You only need a parachute to skydive twice.

  5. #5
    Join Date
    Oct 2009
    Posts
    5
    Thanks !! select into worked ........

  6. #6
    Join Date
    Dec 2007
    Location
    Richmond, VA
    Posts
    1,328
    Provided Answers: 5
    If your proc is going to be querying the tablename that was passed in, don't bother checking to see if it exists, just run your query and get a table not found.
    Dave

Posting Permissions

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