Forum Stats

  • 3,874,444 Users
  • 2,266,734 Discussions
  • 7,911,851 Comments

Discussions

ORA-20104: create_collection_from_query Error

455564
455564 Member Posts: 73
edited Jan 3, 2008 4:56AM in APEX Discussions
I am using a tabular form based on a collection that uses a fairly complicated piece of SQL to populate the collection and can take between 2-10 seconds to fetch the data. I am using a fairly standard piece to code in a process to create my collection as below.

IF APEX_COLLECTION.COLLECTION_EXISTS
(p_collection_name => 'TEAM_RESOURCE' )
THEN
APEX_COLLECTION.DELETE_COLLECTION
(p_collection_name => 'TEAM_RESOURCE' );
END IF;

APEX_COLLECTION.CREATE_COLLECTION_FROM_QUERY(
p_collection_name => 'TEAM_RESOURCE',
p_query => 'SELECT .........' );


However, if the user becomes impatient and starts pressing the button that creates the collection multiple times then I get the following error:

ORA-20104: create_collection_from_query Error:ORA-20101:Application collection exists

Can anyone provide a suggestion as to how I can avoid this error being raised?

Thanks in anticipation

Jon

Comments

  • Phil W
    Phil W Member Posts: 709 Bronze Badge
    Looks like the collection is created autonomously - am I guessing here?

    You could branch to a page informing user the collection has been created, moving the create code to the load secton of the new page or use an HTML button (disabled when pressed).

    Phil
This discussion has been closed.