ApEx collection problem

Hi there,
I'm trying to create a collection within an ApEx process. My intention is to create a cursor (only 1 in the example but I want to add more in the future) and fill the collection with the data the cursor finds.
However the application gives the following error: ORA-06550: line 29, column 51: PL/SQL: ORA-00917: missing comma ORA-06550: line 28, column 1: PL/SQL: SQL Statement ignored. I know that the error probably is found somewhere else in the code. Can someone help me?
declare
cursor skill1_cur is
SELECT emp_id, esk_lvl_id
FROM stf_employees
JOIN stf_emp_skill ON emp_id = esk_emp_id
WHERE esk_skl_id = :P4000_SKILL_1
AND esk_lvl_id between :P4000_LVLF_1 AND :P4000_LVLT_1;
begin
if apex_collection.collection_exists('storevalues') then
apex_collection.delete_collection(p_collection_name => 'storevalues');
end if;
apex_collection.create_collection('storevalues');
for l_skill1_cur1 in skill1_cur loop
insert into
apex_collection.add_member(p_collection_name => 'storevalues',
p_c001 => skill1_cur.emp_id,
p_c001 => skill1_cur.esk_lvl_id);
end loop;
end;
Best regards
Apex version: Application Express 4.2.1.00.08

It is usefull to use a formating tool for your code since it tells you imediatelly if your code has the right syntax. Here is a code which may help:
DECLARE
   CURSOR skill1_cur
   IS
      SELECT emp_id, esk_lvl_id
        FROM stf_employees JOIN stf_emp_skill ON emp_id = esk_emp_id
       WHERE esk_skl_id = :p4000_skill_1
         AND esk_lvl_id BETWEEN :p4000_lvlf_1 AND :p4000_lvlt_1;
   v_collection_name   VARCHAR2 (30) := 'STOREVALUES';
