Changes for page Update database after retrieval
Last modified by Danniar Firdausy on 2024/09/18 20:02
Summary
-
Page properties (2 modified, 0 added, 0 removed)
Details
- Page properties
-
- Author
-
... ... @@ -1,1 +1,1 @@ 1 -XWiki. marijn1 +XWiki.ebakker - Content
-
... ... @@ -1,16 +1,9 @@ 1 -{{html wiki="true"}} 2 -<div class="ez-academy"> 3 - <div class="ez-academy_body"> 4 - 5 -<div class="doc"> 6 - 7 - 8 - 1 +{{container}}{{container layoutStyle="columns"}}((( 9 9 = Update database after retrieval = 10 10 11 11 In the previous [microlearning](intermediate-database-connectivity-sql-query.md) we discussed the fundamentals of SQL queries. In this microlearning, we will learn how you could update the record(s) in the database the moment after you have read the information from the database. This functionality can help you update a status field to ensure you won't keep reading the same record(s) repeatedly. 12 12 13 -Should you have any questions, please get in touch with academy@emagiz.com. 6 +Should you have any questions, please get in touch with [[academy@emagiz.com>>mailto:academy@emagiz.com]]. 14 14 15 15 * Last update: September 7th, 2021 16 16 * Required reading time: 4 minutes ... ... @@ -33,12 +33,12 @@ 33 33 34 34 As you can see, there are some subtle differences in the SQL query you need to achieve the proper result—most notable, the where statement is written differently. In the update statement, we need here; we need to define our input (IN) columns and values. Based on the input values that were returned via our SELECT statement, the update action is triggered. Within eMagiz, this is configured as follows. 35 35 36 - <p align="center">[[image:intermediate-database-connectivity-update-database-after-retrieval--select-and-update-combined.png||]]</p>29 +[[image:Main.Images.Microlearning.WebHome@intermediate-database-connectivity-update-database-after-retrieval--select-and-update-combined.png]] 37 37 38 38 In this example, we search for all rows within the table for which the value in the column processed is equal to false. If so, the select statement will return each row. After the query returns all rows, the update query will ensure that all these rows will be updated by changing the value in the column processed to true. This way, you ensure these records won't be retrieved the next time we execute the select statement. 39 39 40 -===== Practice ===== 41 41 34 + 42 42 == 4. Assignment == 43 43 44 44 See if you can find any database implementation within the projects you can access. This assignment can be completed with the help of the (Academy) project that you have created/used in the previous assignment. ... ... @@ -59,11 +59,6 @@ 59 59 60 60 This video demonstrates how you could have handled the assignment and gives you some context on what you have just learned. 61 61 62 - <iframewidth="1280" height="720" src="../../vid/microlearning/intermediate-database-connectivity-update-database-after-retrieval.mp4"frameborder="0"allow="accelerometer; autoplay; clipboard-write; encrypted-media; gyroscope; picture-in-picture" allowfullscreen></iframe>55 +{{video attachment="intermediate-database-connectivity-update-database-after-retrieval.mp4" reference="Main.Videos.Microlearning.WebHome"/}} 63 63 64 -</div> 65 - 66 -</div> 67 -</div> 68 - 69 -{{/html}} 57 +)))((({{toc/}}))){{/container}}{{/container}}