K
K
KTG2018-12-26 04:54:24
Oracle
KTG, 2018-12-26 04:54:24

How to access an element of a collection through a variable?

I have a nested collection:

TYPE film_link_record IS RECORD (   code   NUMBER 
                                      , groupid  NUMBER
                                      , catid NUMBER);
    TYPE film_link_tbl IS TABLE OF film_link_record 
        INDEX BY PLS_INTEGER;
    TYPE cinema_link_tbl IS TABLE OF film_link_tbl    
        INDEX BY PLS_INTEGER;    
    cinema_data cinema_link_tbl;

I turn to the data: The
Cinema_data(CinemaID)(FilmPackID).code
question is, can I wrap the call in a function, and pass the field name through a variable?
Like:
get_data(code);
get_data(groupid);

I know right off the bat one way - to form an SQL query as a string.
Is there another?

Answer the question

In order to leave comments, you need to log in

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question