*** STAVA.cmd ***
* Aufruf in STAV.vdnts
*
* Anlegen der untersten VIEWs
FILE STAVAA( &1!
*
* Anlegen der Stapel-Views + SELECT
FILE STAVAB( 2 1!
FILE STAVAB( 3 2!
FILE STAVAB( 4 3!
FILE STAVAB( 5 4!
FILE STAVAB( 6 5!
FILE STAVAB( 7 6!
FILE STAVAB( 8 7!
FILE STAVAB( 9 8!
FILE STAVAB( 10 9!
FILE STAVAB( 11 10!
FILE STAVAB( 12 11!
FILE STAVAB( 13 12!
FILE STAVAB( 14 13!
FILE STAVAB( 15 14!
FILE STAVAB( 16 15!
FILE STAVAB( 17 16!
FILE STAVAB( 18 17!
FILE STAVAB( 19 18!
FILE STAVAB( 20 19!
*
 * PTS 1137017-19 !
SELECT N FROM VE2 T0
WHERE T0.K IN (SELECT N FROM VW2 T1 WHERE K = T0.N)
  AND T0.N IN (SELECT K FROM VS2 T2 WHERE N = T0.K)!
fetch!       
SELECT N FROM VE2 T0
WHERE T0.K IN (SELECT N FROM VW2 T1 WHERE K = T0.N)
  AND T0.N IN (SELECT K FROM VS1 
                   WHERE K = (SELECT MIN(N) FROM VS1) AND N = T0.K) !   
fetch!
SELECT N FROM VE2 T0
WHERE T0.K IN (SELECT N FROM VW2 T1 WHERE K = T0.N)!
fetch!
SELECT N FROM VE2 T0
WHERE T0.K IN (SELECT N FROM VW1 WHERE K = 1 AND K = N 
         AND SQRT(N) = 1 AND K - N = 0 AND K * N = 1 AND  K = T0.N)!              
fetch!
SELECT N FROM VE2 T0
WHERE T0.K IN (SELECT N FROM VW1 WHERE K = 1 AND K = N 
         AND SQRT(N) = 1 AND K - N = 0 AND K * N = 1 AND  K = T0.N)
      AND T0.N IN (SELECT K FROM VS2 T2 WHERE N = T0.K) !              
fetch!
SELECT N FROM VE2 T0
WHERE T0.K IN (SELECT N FROM VW1 WHERE K = 1 AND K = N 
      AND SQRT(N) = 1 AND K - N = 0 AND K * N = 1 AND  K = T0.N)
      AND T0.N IN (SELECT K FROM VS1 
                   WHERE K = (SELECT MIN(N) FROM VS1) AND N = T0.K) !              
fetch!
* Loeschen der untersten VIEWs
*** STAVAC.cmd ***
* Aufruf in STAVA.cmd
*
* Loeschen der untersten VIEWs
DROP VIEW VE1!
DROP VIEW VW1!
DROP VIEW VS1!
* 
COMMIT!
*
