Misha Rukazo
Misha Rukazo

Reputation: 11

PLS-00428: an INTO clause is expected in this SELECT statement and then ORA-01403: no data found

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

Answers (1)

ekochergin
ekochergin

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:

  1. Perform query within SQL scope if possible
  2. Handle "no_data_found" exception for that case providing a more "user-friendly" message
  3. Analyse where conditions to find out why there is no data

Upvotes: 1

Related Questions