Database Administration (MOSC)

MOSC Banner

Columns in SUB-Select are not correctly checked, when parsing Select- or Update-statement

edited Aug 6, 2010 6:02AM in Database Administration (MOSC) 3 commentsAnswered
Columns in SUB-Select are not correctly checked,  when parsing Select- or Update-statement. (see below)
The problem can easily be reproduced with the tables "emp", "salgrade" from the SQLPlus demonstration tables.
(script demobld.sql in the ORACLE_HOME/sqlplus/demo directory )

1)  Description of the used tables;

SQL> desc emp
Name                                                  Null?    Type
----------------------------------------------------- -------- ------------------------------------
EMPNO                                                 NOT NULL NUMBER(4)
ENAME                                                          VARCHAR2(10)
JOB                                                            VARCHAR2(9)
MGR                                                            NUMBER(4)
HIREDATE                                                       DATE
SAL                                                            NUMBER(7,2)
COMM                                                           NUMBER(7,2)
DEPTNO                                                         NUMBER(2)


SQL> desc salgrade
Name                                                  Null?    Type
----------------------------------------------------- -------- ------------------------------------
GRADE                                                          NUMBER
LOSAL                                                          NUMBER
HISAL                                                          NUMBER

2) Select-Statement with Sub-Select:

select * from emp where empno in (select empno from salgrade) ;

Howdy, Stranger!

Log In

To view full details, sign in to My Oracle Support Community.

Register

Don't have a My Oracle Support Community account? Click here to get started.

Category Leaderboard

Top contributors this month

New to My Oracle Support Community? Visit our Welcome Center

MOSC Help Center