Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations gkittelson on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

SQL*Plus Woes -- Column magically disappears!

Status
Not open for further replies.

alg

MIS
Jul 17, 2002
2
CA
OK....anyone know why a column that exists in a table as shown by a describe would not appear in a select?

Notice the "NAME" column in the describe magically dissappears from the select output....

ORA8> desc lr_agency;
Name Null? Type
--------------------- -------- ----------------------------
ID NOT NULL NUMBER(8)
NAME NOT NULL VARCHAR2(80)
ADDRESS_ID NOT NULL NUMBER(8)
PHONE NOT NULL VARCHAR2(25)
FAX VARCHAR2(25)
ACCOUNT_EXECUTIVE_ID NOT NULL NUMBER(8)
URL VARCHAR2(255)
STATUS_CODE NOT NULL NUMBER(8)
LAST_MODIFIED NOT NULL DATE
LAST_MODIFIER_ID NOT NULL NUMBER(8)
CREATOR_ID NOT NULL NUMBER(8)
TIMESTAMP NOT NULL DATE
PARENT NUMBER(8)

ORA8> select * from lr_agency where id = 1;

ID ADDRESS_ID PHONE FAX
--------- ---------- ------------------------- -------------------------
ACCOUNT_EXECUTIVE_ID
--------------------
URL
--------------------------------------------------------------------------------
STATUS_CODE LAST_MODI LAST_MODIFIER_ID CREATOR_ID TIMESTAMP PARENT
----------- --------- ---------------- ---------- --------- ---------
1 111 Undefined
111

111 14-AUG-01 111 111 14-AUG-01 111


ORA8>
 
How about manually putting the NAME column in your select?

ORA8> select id, name from lr_agency where id = 1;

If you encounter an error such as,
ERROR at line 1:
ORA-00904: invalid column name

Then, the object that you maybe describing is not the same as in the select. Check for the object type, schema owners for this table. Find if views or synonyms with the same name exist.
 
The possible cause is that some previous script contained

COLUMN NAME NOPRINT

Issue

CLEAR COLUMNS

before running your query
 
sem....You are a genius!!!! (Shouldn't restarting SQLPLUS automatically clear any NOPRINT commands issued? It apparently does not.)

Thank you!

Al
 
Check your login.sql/glogin.sql files. Some genius may have hardcoded the NOPRINT in as a "convenience".
 
Yes, Carp is right. Sql*Plus clears all columns (to be more precise it doesn't store them), but run glogin.sql every time you connect to database. As a general advice try to avoid such names, because they are often used by others and sometimes become reserved ones (VALUE is the example).

P.S.
No, Carp, it was not me :)
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top