RETURNING clause returns wrong value upon UPDATE statement [message #677484] |
Mon, 23 September 2019 09:38 |
|
ermoadam
Messages: 3 Registered: September 2019
|
Junior Member |
|
|
Hello all,
I have encountered an error upon using RETURNING clause on UPDATE statement. Please find the corresponding block of code that produces the error down below:
UPDATE billable_accounts
SET npmt = 5189
WHERE ba_number='005086708'
RETURNING cust_seq_id INTO v_cust_id;
Also, note the following information for the above statement:
billable_accounts: View constructed by 3 tables (lets say a, b, c)
npmt: NUMBER(22) - from table a
cust_seq_id: NUMBER(18) - from table b
ba_number: VARCHAR2(71 Byte) - from table c
cust_seq_id gets the value of npmt column (5189 - that is updated through the statement). However, cust_seq_id value should be 456668 instead of 5189.
Also, you may find attached a screenshot that proves the above. Has anyone else faced something similar to this?
Thank you,
Ermo.
|
|
|
|
|
|
|
|