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

Home -> Community -> Usenet -> c.d.o.server -> Re: SELECT * FROM (MyCursor Results) ..?

Re: SELECT * FROM (MyCursor Results) ..?

From: Joseph Ranseth <webmaster_at_NOSPAM.worldcupfishing.com>
Date: Mon, 19 Feb 2001 11:56:58 -0600
Message-ID: <Zfdk6.519$vh7.21473@news1.mts.net>

If you want to use conditions based on parameters, etc., you should look at using dynamic SQL. You can create the SQL statement with your conditions on the fly. Dynamic SQL is very easy if your are running 8i.

--
Joseph Ranseth - Webmaster
World Cup Fishing
http://www.worldcupfishing.com
"Brian Y." <NOSP_at_M> wrote in message
news:lUTj6.144$MX.2966415_at_news2.news.adelphia.net...

> Thanks for the response. There is a special case where I will have to link
> (join) to a table in an external database. I could just put that in the
> cursor query, but I don't want to impose that overhead since data from the
> other table will only be required about 10% of the time. So my idea was to
> take the cursor results as its own recordset and then do the external
link.
>
> I wonder if there is, instead, some parameter I could send to the cursor
> that could conditionally do the join...
>
> "David Fowler" <dbf57_at_earthlink.net> wrote in message
> news:7sSj6.2681$6N6.280445_at_newsread2.prod.itd.earthlink.net...
> > Brian,
> > Try to insert the result set of first cursor output in temp table
(If
> > your on Oracle 8i). See manual on transaction/session type table.
> >
> > Is there a join column between them ? or are they completely unrelated
> > things (Cartian product then if joined) . The second query will have
to
> > work off the table/views.
> > hth,
> > Dave Fowler
> >
> > "Brian Y." <NOSP_at_M> wrote in message
> > news:Fq%i6.42$MX.226054_at_news2.news.adelphia.net...
> > > Is it possible to use the results of a cursor inside a query - similar
to
> > > the way I would do a nested query? So I have a cursor in my DECLARE
area...
> > >
> > > CURSOR c1 IS SELECT f1, f2 FROM table1...
> > >
> > > and further down I'm working in another query. I know I could do
something
> > > like
> > >
> > > SELECT f1 FROM (SELECT f1, f2 FROM table1... ),
> > >
> > > that's standard. But is there any way to pull the cursor results into
the
> > > query, as in...
> > >
> > > SELECT f1 FROM (c1...)?
> > >
> > > Or maybe there's another syntax, structure or approach that I should
be
> > > using? The problem is I have a global query (in a cursor) that I
really
> > > can't change, but I need to link to another table from it. Any
thoughts?
> > > Thanks.
> > >
> > > B~
> > >
> > >
> > >
> >
> >
>
>
Received on Mon Feb 19 2001 - 11:56:58 CST

Original text of this message

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