Skip to Main Content

SQL & PL/SQL

Announcement

For appeals, questions and feedback about Oracle Forums, please email oracle-forums-moderators_us@oracle.com. Technical questions should be asked in the appropriate category. Thank you!

Interested in getting your voice heard by members of the Developer Marketing team at Oracle? Check out this post for AppDev or this post for AI focus group information.

INTO clause expected in SELECT statement

738256Dec 2 2009 — edited Dec 2 2009
Hi all,
I have this pl sql code that errors out:an INTO clause is expected in this SELECT statement.
Code
Declare
prev_col1 FLOAT(10) := 0;
temp3 temp2%rowtype;
Begin
select * from
(
select col1, col2, col3,
lag(col1,1,0) over(order by rownum) prev_col1
from temp2 where <conditions here> order by col2
)
where col1- prev_col1 > 10000 and col1>0 and prev_col1>0;
End;

I have tried in vain to use select into, with both the select statements(separately). Please advise.
Basically, I am comparing a field with the previous field and identifying faulty fields. Then I want to replace the faulty field with the previous field.
Comments
Locked Post
New comments cannot be posted to this locked post.
Post Details
Locked on Dec 30 2009
Added on Dec 2 2009
7 comments
1,402 views