What can you do with APEX_COLLECTION

The APEX_COLLECTION (Oracle 12c onwards) package can be a good choice when you need to work with
data in a temporary, in-memory table-like structure.

When should I use the APEX_COLLECTION?

  1. Temporary data storage: If you need to temporarily store data that is
    generated by a report or a form, using APEX_COLLECTION can be a good option. Since the
    data is stored in memory rather than in a physical table in the database, you don’t need
    to worry about the overhead of creating and managing a database table.
  2. Working with large datasets: If you need to work with large datasets,
    APEX_COLLECTION can be more efficient than other options, such as creating a temporary
    table in the database. Since the data is stored in memory, it can be accessed and
    manipulated more quickly than data that is stored in a physical table.
  3. Non-persistent data: If you don’t need to persist the data between
    sessions or across different users, APEX_COLLECTION can be a good choice. Since the data
    is stored in memory, it is automatically cleared when the session ends or when the user
    logs out.
  4. Flexible data structure: APEX_COLLECTION provides a flexible data
    structure that can be easily modified at runtime. You can add, update, and delete
    records as needed, and you can define the structure of the collection dynamically based
    on your requirements.

When should I avoid it?

While APEX_COLLECTION can be a useful tool for working with temporary data in Oracle APEX,
there are some scenarios where it may not be the best choice. Here are a few situations
where you may want to consider alternative approaches:

  1. Large or complex datasets: While APEX_COLLECTION can be efficient for
    working with large datasets, it may not be the best choice for very large or complex
    datasets. In such cases, it may be better to use a physical table in the database or a
    dedicated data store, such as a NoSQL database or a document store.
  2. High transaction volume: If you have a high volume of transactions or
    concurrent users, APEX_COLLECTION may not be able to keep up with the demand. In such
    cases, it may be better to use a dedicated database table or another data storage
    mechanism that is optimized for high performance.
  3. Data persistence: If you need to persist the data across sessions or
    across different users, APEX_COLLECTION may not be the best choice. While the data is
    stored in memory and can be accessed quickly, it is not durable and will be lost when
    the session ends or when the user logs out. In such cases, it may be better to use a
    dedicated database table or another data storage mechanism that is designed for
    durability and persistence.
  4. Complex data structures: While APEX_COLLECTION can be flexible and
    dynamic, it may not be the best choice for working with very complex data structures or
    data types. If you need to work with data that has a complex or hierarchical structure,
    it may be better to use a dedicated data store or a specialized data modeling tool that
    is designed to handle such data.

That being said, there are also some limitations to using APEX_COLLECTION, such as the
inability to create indexes or enforce constraints, and the limited support for complex data
types. In some cases, it may be more appropriate to use a physical table or other data
storage
mechanism, depending on your specific requirements and use case.

 Alright, now that you know the pros and cons, here is a basic tutorial of what you need to work
with it.

Using APEX_COLLECTION

Create an APEX collection:

You can create an APEX collection using the APEX_COLLECTION.CREATE_COLLECTION procedure. This
procedure
creates a new collection with the specified name and collection type.

BEGIN
APEX_COLLECTION.CREATE_COLLECTION(
p_collection_name => 'MY_COLLECTION',
p_collection_type => 'APEX_COLLECTION_TYPE_VARCHAR2'
);
END;

Add records to the collection:

You can add records to an APEX collection using the APEX_COLLECTION.ADD_MEMBER procedure. This
procedure
adds a new record to the specified collection with the specified values.

BEGIN
APEX_COLLECTION.ADD_MEMBER(
p_collection_name => 'MY_COLLECTION',
p_c001 => 'John',
p_c002 => 'Doe',
p_c003 => 'johndoe@example.com'
);
END;

Access records in the collection:

You can access the records in an APEX collection using the APEX_COLLECTION.GET_MEMBERS function. This
function returns a cursor that can be used to iterate over the records in the collection.

DECLARE
l_cursor apex_t_varchar2;
l_rec apex_collection_types.apex_collection_varchar2_nt;
BEGIN
l_cursor := apex_collection.get_members(p_collection_name => 'MY_COLLECTION');
LOOP
FETCH l_cursor BULK COLLECT INTO l_rec LIMIT 100;
FOR i IN 1..l_rec.COUNT LOOP
DBMS_OUTPUT.PUT_LINE(l_rec(i).c001 || ' ' || l_rec(i).c002 || ': ' || l_rec(i).c003);
END LOOP;
EXIT WHEN l_cursor%NOTFOUND;
END LOOP;
END;

Merge records in the collection:

You can merge records in an APEX collection using the APEX_COLLECTION.MERGE_COLLECTION procedure. This
procedure merges the specified records from the source collection into the target collection.

BEGIN
APEX_COLLECTION.MERGE_COLLECTION(
p_target_collection_name => 'MY_COLLECTION',
p_source_collection_name => 'OTHER_COLLECTION',
p_member_key => '1',
p_update_column => 'C003',
p_update_value => 'newvalue@example.com'
);
END;

Change records in the collection:

You can change records in an APEX collection using the APEX_COLLECTION.UPDATE_MEMBER procedure. This
procedure
updates the specified record in the collection with the specified values.

