Re: pro C versus PL/SQL

From: Richard Kuhler <noone_at_nowhere.com>
Date: Thu, 27 Mar 2003 21:29:49 GMT
Message-ID: <h3Kga.4691$Hx.1944247_at_twister.socal.rr.com>


Lolita wrote:
<snip>

> 2- A package is dynamically created to translate all the rules (around
> 300 can go up to 999) into elsif statements.

Why not dynamically create the select statement instead? Just change those dynamic 'elsif' statements into a CASE statement to identify which rule each row matches and filter out the rows that didn't match ...

SELECT *
FROM (
  SELECT ...
    CASE

[Quoted]       WHEN <dynamic condition> THEN 1
      WHEN <dynamic condition> THEN 2
      ...
      ELSE -1

    END AS RULE_NUMBER
  FROM (<that original select you have>)   )
WHERE RULE_NUMBER != -1 Richard Received on Thu Mar 27 2003 - 22:29:49 CET

Original text of this message