| Oracle FAQ | Your Portal to the Oracle Knowledge Grid | |
Home -> Community -> Usenet -> c.d.o.server -> Re: stored procedure purgatory
Hi,
Try this... changes in comments...
CREATE OR REPLACE PROCEDURE sumCost(passedInPmwrkord_code IN
VARCHAR2) AS
CURSOR get_wo_acct_num_cur IS
SELECT a.pmwrkord_code, a.description, SUM(b.cost) AS COST_SUM
/* Renamed the sum above */
FROM pmwrkord a, pmtimed b
WHERE a.pmwrkord_code = b.pmwrkord_code
AND a.pmwrkord_code = passedInPmwrkord_code
GROUP BY a.pmwrkord_code, a.description;
BEGIN /* Cursor declared first, then begin */
NULL; /* U need to explicitly tell the engine to do nothing ;) */
END;
HTH,
vrkulkarni
<newguysanfran_at_my-deja.com> wrote in message
news:8vhjn9$d58$1_at_nnrp1.deja.com...
> Hey all,
>
>
> I can't get this to work. I'm new at PL/SQL so please forgive
> me but what's wrong with this:
>
> CREATE OR REPLACE PROCEDURE sumCost(passedInPmwrkord_code IN
> VARCHAR2) AS
> BEGIN
> CURSOR get_wo_acct_num_cur IS
> SELECT a.pmwrkord_code, a.description, SUM(b.cost)
> FROM pmwrkord a, pmtimed b
> WHERE a.pmwrkord_code = b.pmwrkord_code
> AND a.pmwrkord_code = passedInPmwrkord_code
> GROUP BY a.pmwrkord_code, a.description;
> END;
>
> Toad tells me:
> PLS-00103: Encountered the symbol "GET_WO_ACCT_NUM_CUR" when expecting
> one of the following:
>
> := . ( @ % ;
> PLS-00103: Encountered the symbol "END" when expecting one of the
> following:
>
> begin function package pragma procedure subtype type use
>
Received on Fri Nov 24 2000 - 10:02:44 CST
![]() |
![]() |