BEGIN
APEX_COLLECTION.UPDATE_MEMBER(
p_collection_name => 'MY_COLLECTION',
p_seq => 1,
p_c001 => 'Jane',
p_c002 => 'Doe',
p_c003 => 'janedoe@example.com'
);
END;

Delete records from the collection:

You can delete records from an APEX collection using the APEX_COLLECTION.DELETE_MEMBER procedure. This
procedure
deletes the specified record from the collection.

BEGIN
APEX_COLLECTION.DELETE_MEMBER(
p_collection_name => 'MY_COLLECTION',
p_seq => 1
);
END;

Conclusion

That’s it! Using the APEX_COLLECTION package, you can create, access, merge, change, and delete records in a
collection in Oracle APEX.

Location matters: The new Map Region Type in APEX 21.1 by Carsten Czarski

This presentation introduces the new Map Region Type, which was introduced the latest APEX release 21.1. Attendees will learn, how to easily visualize location data from a SQL query or a REST Data Source on a map – all declarative, without manual coding and without external Plug-Ins.

The session will also cover how to integrate a Map region with other APEX region types like Charts, Reports or Faceted Search. Tips and tricks about visualizing larger amounts of data and how to leverage Oracle Spatial functionality will wrap the session

SAVE THE DATE: BERLINER EXPERTENSEMINAR MIT JÜRGEN SIEBEN

Beschreibung:

Die Schulung erläutert, wie in APEX schnell und komfortabel entwickelt werden kann, ohne die Anforderungen an eine saubere Anwendungsstruktur zu verletzen.

Eigentlich weiß es jeder: Software wird in Modulen entwickelt, die eine Schnittstelle und eine Implementierung haben und aufeinander aufbauen. Oracle empfiehlt dies, Technical Papers wie zu SmartDB oder PinkDB schlagen entsprechende Lösungen vor. Dennoch sind die meisten APEX-Anwendungen weit von einer sauberen Struktur und der damit verbundenen Erweiterungsfähigkeit und Wartbarkeit entfernt. Warum?

Ich bin überzeugt: Weil der Prozess nicht einmal vollständig durchdekliniert, erprobt und mit den entsprechenden Werkzeugen flankiert wurde. Da dieses Setup fehlt, erscheint es einfacher, eine einfache Anwendungsseite schnell und einfach mit den Assistenten zu erstellen, anstatt angeblich aufwändige Packages erstellen zu müssen. Dieses Seminar stellt eine Strategie vor, wie sauber programmiert werden kann, ohne auf APEX-Assistenten verzichten zu müssen. Zudem profitiert das Team durch eine bessere Aufteilung der Zuständigkeiten und eine höhere Parallelisierbarkeit der Programmierung.

Die eingesetzten Werkzeuge und Skripte stehen allen Teilnehmern kostenlos zur Verfügung.

Zielgruppe:

Fortgeschrittene APEX-Entwickler, aber auch Teamleiter von APEX Entwicklerteams, die eine leistungsfähige Strategie suchen, um komplexe Anforderungen mit APEX umsetzen zu können, ohne in ein Wartungsdesaster zu geraten.

Vorkenntnisse:

APEX-Kenntnisse sollten ebenso vorhanden sein wie solide SQL und PL/SQL- Kenntnisse

Welche Fähigkeiten erlangen die Teilnehmer:

Es wird eine Strategie erarbeitet, die jedem Teilnehmer die Möglichkeit gibt, im Team effizient und architektonisch sauber APEX-Anwendungen zu entwickeln. Zudem werden Strategien vermittelt, um die Entwicklung im Team zu unterstützen.

Die hierfür benötigten Werkzeuge werden vorgestellt und den Teilnehmern zur Verfügung gestellt.

Dozent:

Jürgen Sieben ist bereits mehrfach als Dozent der Expertenseminare aufgetreten, ebenso als Speaker auf der DOAG-Konferenz und der APEX Connect. Er verfügt über umfangreiche Schulungserfahrung im Umfeld von Oracle (> 1000 Schulungstage) und ist Experte für SQL, PL/SQL, APEX und allgemeine Oracle-Themen.

 

 

 

Die Anmeldmöglichkeit für Teilnehmer stellen wir asap zur Verfügung!

Wir freuen uns auf Ihre Teilnahme

Migrate Your Oracle Forms Apps to Oracle APEX by Monica Godoy

Oracle Forms is an established technology that has been popular for building data applications for decades. Today, there are several approaches for building such applications.
In this session, you will learn:
• How to use Oracle APEX to modernize your Oracle Forms-based applications.
• When it’s a good moment to modernize
• What you should do before starting this type of projects
• Demonstration from Forms to APEX

APEX: Let’s Talk About Charts Attributes (Inverted Scale)

Hello! If you had play with Apex before, you know how easy is to build a simple report to present your data. But sometimes, your boss will ask you to build something more “graphical” or with a better design. But I never thought in color themes or pictures when I developed my simple reports in Sqlplus. Those colorful themes and design things are, most of the times, not familiar for DBA’s.

More“APEX: Let’s Talk About Charts Attributes (Inverted Scale)”