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: Trying to write first package

Re: Trying to write first package

From: Howard J. Rogers <howardjr_at_dizwell.com>
Date: Mon, 04 Oct 2004 08:32:10 +1000
Message-ID: <4161d015$0$10351$afc38c87@news.optusnet.com.au>


pcmodeler wrote:

> I'm new to Oracle. Trying to write my first package
> and I keep
> getting an error stating that it doesn't like the Create statement on
> line 6. Even removing it creates an error. I don't fully understand
> cursors yet, so that probably has somethign to do with it, but
> according to my documentation, it should be correct.
>
> CREATE OR REPLACE PACKAGE PG_TEST AS
> TYPE cdcur IS REF CURSOR;
> PROCEDURE SP_TEST
> (CRSE_CD IN OUT cdcur);
> END PG_TEST;
Oracle doesn't realise that you've come to the end of defining the package at this point, so the leap straight on into defining the package body is confusing it.

Stick a "/" at this point and see how you go.

Regards
HJR
> CREATE OR REPLACE PACKAGE BODY PG_TEST
> AS
> PROCEDURE SP_TEST
> (CRSE_CD IN OUT cdcur)
> IS
> BEGIN
> OPEN CRSE_CD FOR
> SELECT
> CRSE_TTL, LOCAL_CRSE_CD
> FROM
> CRSE
> WHERE
> CRSE_TTL LIKE '%Learn%';
>
> END SP_TEST;
>
> END PG_TEST;
> /
Received on Sun Oct 03 2004 - 17:32:10 CDT

Original text of this message

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