Oracle FAQ | Your Portal to the Oracle Knowledge Grid |
Home -> Community -> Usenet -> c.d.o.server -> Re: ORA-00905 missing keyword
Wayne wrote:
> I'm trying to use a query analyzer on some pre-existing procedure code
> and can't get past this message.
>
> "Describe Error: Failed to execute EXPLAIN plan: ORA-00905: missing
> keyword"
>
> Here's the procedure. Below it are the tables.
>
>
> /***************************************************************************
> Deletes a row in the activities table by the primary key value.
> Also cascade deletes all children and all other associated data.
>
> ****************************************************************************/
> PROCEDURE delete_activity
> (
> p_activity_id IN activities.activity_id%TYPE
> )
> IS
> CURSOR v_children_activities(p_parent_activity_id
> activities.activity_id%TYPE) IS
> SELECT activity_id
> FROM activities
> WHERE parent_id = p_parent_activity_id;
>
[snip]
>
>
> Also, what does this do? (found in middle of query)
> FOR rec IN v_children_activities(p_activity_id) LOOP
> delete_activity(rec.activity_id);
> END LOOP;
> I'm assuming this is what performs the cascade delete. I'm just not
> familiar with using "rec", so resources for learning more on this as
> well as advice on using it would be appreciated too.
>
>
That's what the comment says: cascade delete. v_children_activities is a cursor; for every found record the cursor returns, delete_actitivity is called, and gets the current activity_id passed as parameter (referenced as rec.activity_id).
No idea where you get the error, so can't help on that
-- Regards, Frank van Bortel Top-posting is one way to shut me up...Received on Thu Apr 27 2006 - 12:42:46 CDT