 |
|
ss
Oracle Tips by Burleson |
Sorting
a Collection
A button was provided to sort the collection by
the LAST_NAME column in the collection. In reality, the data from the
LAST_NAME column is stored in the collection in a column or element
named C002, but that will be covered a little later.
The procedure to sort by the LAST_NAME, aka C002,
column is:
htmldb_collection.sort_members( 'CONF', 2 );
Updating a Collection
Member
A member in a collection is the same as a record
in a table. However, an UPDATE command cannot be issued because it is
a collection and not a table. Updating a collection member is done in
the EASY Samples application with the following process.
htmldb_collection.update_member(
p_collection_name => 'CONF',
p_seq => :P1133_SEQ_ID,
p_c002 => :P1133_LAST_NAME,
p_c003 => :P1133_FIRST_NAME,
p_c004 => :P1133_RSVP_DATE,
p_c005 => :P1133_COMPANY,
p_c006 => 'U' );
The C006 element of the collection is being used
as a place holder for actions performed on the collection. This idea
was learned by looking at the Collections Showcase application
included with HTML DB. The U indicated the member in the collection
has been updated. Looping through the members in the collection can
be done later to issue update statements on the CONFERENCE_RSVP table.
The above book excerpt is from:
Easy HTML-DB
Oracle Application Express
Create
Dynamic Web Pages with OAE
ISBN 0-9761573-1-4
Michael Cunningham & Kent Crotty
http://www.rampant-books.com/book_2005_2_html_db.htm
|