APEX Collection - how to process

Hello all.
I am fairly new to apex and using apex 4.0. I have a SQL report based on collections, with 2 columns updateable. Following is the query.
SELECT APEX_ITEM.TEXT(1,SEQ_ID) AS SEQ_ID,
APEX_ITEM.TEXT(2,c001) AS R_TYPE,
APEX_ITEM.TEXT(3,c002) AS TA_ID,
APEX_ITEM.TEXT(4,c003) AS ANSWER_ID,
c008 AS R_TITLE,
CASE WHEN c001 = 'QUESTION'
THEN APEX_ITEM.CHECKBOX(40,c009)
ELSE APEX_ITEM.HIDDEN(40,c009) END AS ANSWER_Y_N,
CASE WHEN c001 = 'QUESTION' AND c011 = 'Y'
THEN APEX_ITEM.TEXTAREA(41,c010,3,40)
ELSE APEX_ITEM.HIDDEN(41,c010) END AS ANSWER_TEXT,
APEX_ITEM.TEXT(11,c011) AS TEXT_FLAG
FROM APEX_COLLECTIONS
WHERE COLLECTION_NAME = 'AUDIT_ANSWER'
AND c002 = :P18_TA_ID
ORDER BY c004, c005, c006, c007
ANSWER_ID is the primary key which is not displaying. R_TITLE is the question which is display only. ANSWER_Y_N is a column having Y or Null answers. ANSWER_TEXT is enterable comment column.
After SAVE button, it fires page process (On Submit - Before computations) having following code -
BEGIN
FOR i IN 1..APEX_APPLICATION.G_F04.COUNT
LOOP
IF APEX_APPLICATION.G_F02(i) = 'QUESTION'
THEN
APEX_COLLECTION.UPDATE_MEMBER_ATTRIBUTE('AUDIT_ANSWER', APEX_APPLICATION.G_F04(i), '9', APEX_APPLICATION.G_F40(i));
APEX_COLLECTION.UPDATE_MEMBER_ATTRIBUTE('AUDIT_ANSWER', APEX_APPLICATION.G_F04(i), '10', APEX_APPLICATION.G_F41(i));
END IF;
END LOOP;
FOR r IN ( SELECT c003, c009, c010
+     FROM APEX_COLLECTIONS+
+     WHERE COLLECTION_NAME = 'AUDIT_ANSWER' )+
LOOP
UPDATE VW_OTA_AUDIT_ANSWERS
SET ANSWER_Y_N  = r.c009,
ANSWER_TEXT = r.c010
WHERE ANSWER_ID = r.c003;
END LOOP;
END;
It is not updating the collection. What could be the problem here.
Edited by: 930664 on Nov 29, 2012 3:53 AM

