Home Page for the TeradataForum

Archives of the TeradataForum

Message Posted: Mon, 03 Mar 2008 @ 18:09:30 GMT

  <Prev Next>   <<First <Prev

Subj:   Re: Oracle function %ROWTYPE
From:   Aldrin, John

The %ROWTYPE is associated with defining a variable that stores the record returned from a cursor based operation. This is typically found where the code has chosen to do a OPEN / FETCH / CLOSE cursor operations.

I have found that by converting the PL/SQL to use a FOR LOOP construct, it provides the record holder. In the following example, the variable "cov_row" is in essence what you are trying to implement. This example is an way you get around a "TOO MANY ROWS" exception by reading the first record returned and ignoring the remainder if they exist.

     FOR cov_row AS cov_cur CURSOR FOR
         SELECT cvrg_key
         FROM cvrg_dim
         WHERE plcy_cvrg_id        = :i_plcy_cov_id
         SET v_cvrg_key           = cov_row.coverage_key;
         LEAVE cov_loop;
     END FOR cov_loop;


  <Prev Next>   <<First <Prev
  Top Home Privacy Feedback  
Copyright for the TeradataForum (TDATA-L), Manta BlueSky    
Copyright 2016 - All Rights Reserved    
Last Modified: 28 Jun 2020