0

I want to display the item from different table, I am using POST-QUERY trigger :

SELECT Stock_code
  INTO :exchange.stockcode
  FROM Exchange_Stock
 WHERE Exchange_code = :exchange.Exchange_code;

it come up with FRM-40735 and ORA-01422 but it display some of the record (not all), I have no idea what is wrong

Barbaros Özhan
  • 59,113
  • 10
  • 31
  • 55
Parco Guan
  • 33
  • 1
  • 7

1 Answers1

1

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.

Barbaros Özhan
  • 59,113
  • 10
  • 31
  • 55