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: ORACLE CURSORS

Re: ORACLE CURSORS

From: Scott Metzger <scottmetzger_at_my-deja.com>
Date: Tue, 09 Jan 2001 20:56:32 GMT
Message-ID: <93fttu$9g2$1@nnrp1.deja.com>

I am not sure about DBA Studio but here is one way to declare and use a cursor in a Oracle Procedure:
CREATE OR REPLACE PROCEDURE "BRIAN"."OSP_CAPITALIZE_FIRST_CHAR" IS MyCursor INTEGER;
MyField Varchar2(100);
Dummy INTEGER;
BEGIN
 /* Open the cursors */
 MyCursor := DBMS_SQL.OPEN_CURSOR;

 */
 DBMS_SQL.PARSE(MyCursor,

    'Select MyField from MyTable',DBMS_SQL.V7);  DBMS_SQL.DEFINE_COLUMN(MyCursor, 1, MyField, 100);  Dummy := DBMS_SQL.EXECUTE(MyCursor);
 Dummy := DBMS_SQL.FETCH_ROWS(MyCursor);  DBMS_SQL.COLUMN_VALUE(MyCursor, 1, MyField);  DBMS_SQL.CLOSE_CURSOR(MyCursor);
END;
/

In article <93ft0q$8sm$1_at_nnrp1.deja.com>,   brianjh_deja_at_my-deja.com wrote:
> i'm trying to create a procedure that declares a cursor in DBA Studio.
>
> CREATE OR REPLACE PROCEDURE "BRIAN"."OSP_CAPITALIZE_FIRST_CHAR" IS
> BEGIN
> cursor cursor1 is select * from customers;
> END;
>
> Here's the generated text. But I'm getting the following error on
> compile.
>
> Help would be appreciated. THANKS!!
>
> ERROR:
> Line # = 3 Column # = 11 Error Text = PLS-00103: Encountered the
> symbol "CURSOR1" when expecting one of the following:
> := . ( @ % ;
> Line # = 4 Column # = 1 Error Text = PLS-00103: Encountered the
> symbol "END" when expecting one of the following:
> begin function package pragma procedure subtype type use
> <an identifier> <a double-quoted delimited-identifier> cursor
> form current

Sent via Deja.com
http://www.deja.com/ Received on Tue Jan 09 2001 - 14:56:32 CST

Original text of this message

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