Try casting to integer: CASE WHEN product_id = :var1 THEN :var1::integer * :var2::integer ELSE 0 END The error operator is not unique... can mostly be fixed by casting to the expected type...
EXECUTE IMMEDIATE (dynamic SQL method 1) doesn't support the USING clause. You can prepare and execute it instead (using dynamic SQL method 2): EXEC SQL PREPARE ora_stmt FROM :stmt; EXEC SQL EXECUTE stmt USING :v1, :v2, :v3, :v4; It doesn't look you really need to do this dynamically at all,...