Hi, to all.
Sorry if I introduce here my question, and not create another thread, I made my example in application from the owner of this thread (hope he doesn't mind) at page 2, because in my workspace didn't work, don't know why.
Here is my question: Why after navigate in interactive reports headings are disappears. I have one apex_collection for which I want dynamic headings, and it seams only first time they appear.
Link http://apex.oracle.com/pls/apex/f?p=40150:2:7122052600559::NO:::

Similar Messages

  • 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

  • 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.

  • 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*

  • 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

  • How to process the PDF files at one time

    Hello,
    I'm using WebDynpro for ABAP and Adobe Interactive Forms as offline forms.
    I collect PDF files from received e-mails.
    I want them to be taken in at one time.
    (for example,
    system job read PDF files and create data in ERP,
    or I upload the files one time.)
    Please let me know
    - How to process the PDF files at one time.
    Best regards,
    Koji

    When you click the edit button in recents, try clicking the clear button in the upper left.

  • 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).                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                       

  • 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.

  • 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

  • Collective sales order processing

    I attended an interview recently where a question is asked -->how to process 4 sales order i.e collective sales order processing.What is the tcode for it?
    Can anyone  explain it.
    Thanks.

    Hi,
    Tcode VL04/VL10C
    here you can give the selection criteria as sales order numbers,shipping points etc.
    Remember that plant,shipping point and ship to parties must be same to successfully combine the orders into single delivery.
    After selection criteria execute.
    Reward points if useful
    Regards,
    Amrish Purohit

  • 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,

  • Collections Work Item (Processing deadline)

    Hello Colleagues,
    I am trying to determine how the Processing deadline works for Collections Work Items in IS-U.
    If I assign a Work Item Category a Processing deadline of 7 days,  (Mandatory = Blank) and I trigger a Work Item today,  I can see that the Run Date on the header table DFKKWL is set to 7 days past the creation date of the Worklist.
    However, when I do run dunning with Issue date 7 days later, the Work Item is not closed (Still Open). This is not an enforcement work item.
    If you have successfully worked with Processing Deadlines before, I'd really appreciate it if you could share your experiences.
    Thanks a lot.
    Regards,
    Ivor Martin

    Hi William,
    in my project we want to use processing deadlines to automatically close work items when run date is past for work items (mandatory= blank and enforcement= blank) which are still open (statuts New or In process). This should be done before dunning is launched each day.
    I understood that the processing deadline is informational and has no functionality in dunning.
    But I was hoping that a standard way would exist do it? (in function module FKK_0350_WLI_CREATE_AND_CLOSE, or other standard program to launch)
    I didn't find anything about that and any help would be appreciated.
    Thanks a lot.
    Regards,
    Emilie

  • How to process Customer Open Items? If that Customer is also an Vendor.

    Hi All,
    I need some help for  the below configuations,
    1. How to process Customer Open Items? If that Customer is also an Vendor to the Company. ( How to adjust these open amounts)
    1. How to process Vendor Open Items? If that Vendor is also an Customer to the Company. ( How to adjust these open amounts)
    Thanks
    Chandra

    Hi Chandra,
    In addition to all the above, if the Customers and Vendors are in different company codes, then, you would have to also do the following configuration.
    Execute transaction code <b>OBYA</b>, when prompted, type in 1st coy code, say A and then 2nd coy code, say B. This would take you to the "<b>Maintain FI Configuration: Automatic Posting - Clearing Accounts</b>" screen.
    In the first frame, where you have
    Posted in : A
    Cleared Against : B
    Under Receivable
    Debit Posting Key : <b>01</b>
    Account Debit : Account Number (The account can be a G/L account, a customer account or a vendor account)
    Under Payable
    Credit Posting Key : <b>31</b>
    Account Credit : Account Number (The account can be a G/L account, a customer account or a vendor account).
    In the second Frame
    Posted in : B
    Cleared Against : A
    Under Receivable
    Debit Posting Key : <b>01</b>
    Account Debit : Account Number (The account can be a G/L account, a customer account or a vendor account)
    Under Payable
    Credit Posting Key : <b>31</b>
    Account Credit : Account Number (The account can be a G/L account, a customer account or a vendor account).
    So, if you are using the Customer/Vendor approach, company A must be set up as both a Customer(Use Txn Code <b>XD01</b>) and a Vendor(USe Txn Code <b>XK01</b>) in Company B and vice versa.
    Once you have completed this set-up, you can then use transaction <b>F.13</b> and/or <b>F13E</b> to carry out your automatic clearing.
    However, if you intend to use the G/L approach, then the account numbers would be Inter-coy G/L account for each coy code as defined in the chart of accounts.
    I hope the above helps.
    Do not forget to award the points please.
    Regards,
    Jacob

  • URGENT - HOW TO PROCESS A BDC SESSION (IN BACKGROUND) FROM INSIDE A REPORT

    Hi All,
    I have a requirement wherein I need to create a BDC session for mass update(from file) of one transaction and check if at all that update has taken place and proceed with the same session for another transaction.
    For this I need to know how to process the session in background in a report, so that if the processing is done, the next set of data to update a different transaction can happen.
    All inputs are welcome and highly valuable to me.
    If someone is unable to intrepret this, I'll detail it again.
    Thanks in advance,
    Vaishnavi Varadarajan

    Hi,
    1.Use RSBDCDRU is an exe pg.With this u can download the logs into local file.
    2.It will create the spool request .from there u can download or print.
    OtherWise:
    Use the code from the link below. U need to provide the session queue id as input and it will download the log to an excel file. U can change it to  ur reqmt.
    Re: BDC
    regards
    kiran

  • How to process each records in the derived table which i created using cte table using sql server

    I want to process each row from the CTE table I created, how can I traverse from first row to second row and so on....
    how to process each records in the derived table which i created using  cte table using sql server

    Ideally you would be doing a set based processing rather than traversing row by row as thats more efficient. To answer it specific to your scenario we may need more info. Can you explain with some sample data your exact requirement?
    Please Mark This As Answer if it solved your issue
    Please Mark This As Helpful if it helps to solve your issue
    Visakh
    My MSDN Page
    My Personal Blog
    My Facebook Page

Maybe you are looking for

  • List of Web Reports & corresponding Roles

    Hi, I'm looking for some table or something which can provide me the list of all Web Reports and corresponding Roles to which they are assigned. Does anybody know how to find it? Regards, Vikrant.

  • Installatiion of EHP1 SAP NetWeaver Comp Environ 7.1 - Preview Version

    Hello, I am having some problems in installation. Please find the details below: - During phase 23 (Install instance basic) of the installation, I got the pop-up which the following message in it: - "An error occurred while processing option SAP NetW

  • External font in an applet

    How can I use a non windows font in my applet? Its a ttf font. The font file, applet class file and the htm file have to be in the same directory on my webserver.

  • Getting rid of duplicate songs: a lot of them!

    I've imported my iTunes songs from my old PC to my new iMac but everything has been duplicated so now there is two of every song!! It's a nightmare deleting each one separately, so any suggestions for a quick solution? Should I delete the lot and the

  • Mystery conflicts from events that never occured

    Help! During syncs, the conflict resolver reports routinely that I have a great number of sync conflicts that must be resolved between iCal and SOHO Sync. Confusingly, I find that the supposed conflicts are bizarre echoes of events that may (appointm