Programming Oracle stored-procedure cursors

Todd Helfter assumed responsibility for maintenance of Oratcl [L1 ] in 2000. He offers this example of use of a cursor returned from an Oracle stored procedure:

  set exec_cur [oraopen $lda]
  set fetch_cur [oraopen $lda]

  set plsql {begin
        open :fetchcur for select loginname, hostname
        from ac_account where loginname = :log;
        end;
  }
  oraplexec $exec_cur $plsql :log tmh :fetchcur $fetch_cur
  orafetch $fetch_cur {puts "$login:$host"} "" login 1 host 2

RLH: I added this code to the Oratcl Examples page so we can keep all the Oratcl example stuff together.


Category Database