1.3 - Verify the Database
Last updated 13/06/2023
Say we want to check the date borrowed in the BorrowHistory table in the database as we cannot see the BorrowHistory records in the Book Club application. We can easily check the records by using Five's SQL Editor.Navigate to Queries
1. Select Visual in the menu.2. Select Queries in the sub-menu.
Figure 1 - Queries menu item
Check the Record in the Database
1. Click the Add Item button.2. Click in the Query field to open Five's Query Builder.
Figure 2 - Open the Query Builder
3. Click the SQL tab.
Figure 3 - SQL tab
4. Click the Copy button on the syntax block below
Testing Do Before Update Event
SELECT
Book.Title,
Book.BookKey,
Book.BorrowMemberKey,
BorrowHistory.Date,
BorrowHistory.DateReturned,
iUser1.FullName AS Owner,
iUser2.FullName AS Borrower
FROM
Book
INNER JOIN BorrowHistory On Book.BookKey = BorrowHistory.BookKey
INNER JOIN iUser AS iUser1 ON Book.MemberKey = iUser1.iUserKey
INNER JOIN iUser AS iUser2 ON Book.BorrowMemberKey = iUser2.iUserKey
WHERE Book.Title LIKE '%Mastering%'
5. Paste in the SQL Editor.
6. Click the Run button.
Figure 4 - Run button
info
You can see in the results that the borrowed date has been inserted in the BorrowHistory table here for the Mastering TypeScript 3 record.
Figure 5 - Returned records
7. Click the Cancel button in the SQL Editor.
Figure 6 - Cancel button
8. Click the Cancel button in the form app bar.
Figure 7 - Cancel button