Most probably the POST-QUERY
trigger fires just after the fields of table-based block with multiple records are populated. Obviously Exchange_code
values are not unique throughout the table data, whereas a SELECT .. INTO .. FROM ...
clause only can bring one row record.
So, you can try to filter out the results so as to get single rows for each parameter fields combinations such as :exchange.Exchange_code
& :exchange.code_order
instead of only :exchange.Exchange_code
field within the WHERE
condition :
SELECT Stock_code
INTO :exchange.stockcode
FROM Exchange_Stock
WHERE Exchange_code = :exchange.Exchange_code
AND code_order = :exchange.code_order;
where important thing is to get single row from the query matching for each record in the data block. You can still add more condition to the query if this condition is not provided yet.