Re: Oracle Form - ORDER BY clause

From: Andrew Babb <andrewb_at_mail.com>
Date: Thu, 22 Apr 1999 10:03:38 +0800
Message-ID: <371E837A.5F3ED894_at_mail.com>


Is it something to do with Dev/2000 only supporting PL/SQL v1 and not PL/SQL v2.

Just a thought,
Andrew

suisum_at_ecn.ab.ca wrote:

> I have the following tables. I want to get a list of movie rentals in
> movie title for a particular customer. I have created the following
> function in Oracle Form for sorting purpose:
>
> FUNCTION sort_movie_title_fn
> (p_tape_id NUMBER)
> RETURN VARCHAR2
> IS
>
> v_movie_title movies.title%TYPE := 'UNKNOWN';
>
> CURSOR cur_title_rec IS
> SELECT title
> FROM movies
> WHERE id = (SELECT movie_id FROM tapes WHERE id = p_tape_id);
>
> BEGIN
> OPEN cur_title_rec;
> FETCH cur_title_rec INTO v_movie_title;
> CLOSE cur_title_rec;
> RETURN v_movie_title;
> END;
>
> However, when I put the following clause in the Rentals ORDER BY clause
> property, the form complains the invalid column name. I believe the error
> is the tape_id.
>
> sort_movie_title_fn (tape_id)
>
> Please help.
>
> ------------------------------------
> Table definitions
> ------------------------------------
>
> SQL> desc tapes;
> Name Null? Type
> ------------------------------- -------- ----
> ID NOT NULL NUMBER
> MOVIE_ID NUMBER
> STATUS CHAR(1)
>
> SQL> desc movies;
> Name Null? Type
> ------------------------------- -------- ----
> ID NOT NULL NUMBER
> TITLE NOT NULL VARCHAR2(30)
>
> SQL> desc rentals;
> Name Null? Type
> ------------------------------- -------- ----
> CUSTOMER_ID NOT NULL NUMBER
> TAPE_ID NOT NULL NUMBER
>
> --
> Best regards,
Received on Thu Apr 22 1999 - 04:03:38 CEST

Original text of this message