Home » SQL & PL/SQL » SQL & PL/SQL » SELECT INTO causes ORA-00905 Error
SELECT INTO causes ORA-00905 Error [message #608435] Wed, 19 February 2014 11:57 Go to next message
Uncle_Jake
Messages: 2
Registered: February 2014
Location: Home
Junior Member
This statement returns data:

SELECT s.actual_enrollment --into attendance
FROM ODSMGR.MST_MEETING_TIME t, odsmgr.mst_course_offering s, saturn.slbrdef b
where t.course_reference_number = s.course_reference_number
and b.slbrdef_room_number = t.room

This statement returns the ol' ORA-00905 Error Missing Keyword. Why? The only difference between the two is commenting out the "into" clause. Why is this happening?

SELECT s.actual_enrollment into attendance
FROM ODSMGR.MST_MEETING_TIME t, odsmgr.mst_course_offering s, saturn.slbrdef b
where t.course_reference_number = s.course_reference_number
and b.slbrdef_room_number = t.room
Re: SELECT INTO causes ORA-00905 Error [message #608436 is a reply to message #608435] Wed, 19 February 2014 12:19 Go to previous messageGo to next message
BlackSwan
Messages: 26766
Registered: January 2009
Location: SoCal
Senior Member
when SELECT statement resides inside PL/SQL procedure, it must be told to where the results should returned (INTO clause).
PL/SQL runs deep inside the database engine & has no direct contact with any CRT/display device associated with the client (as in client/server architect).

when SELECT is invoked via some client like sqlplus or sqldeveloper the results can simply be projected on the direct attached device.

Please read and follow the forum guidelines, to enable us to help you:

http://www.orafaq.com/forum/t/88153/0/
Re: SELECT INTO causes ORA-00905 Error [message #608447 is a reply to message #608435] Wed, 19 February 2014 13:29 Go to previous message
John Watson
Messages: 8931
Registered: January 2010
Location: Global Village
Senior Member
orclz>
orclz> select dummy into v from dual;
select dummy into v from dual
                  *
ERROR at line 1:
ORA-00905: missing keyword


orclz> select dummy into :v from dual;

D
-
X

orclz>

Previous Topic: Value multiplication help
Next Topic: Unique/check constraint on two columns
Goto Forum:
  


Current Time: Thu Apr 25 15:20:10 CDT 2024