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: How do I modify a cursor declaration?

Re: How do I modify a cursor declaration?

From: M.M. Keuvelaar <m.m.keuvelaar_at_iquip.nl>
Date: Fri, 24 Dec 1999 00:07:31 +0100
Message-ID: <83u9lq$qab$1@buty.wanadoo.nl>


Hi Calvin,

I'm not sure if this is what you're looking for, but you could use = parameters in a cursor. Then you would get something like this:

CURSOR c_cursor (l_location dept.loc%TYPE) IS

    SELECT deptno

    ,                dname
    ,                loc

    FROM dept
    WHERE loc = l_location;

but it won't work for an order by... I did hear something about a = package called DBMS_SQL, that can be used for dynamic SQL, but I don't = have any experience with it myself.

Suc6!

Marga.

http://www.euronet.nl/~in004323

Calvin Crumrine <Calvin_Crumrine_at_dced.state.ak.us> wrote in message = news:38615508.86B31FA2_at_dced.state.ak.us...
> I've been assigned to write a Pro*COBOL report program that needs to =
execute the same cursor
> twice with different order by clauses.
>
> I can declare two cursors that are identical except for the order by =
clause, but since I don't
> need to execute both cursors simultaneously it seems as if I should be =
able to declare one
> cursor with a variable order by clause, if I can only figure out how =
to do it.
>
> Any ideas? I'm pretty sure I could convince my boss to let me write it =
in PL/SQL if I could
> show him how it could be done there, but nobody in the office really =
knows much about anything
> except COBOL. We're just switching to Oracle.
>
> Thanks.
Received on Thu Dec 23 1999 - 17:07:31 CST

Original text of this message

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