Collections in apex

Hello

I'm trying to get the sequence of numbers in a table and display it in the text box.

But I'm 8459B958BD271490B07B643A12581312 despite a character '02'

As this is my first time in the collections don't know what I'm doing

Thank you

Sudha

Code comments

You're code works correctly.

MD5 - Wikipedia, the free encyclopedia

APEX_COLLECTION. GET_MEMBER_MD5

Because you are a random string of characters is the MD5 checksum for the data row.

With the help of a Collection:

Once you have data in a collection, you use the APEX_COLLECTIONS view to access the data in an efficient way.

Keep in mind, APEX_COLLECTIONS contains all of the values for all of the collections for your apex session.

code example

select C002 -- this should match your ADD_MEMBER() statement
  into :temp
from APEX_COLLECTIONS
where collection_name='GRADES'
  and seq_id=1;

MK

Tags: Database

Similar Questions

  • Collection of Apex of access that is created as part of the wizard to load data

    Hi all

    I tried to figure out how to access the Collection of Apex that stores data related to the data load.

    Please need documentation that may help understand the process.

    Hi all

    In the upload form, we have 4 Pages / screen, each screen has an associated collection of Apex.

    Below the Apex Collection are associated with Pages

    "SPREADSHEET_CONTENT" - page 1

    "PARSE_COL_HEAD" - Page 2

    "LOAD_CONTENT" - Page 3

    "LOAD_COL_HEAD" - Page 3

    "FIN_LOAD_CONTENT" - Page 4

    What interested me was in the PARSE_COL_HEAD that lists the columns that are not mapped on the 2nd Page, (data map).

    So now that we know the collection of the Apex, I will ask the Collection:

    Select count (c002) in the CNT from apex_collections where 'PARSE_COL_HEAD' and C002 = collection_name = "DO_NOT_LOAD";

    If you want to see it working, I created an example on the link below:

    https://Apex.Oracle.com/pls/Apex/f?p=14281:6:116138945234588:no:

    User: DONOTMAP

    Password: 12345

    Please let me know if more details needed on implementation and detailed as follows.

  • Collections of apex

    When I do a
    select * 
    from apex_collections
    I always get a 'no data found.' even though my request was told that there is indeed a collection of apex.

    For debugging purposes, what is the best way to see what is contained in a collection of apex at some point in time?

    Published by: tharpa on March 21, 2011 10:46

    Hello

    Developer toolbar control session
    http://download.Oracle.com/docs/CD/E17556_01/doc/user.40/e15517/concept.htm#sthref108

    Or create a report to your app or completely new page.
    I sometimes create a completely new page and interactive report by selecting * of apex_collections

    Kind regards
    Jari

  • From the APEX Collections out APEX?

    We have a system developed in the APEX that generates reports using plsql returning a query. These query parameters are passed using the APEX collection infrastructure. This allows you to run various reports and add them to the system by simply inserting the code in a table.

    Anyway, it was suggested that we might be able to schedule the report to run using the Oracle Applications and a concurrent request. What we'd probably do would be to a txt file using "immediate execution" of the spool and print it out. The next issue is of course to get the parameters set up with their respective values.
    I have tried this in the code and get an error:
    BEGIN
      wwv_flow_api.set_security_group_id(apex_util.find_security_group_id('OUR_WORKSPACE_NAME'));
      apex_collection.create_collection('XXTEST');
      apex_collection.add_members('XXTEST', p_c001 => apex_application.g_f01);
    END;
    This returns the error:
    ORA-01400: cannot insert NULL into ("FLOWS_030100"."WWV_FLOW_COLLECTIONS$"."SESSION_ID")
    ORA-06512: at "FLOWS_030100.WWV_FLOW_COLLECTION", line 288
    ORA-06512: at line 3
    Then... Is it possible, we can use the framework of collections of APEX to outside the APEX?


    Thank you
    John

    Yes,

    I was testing. Like, after you have created the session I chose v double ('APP_SESSION'), and he returned very well, so there is obviously more behind the scenes of transformation that takes place in APEX, so that the session available in the table of $ wwv_flow_sessions.

    Maybe you could just piggy back on a session that is new enough to be always available, but old enough that it is no longer used (through one of the points of view APEX).

    Van
    Trent

  • Error ORA-01445 tabular form on a Collection in APEX 5

    When I load a page with a tabular presentation built on a display of a collection to the APEX 5, I'm getting an ORA-01445: cannot select ROWID, or the sample, a view of joining without an error table preserved key.

    I create a view

    CREATE or REPLACE FORCE VIEWS test_coll_vw

    (

    C001,

    C002,

    C003,

    C004,

    seq_id

    )

    AS

    SELECT TO_NUMBER (c001),

    C002,

    TO_NUMBER (c003),

    TO_NUMBER (c004),

    seq_id

    Of apex_collections

    WHERE collection_name = 'TEST '.

    Then create a tabular presentation on the view with the primary key of the source SEQ_ID and primary key of the trigger existing through the wizard.

    Debug information shows the statement which is a failure:

    Select NULL NULL "CHECK$ 01", "SEQ_ID,' NULL 'C001', NULL"C002', 'C003', 'C004', NULL NULL NULL "APEX$ ROWID ' sys.dual union all select ' CHECK$ 01", 'SEQ_ID', 'C001', 'C002', 'C003', "C004", "APEX$ ROWID" in (select NULL "CHECK$ 01", "SEQ_ID", "C001", "C002", "C003", "C004", "ROWID" "APEX$ ROWID" (select).

    "SEQ_ID."

    "C001."

    "C002."

    "C003."

    "C004.

    of 'WPCAMS_APP '. "" TEST_COLL_VW ".

    ) APEX$ RPTSRC

    order of 1, 7

    ).

    These tabular forms worked up to 4.2, but they seem to fail at 5 APEX for upgrade or newly created pages one.  The generated query is identical between versions, but it seems that the underlying apex_collections view has changed between versions and the origin of the problem.

    Does anyone have a solution or workaround?

    Thank you

    Hi Phil,

    APEX 5.0 the definition of the view of apex_collection had to be changed for security reasons. This change introduced a regression with tabular form validations, when the table refers to this view. Tabular form declarative validations require the ROWID in order to restore your changed data after a validation failed, and for this reason, APEX is insert the IDENTIFIER in the query in a table. It is currently not possible when tables refers to the sight of apex_collections. We are looking at a solution to this problem, but for now the only way to get around this is not, in this case, use the declarative validation and use some custom validations or process.

    Kind regards
    Marc

  • DBMS_SQL and Collections of APEX

    Setup

    Apex 4.2.3

    listener 2.0.5

    Oracle 11.2.0.x

    Apex. Oracle.com

    https://Apex.Oracle.com/pls/Apex/f?p=50968

    Developer/trymeout

    problem

    I have a special case where I need to use a dynamic SQL code to populate a Collection

    (I'm still working on avoiding that...)

    According to the APEX Documentation, it seems that you can use right cursor number of DBMS_SQL.

    However, when I try, I get ORA-29470.

    ORA-20104: create_collection_from_query error:

    ORA-20104: create_collection_from_query ExecErr:

    ORA-29470: effective Userid or roles are not the same when the cursor was analyzed

    And if I open the cursor with "security_level = > 0", I get:

    ORA-29474: DBMS_SQL. OPEN_CURSOR failed. security_level 0 is not allowed.

    In regards to the APEX_COLLECTION using the number of cursor, it's a known bug?

    Any other comments/suggestions/response?

    Thank you

    MK

    Easier review process:

    declare
      c int;
      l_sql varchar2(32000);
      l_collection_name varchar2(50) := 'DBMS_SQL_RESULTS';
    begin
      -- this is only an EXAMPLE sql
      l_sql := 'select * from emp';
    
      -- DBMS_SQL stuff
      c := dbms_sql.open_cursor(
                  security_level => 1 -- default is 1.  0 === no security check
               );
      dbms_sql.parse( c, l_sql, DBMS_SQL.NATIVE );
      -- place DBMS_SQL.BIND_VARIABLES() here
    
      -- collections stuff
      if apex_collection.collection_exists( l_collection_name )
      then
        apex_collection.delete_collection( l_collection_name );
      end if;
    
      -- NOTICE I am using the cursor number, not SQL statement
      apex_collection.create_collection_from_query( l_collection_name, c );
    end;
    
    

    Hello

    I encountered the same problem when upgrading a database from Oracle 10 g to 11 g. The latter has additional security to protect against the "misuse of cursor" or somesuch.

    Since you are using 4 Apex, you can work around the problem by using instead the CREATE_COLLECTION_FROM_QUERY_B (the 'B' is 'essential', it will make your code more quickly, too!), since this procedure allows to make the call as to bind the variable names and values, thus negating the need to use dbms_sql yourself. See docs here: APEX_COLLECTION

    A workaround for Apex 3 (and Oracle 11 g) is to open the cursor dbms_sql and loop through it, call apex_collection.add_members for each line. Obviously, this will be slower than the procedure in bulk, but at least you can avoid the ORA-29470.

    -Morten

    http://ORA-00001.blogspot.com

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

    I couldn't find a simple example to do
    Apex 4.2

    I need to create a collection of the apex. I have a query that returns multiple roles for a user. I need to check to see if one of my values of point is within the collection, but I'm not sure how. So far, I have:

    Start
    APEX_COLLECTION. () CREATE_COLLECTION
    p_collection_name = > 'ALL_ROLES');

    Select count (granted_role) in the County of dba_role_privs where upper (grantee) = upper(:APP_USER);

    end;

    How would store the query results in the collection?

    Even shorter

    declare
      v_count number;
    begin
      if :P32_SUBMISSION_DATE is null
      then
        return false;
      end if;
      select count(*) into v_count
      from dba_role_privs
      where upper(grantee) = upper(:APP_USER)
      and  granted_role in ('SURVEY_SUID','SURVEY_JOB_SUID');
    --
      return v_count > 0;
    end;
    

    Note that with a combined function as count you will never get an exception no_data_found

  • Collection of apex...

    I put the code below in the application process. Using Ajax I call this process and tried to throw and get the value of the book collection and display a field. but the value * "a."
    is not stored in p_c001.

    How to find if coding below runs in this process?

    Application process on request
    declare
    b varchar2(4000);
    begin
    IF APEX_COLLECTION.COLLECTION_EXISTS('BOOK') THEN
    APEX_COLLECTION.DELETE_COLLECTION('BOOK');
    END IF;
    apex_collection.create_collection(p_collection_name=>'book');
    apex_collection.add_member(
    p_collection_name=>'book',
    p_c001 => 'a');
    select c001 into b from apex_collections where collection_name='book';
    htp.prn(b);
    end;
    Global JavaScript-java and fuctional
    function get_id(){
    
    
    var get = new htmldb_Get(null,html_GetElement('pFlowId').value, 'APPLICATION_PROCESS=COL',0);
    
    
    var gReturn = get.get();
    
    document.getElementById('P2_ID').value = gReturn;
    
    }
    After that this error below process is back on the ground
    SQLERRM:ORA - 01403: no data found



    How to get the value of p_c001?

    Published by: skud on April 8, 2011 22:19

    Published by: skud on April 8, 2011 22:43

    Hello

    Write the name of the collection always in capital letters
    >
    Appellation collections

    When you create a collection, you must give it a name that cannot exceed 255 characters. Note that collection names are not case-sensitive, and will be converted to upper case.

    Once the collection is named, you can access the values in the collection by running a SQL query on the view APEX_COLLECTIONS.
    >
    http://download.Oracle.com/docs/CD/E17556_01/doc/apirefs.40/e15519/apex_collection.htm#BABBCHID

    DECLARE
      b VARCHAR2(4000);
    BEGIN
      IF APEX_COLLECTION.COLLECTION_EXISTS('BOOK') THEN
        APEX_COLLECTION.DELETE_COLLECTION('BOOK');
      END IF;
    
      apex_collection.create_collection(p_collection_name => 'BOOK');
    
      apex_collection.add_member(
        p_collection_name => 'BOOK',
        p_c001 => 'a'
      );
    
      SELECT c001
      INTO b
      FROM apex_collections
      WHERE collection_name = 'BOOK';
    
      htp.prn(b);
    
    END;
    

    Kind regards
    Jari

  • Check the box of a CASE for a Collection of Apex statement

    Attempt to use a case statement to determine the day of the week in the field of LINEITEM_DATE2, then
    Place the REG_HOURS in the new columns in the collection representing the days of the week.
    The case statement below (in bold) just doesn't. I even tried when a simple and hardcode
    a value. So is it possible that way?

    I / P looks like this___
    ATT_CODE REG_HOURS LINEITEM_DATE2
    P 4 JUNE 14, 10
    P 8 JUNE 16, 10
    P 2 JUNE 14, 10
    P2 8 15 JUNE 10

    Collection of the O/P should look like this___ (light version)
    ATT_CODE Monday Tuesday Wednesday
    6 8 P
    P2 8

    declare
    date of V_DATE;
    Monday varchar (4): = '0';

    Start

    If htmldb_collection.collection_exists ("TIMECOLLECTION") = FALSE
    then htmldb_collection.create_collection (p_collection_name = > 'TIMECOLLECTION');
    commit;
    on the other
    C1 in (select collection_name, seq_id)
    of htmldb_collections
    where collection_name = "TIMECOLLECTION")
    loop
    () htmldb_collection.delete_member
    p_collection_name = > c1.collection_name,
    p_seq = > c1.seq_id);
    commit;
    end loop;
    end if;
    -V_DATE: = to_date(:A_CURRENT_MONDAY_WEEK,'DD-MON-RR');
    V_DATE: = to_date (June 14, 10 ',' DD-MON-RR');

    for rec in (select
    ATT_CODE,
    REG_HOURS,
    LINEITEM_DATE2 as HOUR,
    CASE
    WHEN to_date (LINEITEM_DATE2, 'DD_MON_RR') = to_date (V_DATE, 'DD_MON_RR')
    THEN REG_HOURS
    ELSE ' 0'
    END like Monday
    of TRANSACTIONTIME
    where: A_BADGE = BADGE
    and LINEITEM_DATE2 > = V_DATE
    and LINEITEM_DATE2 < = V_DATE + 6)
    loop
    () htmldb_collection.add_member
    p_collection_name = > 'TIMECOLLECTION ',.
    p_c001 = >-1,
    p_c003 = > rec. HOUR,.
    p_c004 = > rec. ATT_CODE.
    p_c005 = > REC CC,.
    p_c006 = > rec. PC_ID.
    p_c007 = > rec.WO,
    p_c008 = > Monday.
    p_c009 = > V_DATE + 1,
    p_c010 = > V_DATE + 2,.
    p_c011 = > V_DATE + 3,
    p_c012 = > V_DATE + 4.
    p_c013 = > V_DATE + 5.
    p_c014 = > V_DATE + 6);
    end loop;

    END;

    Hello Shelly,

    V_DATE's date , it means that you needn't to_date:

    CASE
    /*WHEN to_date(LINEITEM_DATE2, 'DD_MON_RR') = to_date(t_date, 'DD_MON_RR')*/
    WHEN LINEITEM_DATE2 = t_date
    THEN REG_HOURS
    ELSE '0'
    END as monday
    

    I guess that LINEITEM_DATE2 is of type date .

    If you want to compare without time then

    CASE
    /*WHEN to_date(LINEITEM_DATE2, 'DD_MON_RR') = to_date(t_date, 'DD_MON_RR')*/
    WHEN trunc(LINEITEM_DATE2) = trunc(t_date)
    THEN REG_HOURS
    ELSE '0'
    END as monday
    

    I also think that:

     p_c008 => monday,
    

    Must be:

     p_c008 => rec.monday,
    

    Lev

    Published by: the on June 23, 2010 13:12

  • Updated APEX collection error ORA-04044: procedure, function, package, type

    Hi all

    I am trying to update the APEX MEMBER of the COLLECTION and encounter errors:


    1 error has occurred
    ORA-06550: line 9, column 8: PL/SQL: ORA-04044: procedure, function, package or type is not allowed here ORA-06550: line 7, column 3: PL/SQL: statement ignored

    The PLSQL code are as below

    DECLARE
    entire x;
    v_date_started VARCHAR2 (255);
    v_date_finished VARCHAR2 (255);
    BEGIN
    SELECT c.seq_id
    X
    OF APEX_COLLECTION c
    WHERE collection_name = "PHASE_COLLECTION."
    AND c001 =: P41_MPM_ID
    and rownum = 1;
    v_date_started: =: P41_DATE_STARTED;
    v_date_finished: =: P41_DATE_FINISHED;

    APEX_COLLECTION. () UPDATE_MEMBER
    p_collection_name = > 'PHASE_COLLECTION '.
    , p_seq = > x
    , p_c004 = > v_date_started
    , P_c005 = > v_date_finished
    );
    END;


    The process will take place after SUBMIT and validation.

    The code I used to add a colletion APEX will work perfectly and is as below

    -Initialization Collection PHASE_COLLECTION
    BEGIN
    IF THIS ISN'T APEX_COLLECTION. COLLECTION_EXISTS('PHASE_COLLECTION') THEN
    APEX_COLLECTION. CREATE_COLLECTION ('PHASE_COLLECTION');
    ON THE OTHER
    APEX_COLLECTION. TRUNCATE_COLLECTION ('PHASE_COLLECTION');
    END IF;
    -Add members to the COLLECTION PHASE of table PHASE_MEMBERSHIP
    IF: P41_MPM_ENG_ID IS NOT NULL THEN
    FOR x IN (SELECT mpm_id, mpm_eng_id, phase_number, date_started, date_finished, date_created
    OF phase_membership
    WHERE mpm_eng_id =: P41_MPM_ENG_ID
    AND active = 1
    ORDER BY date_created)
    LOOP
    APEX_COLLECTION. ADD_MEMBER
    (p_collection_name = > 'PHASE_COLLECTION')
    , p_c001 = > x.MPM_ID
    , p_c002 = > x.MPM_ENG_ID
    , p_c003 = > x.PHASE_NUMBER
    , p_c004 = > x.DATE_STARTED
    , p_c005 = > x.DATE_FINISHED
    , p_c006 = > x.DATE_CREATED

    );
    END LOOP;
    END IF;
    EXCEPTION
    WHILE OTHERS THEN
    Logger.Error (p_message_text = > SQLERRM)
    , p_message_code = > SQLCODE
    , p_stack_trace = > dbms_utility.format_error_backtrace
    );
    LIFT;
    END;


    What I tried to use APEX_COLLETION to check the overlap between the date_range.
    The requirement is just to display a warning if the user adds a record to the new phase or update record of current phase may overlap between the order of phase together.
    Table PHASE_MEMBERSHIP script is

    CREATE TABLE 'PHASE_MEMBERSHIP '.
    (
    ACTIVATE THE "MPM_ID" NUMBER NOT NULL,
    ACTIVATE THE "MPM_ENG_ID" NUMBER NOT NULL,
    ACTIVATE THE "PHASE_NUMBER" NUMBER (2.0) NOT NULL,
    "DATE_STARTED" DATE NOT NULL ACTIVATE.
    DATE OF THE "DATE_FINISHED."
    'NOTES' VARCHAR2 (2000 BYTE),
    'DATE_CREATED' DATE NOT NULL ACTIVATE.
    ACTIVATE THE 'CREATED_BY' VARCHAR2 (20 BYTE) NOT NULL,
    NUMBER (2.0) 'ACTIVE' DEFAULT 1 ACTIVATE NOT NULL)

    So, basically, I want to fill the documents associated with a particular to a collection of APEX called PHASE_COLLECTION MPM_ENG_ID.
    Then when the user specify date_started and date_finished, it will update/insert the APEX collection first.
    Then the rank based on audit collection date
    http://www.Oracle-base.com/articles/Misc/overlapping-date-ranges.php
    then display the warning to ask the user to confirm message.

    But then I'm stuck at the step of updating COLLECTION of APEX.

    If anyone has any ideas on what is wrong, please help.

    Thanks in advance.

    Ann

    Your syntx error line number should give you the trick - it is not a member of the update, rather the SQL - you are referring to apex_collection, not apex_collections view dictionary.

    Scott

  • Several elements of Application or Apex Collection?

    Hey everybody,

    I was wondering if I could get a glimpse on a novelty, I want to add my company to current APEX app.
    There is a set of 15-20 variables that will unfold in a database table that will determine some
    messages, images etc. which will appear on the application of the apex.

    I was wondering would it be better for the performance to create 20 items in application to hold these data, or a collection of Apex would be more appropriate.

    Codes says:
    I was wondering would it be better for the performance to create 20 items in application to hold these data, or a collection of Apex would be more appropriate.

    Whichever is easier for you to do work and performs very well (speed)

    If the elements are different, then the different elements may work better. If the elements are an extensible set of the same type of question as ID of employee or dates, then a collection might work better. Remember that if they are the same one editor could allow you to write less code for processing by a loop through the contents of the collection

    Edited by: riedelme may 18, 2011 14:02

  • APEX 4.01 collections rendering problem

    I'm creating a collection using apex 4.01.

    I created an application with a blank page.
    I then added a region on the page.
    I've created a report in the region with a source of the sql query. I then placed the query in the source section.

    I created a load on before the header process which loads the EMP table collection.

    When I run instead of getting my output display as intended in the collection, it displays the data in the html tags. Its as if the HTML is not be stripped.
    I see where in the attributes report there is an option to strip HTML. I set to Yes. Its in the section layout and pagination of the attributes of the rpt.

    Here is an example of what the report is rendered:

    < input type = "hidden" name = "f01" value = "7934" / > < span > </span > 7934 < input type = "text" name = "f02" size = "10" maxlength = value "2000" = "MILLER" / >

    Make sure the column attribute display as for the report column is column of Standard report.

  • apex collection

    See the following code. P1_ITEM this is a multiple selection and record its values in a collection of the apex.
    But in the cases where the user does not take anything from the multiple selection, I want to store the data in a table in this collection of apex.
    How do I realize I used if-then-else and bulk collect to extract the data from the table in a table. And this table used in apex_colection.add_member. But it did not work.
    Can someone help me with the code of he?


    DECLARE
    v_arr apex_application_global.vc_arr2;

    BEGIN

    v_arr: = APEX_UTIL. STRING_TO_TABLE(:P1_ITEM);

    APEX_COLLECTION. CREATE_OR_TRUNCATE_COLLECTION (p_collection_name = > 'PCOL');

    IF REPLACE(:P1_ITEM,':') IS NOT NULL THEN
    BECAUSE me in 1... v_arr. Count
    LOOP
    APEX_COLLECTION. ADD_MEMBER)
    p_collection_name = > 'PCOL. "
    p_c001 = > v_arr (i)
    );
    END LOOP;
    ON THE OTHER
    ..
    END IF;
    END;

    Hello

    Select the list and multiselect is set to null by default % null
    http://Apex-SMB.blogspot.com/2009/07/how-to-resolve-null-issue-in-apex-lovs.html

    Try

    IF NVL(:p1_item,'%'||'null%') != '%'||'null%'
    THEN
    FOR i IN 1 .. v_arr.count
    LOOP
    apex_collection.add_member(p_collection_name => 'PCOL', p_c001 => v_arr(i));
    END LOOP;
    ELSE
    apex_collection.add_member(p_collection_name => 'PCOL', p_c001 => 99);
    END IF;
    

    BR, Jari

  • Apex Data Wizard

    Hi all

    We use the care Assistant apex, now during the Validation process, we want to perform validation custom, is there a way that we can access the data? Please suggest?

    Hi all

    In the upload form, we have 4 Pages / screen, each screen has an associated collection of Apex.

    Below the Apex Collection are associated with Pages

    "SPREADSHEET_CONTENT" - page 1

    "PARSE_COL_HEAD" - Page 2

    "LOAD_CONTENT" - Page 3

    "LOAD_COL_HEAD" - Page 3

    "FIN_LOAD_CONTENT" - Page 4

    What interested me was in the PARSE_COL_HEAD that lists the columns that are not mapped on the 2nd Page, (data map).

    So now that we know the collection of the Apex, I will ask the Collection:

    Select count (c002) in the CNT from apex_collections where 'PARSE_COL_HEAD' and C002 = collection_name = "DO_NOT_LOAD";

    If you want to see it working, I created an example on the link below:

    https://Apex.Oracle.com/pls/Apex/f?p=14281:6:116138945234588:no:

    User: DONOTMAP

    Password: 12345

    Please let me know if more details needed on implementation and detailed as follows.

  • Import of Excel in DB in APEX 5 spreadsheets

    Hello

    Previous versions of APEX had limitation that I can't import spreadsheets. We had their conversion overhead. CSV and then download.

    Do we have any mechanism or plug-in which allows to import of spreadsheets in DB.

    Concerning
    Animesh

    - Process Type Plugin - EXCEL2COLLECTIONS can load spreadsheets into a collection of Apex

Maybe you are looking for