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

Home -> Community -> Usenet -> c.d.o.tools -> Re: Want to Create Custom Cursor in Stored Procedure?

Re: Want to Create Custom Cursor in Stored Procedure?

From: <deep-thought_at_topmail.de>
Date: 2000/06/13
Message-ID: <8i5aq7$du6$1@news.online.de>#1/1

You can do stuff like that with dynamic sql . Have a look at the documentation of the dbms_sql package hth
Jens Meihoefer (J.Meihoefer_at_BITS-on-the.net)

Keith L. Norris <kln_at_gate.net> schrieb in im Newsbeitrag: 39462B10.89877E23_at_gate.net...
> Hello Knowledge Source,
>
> Can I create a customized cursor is a stored procedure on an Oracle
> backend based on parameters passed to the stored procedure? For
> example, as far as I know, an explicit cursor is declared like:
>
> Declare Cursor as SELECT Field1, Field2, Field3 FROM table1 WHERE Field1
>
> = variable;
>
> Is there a way to say something like:
>
> DECLARE Cursor as StringVariable;
>
> If this could work as I'm hoping, StringVariable could contain my own
> customized select statement. This way I could control the conditions.
> For example, I may want to declare the cursor as:
>
>
> Declare Cursor as SELECT Field1, Field2, Field3 FROM table1 WHERE Field1
>
> = variable;
>
> during one call to the stored procedure and define the cursor to be:
>
>
> Declare Cursor as SELECT Field1, Field2, Field3 FROM table1 WHERE Field2
>
> = variable;
>
> in the next call to the stored procedure.
>
> I am using MS Access97 as the front-end. Is there a way to pass the
> string that I want evaluated in the cursor of the stored procedure in to
>
> the stored procedure and then have the stored procedure declare a cursor
>
> having the value of the variable passed in? For example, could I
> declare a cursor in the stored procedure as:
>
> DECLARE Cursor as StringVariablePassedInToStoredProcedure;
>
> ??
>
> I am new to PL/SQL and stored procedures.
>
> Thank you very much!!!
> Keith
>
>
>
Received on Tue Jun 13 2000 - 00:00:00 CDT

Original text of this message

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