Appian Query

RecordData Vs Data Store Entity Vs Record

Once upon a time in a land called Database World, there were three friends: Query Record, Query Entity, and Query Data. Each had their unique abilities and purpose.

Query Record, the meticulous one of the group, had an uncanny knack for retrieving specific information from the vast database kingdom. For example, imagine a library database. Query Record could effortlessly fetch the details of a single book: its title, author, publication date, and so on. It would diligently search for a specific record based on certain criteria, like the book’s unique identifier or ISBN.

Query Entity, the sociable and inclusive friend, had a broader query power. It could retrieve multiple records associated with a particular entity or category. Suppose there was an online store database. Query Entity could easily gather all the products belonging to a specific category, such as “electronics” or “apparel,” allowing the store to display a selection of relevant items to its customers.

Lastly, there was Query Data, the wise and experienced one who could perform any kind of data retrieval operation within the database realm. Whether it was fetching a single record or multiple records related to an entity, Query Data had the versatility to handle them all. It was the go-to friend when all other options seemed insufficient or when a more comprehensive approach was needed.

Together, these three friends formed a powerful trio, providing programmers and database users with a range of options based on their specific needs. While Query Record focused on obtaining individual details, Query Entity excelled at gathering groups of records related to a certain entity, and Query Data could handle any data retrieval task thrown its way.

And so, in the land of Database World, programmers and data enthusiasts lived happily ever after, thanks to the valuable contributions of Query Record, Query Entity, and Query Data — the three extraordinary friends with distinct but complementary skills.

Note also Need to Taken Care Sync Must be taken Care of when Using Records Because Normally Using testing Or Debugging Data may look Different hence “Sync” plays a vital Role.

Note Sync means Our Data at both ends aka database and Appian are same . For appian Database is also kind of Integration hence Sync enables us to make data at both ends same .

Records play a vital role as Joins Joins are something that Consumes a lot of time and makes Query Solower. Let’s take an example of Some Queries Running in a Stored Procedure where we have defined RelationShip which has some relation-defined

Let’s See an example of a stored procedure in Oracle 19c that fetches data from four tables and performs optimized joins based on primary and foreign keys. The stored procedure will return the result as a table with two columns:

-- Code By DSniper
CREATE OR REPLACE PROCEDURE fetch_data_from_tables AS
   TYPE result_table IS RECORD (
      column1    TABLE1.COLUMN_NAME%TYPE,
      column2    TABLE2.COLUMN_NAME%TYPE
   );
   
   TYPE result_set IS TABLE OF result_table;
   data_result result_set;
BEGIN
   SELECT t1.COLUMN_NAME, t2.COLUMN_NAME
   BULK COLLECT INTO data_result
   FROM TABLE1 t1
   JOIN TABLE2 t2 ON t1.PRIMARY_KEY = t2.FOREIGN_KEY
   JOIN TABLE3 t3 ON t2.PRIMARY_KEY = t3.FOREIGN_KEY
   JOIN TABLE4 t4 ON t3.PRIMARY_KEY = t4.FOREIGN_KEY;
   
   -- Process the data_result as desired
   
   -- Return the data_result
   FOR i IN 1..data_result.COUNT LOOP
      DBMS_OUTPUT.PUT_LINE('Column 1: ' || data_result(i).column1 || ', Column 2: ' || data_result(i).column2);
   END LOOP;
END;
/

Please note that this is a template, and you need to replace TABLE1TABLE2TABLE3, and TABLE4 with the actual table names, and COLUMN_NAME with the correct column names from the respective tables. Additionally, you can modify the code to suit your specific requirements and further process the data_result according to your needs.

The Best can be Taken Care of By records as we can define the relationship while Querying Records instead of getting data by .data or index(record, “data”, null) Let’s Fetch the Whole map and proceed further.

Let me know How you Liked the story For Visual Representation let me know will Bring it ASAP in Super Easy Explanation.

Super Excited To Launch Our Discord For Discussion. If Wanted to be a part of Vibrant Community.

Let’s join Our Discord

Till Then Keep Learning and Keep Rocking. You Can also Hava look At our Recent knowledgeable posts


Discover more from Appian Tips

Subscribe to get the latest posts sent to your email.

Leave a Reply

Up ↑

Discover more from Appian Tips

Subscribe now to keep reading and get access to the full archive.

Continue reading

Discover more from Appian Tips

Subscribe now to keep reading and get access to the full archive.

Continue reading