Oracle FAQ Your Portal to the Oracle Knowledge Grid
HOME | ASK QUESTION | ADD INFO | SEARCH | E-MAIL US
 

Home -> Community -> Usenet -> c.d.o.misc -> Re: help with cursors

Re: help with cursors

From: Daniel Morgan <damorgan_at_x.washington.edu>
Date: Fri, 17 Sep 2004 14:40:27 -0700
Message-ID: <1095457297.423113@yasure>


Lenny wrote:

> I'm a newbie with oracle.
> anyone can help me with these cursors?
>
> I'm trying to port some queries written in VBA to oracle.
>
> how can I set the second cursor "passaggi" dynamically
> taking a value from the first cursor?
> (I cannot use just one cursor joining the tables.)
>
> see line:
> where psd_pv = clienti.upv_cod
>
> thanks.
> Luca
>
> cursor clienti is
> select cli_cod, upv_cod, cli_tigi, upv_agg, upv_trd, cli_int, cli_udat,
> upv_aff1
> from vega.clienti,vega.unopv
> where cli_cod = upv_trd
> order by cli_cod;
>
> cursor passaggi is
> select psd_pv, psd_teo,psd_dat, psd_flg, psd_age
> from vega.pasdst
> where psd_pv = clienti.upv_cod and
> psd_dat >= trunc(sysdate-720) and
> psd_dat <= trunc(sysdate) and
> psd_teo > 0
> order by psd_pv, psd_dat;

There are a number of examples that should walk you through what you need to learn at http://www.psoug.org. Click on Morgan's Library
Click on LOOPS.

-- 
Daniel A. Morgan
University of Washington
damorgan_at_x.washington.edu
(replace 'x' with 'u' to respond)
Received on Fri Sep 17 2004 - 16:40:27 CDT

Original text of this message

HOME | ASK QUESTION | ADD INFO | SEARCH | E-MAIL US