Reputation: 11
How do I add an INTO statement to this query? I am selecting data from two tables, when the user selects the auction (P62_AUCTION) and bidder (P62_BIDDER), display the auction_no, item_no, item_description, serial_no, and reserve_price from auc_bidding_tb b and auc_auction_list_tb l. Here is my query, I am using the new apex environment
SELECT distinct
apex_item.checkbox(1,b.item_no,'UNCHECKED') " ",
b.auction_no,
b.item_no,
l.item_description,
l.serial_no,
l.reserve_price
FROM auc_bidding_tb b, auc_auction_list_tb l
where b.auction_no = :P62_AUCTION
AND b.bidder = :P62_BIDDER
AND l.auction_no = b.auction_no
AND l.item_no = b.item_no
and l.receipt_number IS NULL;
However I an getting an error:
ORA-06550: line 1, column 64: PLS-00428: an INTO clause is expected in this SELECT statement
How do I solve this error?
Upvotes: 0
Views: 1260
Reputation: 4129
The error "an INTO clause is expected in this SELECT" means your code has been executed in the PLSQL scope (between "begin" and "end") in that case you can't just query for data but you have to store it somewhere. That's why INTO clause is being expected.
The second error means the query you ran did not find any data to return, which is an exception in the PLSQL scope.
So, I see 2 options here:
Upvotes: 1