Results 1 to 4 of 4
  1. #1
    Join Date
    Sep 2003
    Posts
    19

    Unanswered: Oracle Query - Strange Error

    Hi Guys,

    I am new to oracle but not to the SQL world. On the oracle SQL*PLUS

    i tried the below 3 queries

    1. SELECT table_name, column_name from all_tab_columns;

    It gave me all the table and column names

    2. SELECT column_name from all_tab_columns WHERE table_name='MEASUREMENT';

    It gave me all the column names under table MEASUREMENT

    now comes the strange thing

    3. SELECT NENAME from MEASUREMENT;

    NENAME was one of the column names displayed in query 2

    I GET the following ERROR:
    ORA-00942: table or view does not exist

    IS NOT THAT STRANGE?

    Any suggestions...

  2. #2
    Join Date
    Aug 2003
    Location
    Where the Surf Meets the Turf @Del Mar, CA
    Posts
    7,776
    Provided Answers: 1
    >IS NOT THAT STRANGE?
    No, not strange, normal.
    I suspect the table MEASUREMENT is owned by a user other than the one you are logged in as.
    SELECT NENAME from <OTHER_USER>.MEASUREMENT;
    will work once you determine who owns table MEASUREMENT or
    SELECT NENAME from MEASUREMENT;
    will work after you login as the owner or MEASUREMENT.
    You can lead some folks to knowledge, but you can not make them think.
    The average person thinks he's above average!
    For most folks, they don't know, what they don't know.
    Good judgement comes from experience. Experience comes from bad judgement.

  3. #3
    Join Date
    Sep 2003
    Posts
    19
    Thanks for the prompt reply...i will look into this.

  4. #4
    Join Date
    Jan 2004
    Posts
    492
    If do :

    Code:
    SELECT owner, table_name, column_name from all_tab_columns where table_name='MEASUREMENT'
    You will see who the owner is - and as Anacedent suggested, if you try this query, you probably will not see the table show up, showing that you are not the owner.

    Code:
    Select table_name, column_name from user_tab_columns
    Oracle OCPI (Certified Practicing Idiot)

Posting Permissions

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