Skip to content

An Approval Routing was copied from a template for each new customer (rather than created fresh per customer), so the routing's own key_ref string doesn't contain a clean, directly-queryable CUSTOMER_ID field — how do you still identify which routing record belongs to a specific customer when querying APPROVAL_ROUTING_TAB for its approval status?

Answer

Parse the customer identifier out of the key_ref string itself using Oracle's SUBSTR and INSTR functions, then compare the extracted value against the customer number you're checking for (e.g. OLD:CUSTOMER_NO) — since key_ref is a delimited string (typically using ^ and = characters to separate key-value pairs), INSTR can locate the relevant segment and SUBSTR can extract just the customer number portion out of it for comparison, even when there's no dedicated, directly-filterable CUSTOMER_ID column available on the copied routing record.

← Browse Finance questions