BEGIN
   IF apex_collection.collection_exists (v_collection_name)
   THEN
      apex_collection.delete_collection
                                      (p_collection_name      => v_collection_name);
   END IF;
   apex_collection.create_collection (v_collection_name);
   FOR l_skill1_cur1 IN skill1_cur
   LOOP
      apex_collection.add_member (p_collection_name      => v_collection_name,
                                  p_c001                 => skill1_cur.emp_id,
                                  p_c002                 => skill1_cur.esk_lvl_id
   END LOOP;
END;A couple of things to consider:
1. Collection Name has to be capitalized
2. You don't need an insert into when inserting data into a collection - there is a procedure which does that
3. you have an error in calling the add_member procedure - you used the parameter p_c001 twice
I am not sure if this works for you since I have no access to the objects underneath your code.
Denes Kubicek
http://deneskubicek.blogspot.com/
http://www.apress.com/9781430235125
http://apex.oracle.com/pls/apex/f?p=31517:1
http://www.amazon.de/Oracle-APEX-XE-Praxis/dp/3826655494
-------------------------------------------------------------------

Similar Messages

  • Apex Collections and dates

    Apex Collections and Dates
    I made an earlier posting today on the forum titled “‘ORA-01861: literal does not match format string’ error after my hosting company upgraded to Apex 3.2.” The issue relates to Apex collections and dates. Prior to the hosting company upgrading Apex 3.2 from 3.1 all was working OK. It seemed a reasonable assumption that the issue relates to the upgrade to 3.2. Having tested the code against another Apex 3.2 installation I am satisfied that the issue is not with Apex 3.2. That said, I am still getting the issue on the hosting site.
    To demonstrate the issue to my hosting company and this forum, I put together a simple one page application that demonstrates the issue using the least amount of code.
    I created a page with an ‘On Load – Before header” process that sets up an Apex Collection with a single value of ’20-FEB-2009’ in the c001 element as follows:
    if apex_collection.collection_exists(p_collection_name=>'THEISSUE') then
    apex_collection.delete_collection(p_collection_name=>'THEISSUE');
    end if;
    apex_collection.create_collection(p_collection_name => 'THEISSUE');
    APEX_COLLECTION.ADD_MEMBER(
    p_collection_name => 'THEISSUE',
    p_c001 => '20-FEB-2009');
    I added an SQL REPORT region to the page which uses the Apex Collection as follows:
    select to_date(c001,'DD-MON-YYYY') testdate
    from apex_collections
    where collection_name='THEISSUE'
    and to_date('20-FEB-2009','DD-MON-YYYY')
    = to_date(c001,'DD-MON-YYYY')
    When the page is run I get the ‘ORA-01861: literal does not match format string’ error.
    If I remove the following from the SQL Report Region:
    and to_date('20-FEB-2009','DD-MON-YYYY')
    = to_date(c001,'DD-MON-YYYY')
    and run the page, the date is displayed OK, i.e., c001 is converted to a date OK. This made me wonder whether it does not like the line to_date('20-FEB-2009','DD-MON-YYYY')? So I changed the where code for the report to :
    and to_date(c001,'DD-MON-YYYY')
    = to_date(c001,'DD-MON-YYYY')
    i.e., convert c001 to a date and compare it to itself. The rationale being that if the c001 converts to a date OK, then comparing c001 converted to a date with itself should not give an error. It did it gave the same error ‘ORA-01861’
    It would seem on my hosting site since the upgrade, that Apex and Oracle have problems with Apex Collection elements being converted to dates as part of the where clause.
    Now my understating of Oracle Apex collections in simple terms is that all Apex collections are held in a single Oracle table managed by a series of Apex functions. Given that all Apex collections are in the same table, could the issue be with the Oracle database when it is creating its execution plan for the query? Could Oracle be including the value of c001 from other collections (i.e., when c001 is not in a date format ) in the initial stages of its execution plan?
    I hope the above make sense and thanks in advance.
    Ian

    Scott,
    I believe I have found the answer the statistics on WWV_FLOW_COLLECTIONS$ and WWV_FLOW_COLLECTION_MEMBERS$. are out of date and Oracle is doing a full table scan instead of using the indices to select only the c001 columns that belong to the given collection_id. If I change my simple example to store the date value in c050 it works ok. (In all probability this will be the only collection on the hosted database to use c050).
    I have asked the hosting company to gather stats on all the apex tables.
    Thanks for your help
    Ian

  • Help with APEX.COLLECTIONS in v. 3.2

    Hello, we are trying to create an apex.collection in our program similar to the one used in the sample application "Matrix Order 1.0"
    Working Code used in "Matrix Order 1.0" is as follows:
    if APEX_COLLECTION.COLLECTION_EXISTS (p_collection_name => 'MATRIX' ) then
    APEX_COLLECTION.DELETE_COLLECTION (p_collection_name => 'MATRIX' );
    end if;
    APEX_COLLECTION.CREATE_COLLECTION_FROM_QUERY(
    p_collection_name => 'MATRIX',
    p_query => 'select PRO_STYLE,PRO_COLOUR,PRO_UNIT_PRICE,S,M,L,XL from MATRIX_PRODUCTS_BY_SIZE order by 1,2,3' );
    What we've tried in ours is as follows:
    if APEX_COLLECTION.COLLECTION_EXISTS (p_collection_name => 'TRAINING' ) then
    APEX_COLLECTION.DELETE_COLLECTION (p_collection_name => 'TRAINING' );
    end if;
    APEX_COLLECTION.CREATE_COLLECTION_FROM_QUERY(
    p_collection_name => 'TRAINING',
    p_query => 'select * from IDEAS_USERS_VIEW' );
    End result is a message stating "no data found"
    Any thoughts?
    Additional information:
    we've tried above creating a view from a table, we've also tried putting the table name right in the query field - same results.
    we've also tried several over variations of the code found on the web such as the following:
    APEX_COLLECTION.CREATE_COLLECTION_FROM_QUERY(
    p_collection_name => 'TRAINING',
    p_query => 'select * from IDEAS_USERS_VIEW' ,
    p_generate_md5 => 'NO' );
    Again - same result - "no data found"
    Please Help!

    My teammate figured it out.
    the problem was under the Conditional Processing section they had the following set:
    Condition Type = "Request = Expression 1"
    Expression 1 = NEW
    Solution was to set to "No Condition" and deleted the value of "NEW"
    I'm sure we'll be back soon with questions on how to update and store it.... stay tuned.

  • Using wwv_flow_load_excel_data and apex collections

    Hi!
    I have a question regarding very popular subject: parsing csv files.
    I made one application, which takes csv file, parses it using Vicas's code, presents validation report to the user, and finally allows to submit data into the datatable.
    Everything works fine, but I don't like this solution. CSV can cause problems when quotation mark is used inside, when numbers have 1000 separators and so on.
    Besides that, I have to add some code to validate column types. Lot of mess.
    The solution incorporated into apex tool, called "Data Load/Unload" looks much better. It would be nice to use that inside apex application adding some business validations, and hardcoding table and columns names.
    I have seen wwv_flow_load_excel_data package and I'm wondering if it is possible to use load_excel_data procedure to perform that task?
    Is there any documentation to that package?
    Somebody heard about using that with apex collections (to avoid a need of temporary table)?
    Regards,
    Arek

    And if somebody else is looking for "ApEx" forum:
    Oracle Application Express (APEX)

  • Apex Collection- Tabular Form

    Hi
    is there anyway to make a tabular form depends on apex collections, for example i have a collection named "Orders" and i want to add member to this collection by tabular form , is it possible?
    Thanks in advance

    Sure, build a manual tabular form
    SELECT APEX_ITEM.TEXT(1,AC.c001)
              ,APEX_ITEM.TEXTAREA(1,AC.c002)
    FROM apex_collections AC
    WHERE collection_name = <collection name>I can also think of an approach to get this working with a Wizard based tabular form(I haven't tried this before,but I don't see any reason why it shouldn't work).
    --Create a view referring the collection.
    --Change your tabular form to reference the view
    --Add insert,update and delete triggers on the view to handle those processes on the appropriate table(s).                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                       

  • Apex Collection - tracking changes/updates on cells

    I created an apex collections page which displays and allows user to update the array/matrix/cells.
    I created a button to apply and save the changes; this process is working fine for update/insert as necessary.
    I'm struggling on a couple of points:
    1. If the user gets out of the page or do a refresh, I wanted to show an error or message that when a cell has been updated in the page, to display an error-like " that there are unsaved changes". And let them click on the update button I created. I read that there is the function called COLLECTION_HAS_CHANGED however, I'm not quite sure how to make it work with Dynamic Action.
    Any guidance is greatly appreciated. Thanks.
    2 Updating a cell value from not null to null is a bit of a challenge.
    The question is: Is there a way to find if a cell's value is changed from not null to null during the time I'm performing update_member_attribute ?
    (The update_member_attribute I found on the forum and I am using is handling it using IS NOT NULL -- I think this is good because it will avoid me getting a bunch of records inserted if the cells are indeed NULL (before and after).
    below is the part of the code I'm referring to ...
    FOR i IN 1.. APEX_APPLICATION.G_F02.COUNT LOOP
    IF apex_application.g_f02 (i) IS NOT NULL THEN
    APEX_COLLECTION.UPDATE_MEMBER_ATTRIBUTE (
    p_collection_name => 'COLLECTION1',
    p_seq => i,
    p_attr_number => 2,
    p_attr_value => apex_application.g_f02 (i));
    END IF;
    END LOOP;
    I could removed the NOT NULL IF condition, but I only wanted to do the null update when there was a value previously.
    Thanks.

    user12941774 wrote:
    I created an apex collections page which displays and allows user to update the array/matrix/cells.
    I created a button to apply and save the changes; this process is working fine for update/insert as necessary.
    I'm struggling on a couple of points:
    1. If the user gets out of the page or do a refresh, I wanted to show an error or message that when a cell has been updated in the page, to display an error-like " that there are
    unsaved changes". And let them click on the update button I created. I read that there is the function called COLLECTION_HAS_CHANGED however, I'm not quite sure how to make
    it work with Dynamic Action.COLLECTION_HAS_CHANGED This will be useful if the data has changed on the server side, and you are talking about user navigating away without saving the changes that means the data is entered only on the client/browser side.
    For handling that you can use this plugin http://apex-plugin.com/oracle-apex-plugins/dynamic-action-plugin/skillbuilders-save-before-exit_43.html
    Any guidance is greatly appreciated. Thanks.
    2 Updating a cell value from not null to null is a bit of a challenge. Why do you think its a challenge?
    You will be updating a cell value based on the user entry, no matter if it is null or not null.
    The question is: Is there a way to find if a cell's value is changed from not null to null during the time I'm performing update_member_attribute ?
    (The update_member_attribute I found on the forum and I am using is handling it using IS NOT NULL -- I think this is good because it will avoid me getting a bunch of records inserted if the cells are indeed NULL (before and after).
    below is the part of the code I'm referring to ...
    FOR i IN 1.. APEX_APPLICATION.G_F02.COUNT LOOP
    IF apex_application.g_f02 (i) IS NOT NULL THEN
    APEX_COLLECTION.UPDATE_MEMBER_ATTRIBUTE (
    p_collection_name => 'COLLECTION1',
    p_seq => i,
    p_attr_number => 2,
    p_attr_value => apex_application.g_f02 (i));
    END IF;
    END LOOP;*Always include code between {noformat}{noformat} tags, it is more readable*

  • 11g Grid Control - Host Configuration Collection Problems

    Hi Guys,
    I just installed Oracle 11g Grid Control and it has been running for 2 weeks until I recently tried to walk through the parts of it.
    My intention was to clear off all the error messages, critical warnings, alerts, and policy warnings.
    When I arrived at the development summary box, on the home tab, I can see that there is 1 collection problem.
    When I clicked it, I saw that apparently the problem is with the host where I installed the grid control.
    Problem type: Warning during collection of Oracle Software
    message: Unknown WLS Home Location or WLS Version in Middleware Home /u01/app/oracle/product/middleware
    I tried clicking on the "Refresh Host" button, but it didn't solve the problem at all.
    I have also tried to take a look at the targets.xml however it seems the configuration in there are already pointing to the correct path to the weblogic home.
    Please let me know if anyone has a suggestion for this.
    Searching from google doesn't really return anything closely matched to this.
    Thanks,
    Adhika

    What is the intent/timeline for fixing this bug? On MOS, it appears to have a status of "Status 33 - Suspended, Req'd Info not Avail". We are encountering this bug also and I would glady provide information from our systems in order for the issue to be resolved.
    Thanks.
    PostScript: FWIW, Google yielded a blog referencing this error and Doc ID 1433113.1. I am unable to access that document (as was the blogger). Because of this, and another major caveat (our machines with this collection error do not have WLS installed on them), I'm thinking this probably needs to be an SR rather than a forum discussion.
    Edited by: JeriF on Feb 4, 2013 12:00 PM

  • Using Apex collection, IR report never refreshes

    I am using IR report with Apex collections. It never gets refreshed. I've to manually refresh it using browser refresh. I do have a boarderless region template for the IR report. How can I fix it?

    I am using the following plsql to create apex collection:
    DECLARE
    l_col VARCHAR2 (10) := 'SEARCH';
    l_sql VARCHAR2 (4000);
    BEGIN
    IF apex_collection.collection_exists (l_col)
    THEN
    apex_collection.delete_collection (l_col);
    END IF;
    l_sql :=
    'SELECT srv_sys_name,ddb_dbname
    FROM healthcheck.isac_search_master
    WHERE 1 = 1';
    IF :p7_shv_swcname IS NOT NULL
    THEN
    l_sql := l_sql || ' and shv_swcname = ''' || :p7_shv_swcname || '''';
    END IF;
    IF :p7_shv_businessclustername IS NOT NULL
    THEN
    l_sql :=
    l_sql
    || ' and SHV_BUSINESSCLUSTERNAME = '''
    || :p7_shv_businessclustername
    || '''';
    END IF;
    apex_collection.create_collection_from_query (p_collection_name => l_col,
    p_query => l_sql );
    END;
    I am using this collection on various pages. It works fine from first(collecton) page to next page, but I am not able to use collection on the third page. It works if I manually refresh it. Please help me.

  • Apex Collections

    When I do a select *
    from apex_collectionsI always get a "no data found." even though my application tells me that there does indeed exist an apex collection.
    For debugging purposes, what is the best way to see what is contained in an apex collection at a given moment in time?
    Edited by: tharpa on Mar 21, 2011 10:46 AM

    Hi,
    Check session from developer tool bar
    http://download.oracle.com/docs/cd/E17556_01/doc/user.40/e15517/concept.htm#sthref108
    Or create report to your app page or totally new page.
    I have sometimes create totally new page and interactive report selecting * from apex_collections
    Regards,
    Jari

  • Query for create manual tabular form using apex collection add row button functionality

    Hello everyone
    My requirement is i created a tabular form manually using apex collection but if i click on add row button then previously selected data refreshed and added new row in this form it is fine.but i don't want to refreshed previously selected data and click on add row button then add new row .how it is possible? plz help
    Thanks & Regards,
    Ujwala

    Ujwala
    Instead of starting a new thread with the same question as Query for create manual tabular form using apex collection add row button functionality.
    Could you answer the question about what you see while debug the javascript code.
    If you don't understand the question or have trouble debug javascript let us know.
    Nicolette

  • How to create an apex collection to store and loop through the values

    I couldn't find any simple example to do this
    Apex 4.2
    I need to create an apex collection. I have a query that returns multiple roles for a user. I need to check to see if one of my item values is within the collection but am not sure how to do so. So far I have:
    begin
    APEX_COLLECTION.CREATE_COLLECTION (
    p_collection_name => 'ALL_ROLES');
    select count(granted_role) into count from dba_role_privs where upper(grantee) = upper(:APP_USER);
    end;
    How would I store the query results in the collection?

    Trying to understand your code and a better suggestion:
    declare
    is_viewable boolean;
    v_count number;
    l_query varchar2(2000);
    i_counter number(10) :=1;
    begin
    --l_query := 'select granted_role from dba_role_privs where upper(grantee) = upper(:APP_USER)';
    --why do you need a collection, this is a simple select count(1) question
    APEX_COLLECTION.CREATE_COLLECTION_FROM_QUERY (
    p_collection_name => 'ALL_ROLES',
    p_query => l_query,
    p_generate_md5 => 'YES');
    -- You create a collection, but where are you using it?
    -- select count(granted_role) into count from dba_role_privs where upper(grantee) = upper(:APP_USER);
    -- discard the above code
    -- If you want to see  how many elements in a collection
    -- determine # of elements in a collection
    http://docs.oracle.com/cd/E23903_01/doc/doc.41/e21676/apex_collection.htm#CJAFFEAH
    v_count := APEX_COLLECTION.COLLECTION_MEMBER_COUNT ('ALL_ROLES');
    IF :P32_SUBMISSION_DATE IS NOT NULL THEN
      begin
      select count(granted_role) into v_count
         from dba_role_privs
      where upper(grantee) = upper(:APP_USER) and
        granted_role in ('SURVEY_SUID','SURVEY_JOB_SUID');
      exception
      when no_rows_found then
        v_count := 0;
      end;
      if v_count > 0 then
        is_viewable := true;
      else
        is_viewable := false;
      endif;
    else
      is_viewable := false;
    endif;
    return is_viewable;
    end;Thank you,
    Tony Miller
    Ruckersville, VA

  • Extract data in JSON feeds into apex collection

    Hi,
    Does anyone know if there is any way to convert JSON feeds - from public web services - into apex collections?
    http://earthquake.usgs.gov/earthquakes/feed/geojson/all/day
    Thanks.

    Hi,
    Does anyone know if there is any way to convert JSON feeds - from public web services - into apex collections?http://earthquake.usgs.gov/earthquakes/feed/geojson/all/day>
    AFAIK there is no built-in functionality to consume JSON in Oracle as well as APEX. For processing JSON in PL/SQL you have PL/JSON , if you want to go that route.
    My personal preference is jQuery.parseJSON . You can use this in conjunction with AJAX/ On Demand process to load the data into APEX_COLLECTION.
    Cheers,

  • Apex 4 , problem with collection executions

    Hi ,
    I am having the following problem with the execution of one collection :
    Reference thread : Re: APEX 4 , executing a remote procedure and populating data using collection
    DBNAME ---> list item which I build from the DB links which I built ( as dynamic query in the shared components from a local table which holds entries of dblink names )
    USERLIST --> list item of users which should display dynamicaly the users of that db link I choose in DBNAME ( based on a collection )
    buttons CANCEL and SUBMIT
    4- Initial COLLECTION page process which is calculated before Header :
    DECLARE
    q varchar2(4000);
    BEGIN
    IF APEX_COLLECTION.COLLECTION_EXISTS(P_COLLECTION_NAME => 'QRY1') THEN
    APEX_COLLECTION.DELETE_COLLECTION(P_COLLECTION_NAME => 'QRY1');
    END IF;
    q := 'SELECT username , username FROM sys.dba_users@'||:P23_DBNAME ;
    APEX_COLLECTION.CREATE_COLLECTION_FROM_QUERY_B(
    P_COLLECTION_NAME => 'QRY1',
    P_QUERY => Q);
    END;
    For USERLIST list item I am using the following in LIST OF VALUES DEFINITION :
    SELECT C001, C002 FROM APEX_COLLECTIONS WHERE COLLECTION_NAME='QRY1'
    5 - to submit the values from the screen to the remote database procedure I am using the following submit process ON SUBMIT AFTER CALCULATIONS:
    DECLARE
    v_statement varchar2(255);
    BEGIN
    v_statement := 'begin
    Lock_User@&P24_DBNAME.(''&P24_USERLIST.'');
    insert into log values (1,''user locked'') ;
    commit ;
    end;';
    EXECUTE IMMEDIATE v_statement;
    END;
    The problem :
    The form runs sucessfully , where I the USERLIST changes dynamicaly when I change the DBNAME values , but as soon as I logout and login with another user1 , the collection does not execute and i get "ORA-01729: database link name expected".
    I login with user1 in edit mode and recreate the collection , run again , the collection executes successfuly .
    If I create a new user2 ( using the sample application pages ) and login with the new user2 , i have the same problem , thus I ho login with user2 in edit mode and try to run the collection .
    How can I control the collection to execute regardless of the application user logged in ??
    thanks in advance
    yousef

    Hi ,
    I am having the following problem with the execution of one collection :
    Reference thread : Re: APEX 4 , executing a remote procedure and populating data using collection
    DBNAME ---> list item which I build from the DB links which I built ( as dynamic query in the shared components from a local table which holds entries of dblink names )
    USERLIST --> list item of users which should display dynamicaly the users of that db link I choose in DBNAME ( based on a collection )
    buttons CANCEL and SUBMIT
    4- Initial COLLECTION page process which is calculated before Header :
    DECLARE
    q varchar2(4000);
    BEGIN
    IF APEX_COLLECTION.COLLECTION_EXISTS(P_COLLECTION_NAME => 'QRY1') THEN
    APEX_COLLECTION.DELETE_COLLECTION(P_COLLECTION_NAME => 'QRY1');
    END IF;
    q := 'SELECT username , username FROM sys.dba_users@'||:P23_DBNAME ;
    APEX_COLLECTION.CREATE_COLLECTION_FROM_QUERY_B(
    P_COLLECTION_NAME => 'QRY1',
    P_QUERY => Q);
    END;
    For USERLIST list item I am using the following in LIST OF VALUES DEFINITION :
    SELECT C001, C002 FROM APEX_COLLECTIONS WHERE COLLECTION_NAME='QRY1'
    5 - to submit the values from the screen to the remote database procedure I am using the following submit process ON SUBMIT AFTER CALCULATIONS:
    DECLARE
    v_statement varchar2(255);
    BEGIN
    v_statement := 'begin
    Lock_User@&P24_DBNAME.(''&P24_USERLIST.'');
    insert into log values (1,''user locked'') ;
    commit ;
    end;';
    EXECUTE IMMEDIATE v_statement;
    END;
    The problem :
    The form runs sucessfully , where I the USERLIST changes dynamicaly when I change the DBNAME values , but as soon as I logout and login with another user1 , the collection does not execute and i get "ORA-01729: database link name expected".
    I login with user1 in edit mode and recreate the collection , run again , the collection executes successfuly .
    If I create a new user2 ( using the sample application pages ) and login with the new user2 , i have the same problem , thus I ho login with user2 in edit mode and try to run the collection .
    How can I control the collection to execute regardless of the application user logged in ??
    thanks in advance
    yousef

  • Apex_application.g_fXX and collection problem

    Hello all!
    In the midst of writing my second apex application, it appears I need to use apex_application functionality to meet my requirements and am seeking assistance.
    I have a table/report with a column link (item_id) and a second column (as a text field) (there are more columns displayed), but I think they are irrelevant to this situation) populated with a value QTY (c002) from a collection where c001 = item_id. What I'm attempting to do is allow someone to enter a qty in the c002 text field, apply the qty change to the collection and reload the page displaying the new quantity value in the report when the column link (image) is selected (page redirects to itself).
    Since it appears that column links are not a SUBMIT, I've put my collection update plsql in a before header process. According to the debug output, this collection insert is executed long before the rendering of the report.
    This is my report plsql;
    declare
    l_query varchar2(4000) := '';
    begin
    l_query := 'select i.INVENTORY_ID, col.c002, ql.QUANTITY_AVAILABLE, i.STRAIN_CODE, i.STRAIN_NAME, i.GENOTYPE, i.AGE, i.SEX, ql.ROOM_NUMBER from SM_INVENTORY i, SM_QUANTITY_LOCATION ql, apex_collections col where ql.STRAIN_ID = i.STRAIN_ID(+) and col.collection_name (+)= ''ORDER'' and col.c001 (+)= i.INVENTORY_ID';
    end;
    This is my update collection plsql (I don't have the insert part yet, but my collection already contains values);
    declare col_item_count number;
    col_seq number;
    item_id number;
    qty number;
    begin
    if apex_collection.collection_exists('ORDER') = FALSE then
    apex_collection.create_collection( p_collection_name => 'ORDER');
    commit;
    end if;
    for i in 1..apex_application.g_f01.count
    loop
    item_id := apex_application.g_f01(i);
    qty := apex_application.g_f02(i);
    select count(c001),seq_id into col_item_count, col_seq
    from apex_collections
    where c001 = item_id
    and collection_name = 'ORDER';
    group by c001, seq_id;
    if col_item_count > 0 then
    apex_collection.update_member(
    p_collection_name => 'ORDER',
    p_seq             => col_seq,
    p_c001 => item_id,
    p_c002 => qty);
    commit;
    end if;
    end loop;
    end;
    Given all this, my collection entry is not updated with the new value of c002 displayed in my report text field.
    Be advised, I've not found documentation about the apex_application package of sufficient detail to allow me to comprehend exactly what gets put into the apex_application.g_fXX values or when, but based on what I've gathered from examples/blogs, I think it contains the report in the currently rendered page, but I honestly don't know.
    Given my assumptions, I'm expecting apex_application.g_f01(1) would be the first row item_id of my report and apex_application.g_f01(2) would be the first row c002 (qty from my collection) of my report. If this is correct, I would expect this would work.
    What might I have missed?
    Thanks!
    Paul
    PS. Honestly, is this methodology the only/easiest way to get my requirement/functionality to work? Is there an easier way?

    OK, tried this - not yet successful. This is what I've got.
    Classic report loaded by;
    declare
    l_query varchar2(4000) := '';
    begin
    l_query := 'select i.INVENTORY_ID, i.INVENTORY_ID inv_id_hold, col.c002, ql.QUANTITY_AVAILABLE, i.STRAIN_CODE, i.STRAIN_NAME, i.GENOTYPE, i.AGE, i.SEX, ql.ROOM_NUMBER from SM_INVENTORY i, SM_QUANTITY_LOCATION ql, apex_collections col where ql.STRAIN_ID = i.STRAIN_ID(+) and col.collection_name (+)= ''ORDER'' and col.c001 (+)= i.INVENTORY_ID';
    end;
    Created a "SAVE" button.
    Set up column inv_id_hold as a hidden tab form element and col.c002 as a text field tab form element (item_id and qty respectively). These should now be available as apex_application.g_f01 and apex_application.g_f02 (right?).
    I have this post submit plsql in a process conditioned to the "SAVE" button.
    declare col_item_count number;
    col_seq number;
    item_id number;
    qty number;
    begin
    if apex_collection.collection_exists('ORDER') = FALSE then
    apex_collection.create_collection( p_collection_name => 'ORDER');
    end if;
    for i in 1..apex_application.g_f01.count
    loop
    item_id := apex_application.g_f01(i);
    qty := apex_application.g_f02(i);
    select count(c001),seq_id into col_item_count, col_seq
    from apex_collections
    where c001 = apex_application.g_f01(i)
    and collection_name = 'ORDER';
    --group by c001, seq_id;*
    if col_item_count > 0 then
    apex_collection.update_member(
    p_collection_name => 'ORDER',
    p_seq             => col_seq,
    p_c001 => item_id,
    p_c002 => qty);
    else
    apex_collection.add_member(
    p_collection_name => 'ORDER',
    p_c001 => item_id,
    p_c002 => qty);
    end if;
    end loop;
    end;
    When I enter something in my qty column and press SAVE, I get "ORA-01403: no data found" being thrown by the plsql process (per debug). Since everything is going on "under the hood" and there is no step debugger in apex, I'm not able to see/understand the process in action and determine where the problem is occurring.
    I got the idea for all of this here - http://apex.oracle.com/pls/otn/f?p=39839:3:5596350954563087::NO which is the shopping cart page of the online store application. But I'm trying to get the quantity edit portion to work on the inventory listing (so a customer can add items to an order simply by providing qty input for a particular line item(s) and saving).
    Any advice?
    Can you write an order processing system in apex that uses a collection to store line items?

  • Apex Collection Saving Issue

    Let me start out by saying that I'm new to the idea of using a collection in Oracle/Apex instead of straight DB work. That being said, I know the purpose behind it, and I believe the general idea of how to set it up and use it. That being said, I currently have an issue that I can't figure out.
    I'm working on trying to fix a program that was built by someone else who is no longer here, and they are using a collection to store data temporarily until the remainder of a survey is saved, which it then copies everything over to the database.
    I follow how the collection is created, how it is updated, and saved at the end. What I can't follow is that It is only saving part of the data when it is in IE, and NONE of the data when it is in Firefox.
    What I had done was I copied the regions from the other pages that are being used once a survey had already been created (yes, the pages are separate not by my design but it's too late to try and fix all of the current problems AND merge all the pages together. That'll be the next release, but I digress). Now I checked (and made a backup of the page thankfully) and as far as I could tell, copying the regions and items from the other page should have worked just fine since they were using the same item names. Sadly however, it stopped saving relapses.
    I checked an old version of the system, and I found the reason why. The version I am working on was apparently using the normal naming conventions of P86_RELAPSE_ID, etc, where it should have been P86_C001, etc. So, I went about the task of renaming (and updating the JavaScript that was running the page) all of the items. Well, I tested the system after only about 16 items and it saved perfectly! I was so happy. I started to apply the same changes to a few more, and the items I changed did not save. I checked and everything is setup correctly (item names, item settings, etc) so they should save the exact same way.
    So, I tried opening it in Firefox so that I could keep items side-by-side while I am comparing them, and I noticed that none of the data when I "saved" a collection was staying in Firefox, but it would "save if I did it in IE.
    I'm completely stumped at this point. Any help would be extremely appreciated. Thank you.
    (PS: I'm sorry if what I am asking isn't too clear. I'm asking two things. First, why aren't items that are setup exactly the same, and the names all match the update and add data for the collection, saving to the collection, while others are? And the second question, is why isn't anything saving using this method in Firefox.)

    The problem seems to have worked itself out.

Maybe you are looking for

  • Error while transporting the TR to production

    Dear experts, I am facing the issue of TR error while transporting it to PRD. I have already checked, the table is active both on DEV & on QUI. What should I do to transport this without any error? Thanks in advance.(Please find attached screenshot.)

  • How do I create a form in Adobe Reader

    Adobe retiring Forms Central on July 28, 2015. I would like to know what other alternatives Adobe offers.

  • File to Jdbc Scenario

    Hi All,        I am doing a File to JDBC scenario, where sender side message type occurance is 0..unbounded and receiver side message type occurance is 1 in message mapping. The whole scenario working fine when both sender and receiver side message t

  • Error while using execute immediate

    Hi, I am trying to get the record count of a table. The table name is saved in a variable.. when i am writing the code like below its working fine. SELECT count(*) into count1 FROM emp1; DBMS_OUTPUT.PUT_LINE(count1); but when i am using the code for

  • Cannot Set Up Exchange Account in Windows 8/8.1 Mail App - Need to turn off SSL

    Hi there, The office I work at is currently running an Exchange 2003 server for mail, and for reasons unknown, it isn't using an SSL certificate.  That will be changing some time in the near future, but as a result, I can't set up an email profile fo