Hi Kailash,
Thank you for the suggestion! Your query gave me the right idea to find the solution.
Hi Everyone,
Providing my observation and solution below.
Root Cause:
When using a Custom SQL Adapter in webMethods with an INSERT statement, there is no option to map an output variable — so you cannot get rowsAffected or any response back.
My Solution — Use a Stored Procedure:
Instead of Custom SQL Adapter, create an Oracle Stored Procedure and use the Stored Procedure Adapter in webMethods. This allows you to define OUT parameters and get a response back.
Stored Procedure (I used) [In ORACLE DB]:
CREATE OR REPLACE PROCEDURE update_inventory_reservation (
p_order_id IN VARCHAR2,
p_quantity IN NUMBER,
p_product_id IN VARCHAR2,
p_qty_check IN NUMBER,
p_rows_affected OUT NUMBER
) AS
BEGIN
INSERT INTO inventory_reservations (
reservation_id,
order_id,
product_id,
quantity,
status
)
SELECT
'RES-' || seq_reservation_id.NEXTVAL,
p_order_id,
product_id,
p_quantity,
'RESERVED'
FROM
vw_available_inventory
WHERE
product_id = p_product_id
AND available_quantity >= p_qty_check;
p_rows_affected := SQL%rowcount;
COMMIT;
END;
NOTE: I have provided all the necessary screenshots that can help you guys to understand this solution. If any doubt feel free to drop a comment.