Quantcast
Channel: Teradata Forums - Database
Viewing all articles
Browse latest Browse all 14773

Cursors in stored procedures - response (7) by gwizdek

$
0
0

Hi,
Suppose I have 3 cursors declared within SP:
REPLACE PROCEDURE "schema"."sproc" ( IN "param" DECIMAL(25, 0))
    DYNAMIC RESULT SETS 3
BEGIN
  DECLARE c1 CURSOR WITH RETURN ONLY FOR
    select x from schema.A where ID = param;
                 
  DECLARE c2 CURSOR WITH RETURN ONLY FOR
    select y from schema.B where ID = param;

  DECLARE c3 CURSOR WITH RETURN ONLY FOR
    select z from schema.C where ID = param;
          
  OPEN c1;
  OPEN c2;
  OPEN c3;
END;
 
Are these selects executed in sequence (c1 , then c2, then c3) or parallel?
Is there any difference if I move OPEN statement into declare cursor body, like in second post?


Viewing all articles
Browse latest Browse all 14773

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>