1 / 19

Embedded SQL

Embedded SQL. Journalling. Journal. Controlling object used to record changes to database objects. Journal Entry. Record of change to a database object. Journal Receiver. Holds the Journal Entry. A Journal can have more than one journal receiver. Journal. *FILE. *FILE. Journal

toby
Download Presentation

Embedded SQL

An Image/Link below is provided (as is) to download presentation Download Policy: Content on the Website is provided to you AS IS for your information and personal use and may not be sold / licensed / shared on other websites without getting consent from its author. Content is provided to you AS IS for your information and personal use only. Download presentation by click this link. While downloading, if for some reason you are not able to download a presentation, the publisher may have deleted the file from their server. During download, if you can't get a presentation, the file might be deleted by the publisher.

E N D

Presentation Transcript


  1. Embedded SQL

  2. Journalling

  3. Journal • Controlling object used to record changes to database objects

  4. Journal Entry • Record of change to a database object

  5. Journal Receiver • Holds the Journal Entry. • A Journal can have more than one journal receiver.

  6. Journal *FILE *FILE Journal Receiver Journal Receiver Journal Entries Journal Entries Journal Entries Journal Entries

  7. Creating a Collection with a Data Dictionary • Automatically creates a journal to log changes to the database files created in the collection

  8. Setting up the Journal

  9. Creating a Journal Receiver CRTJRNRCV • Fill in the Journal Receiver name, the library where it will be stored

  10. Creating a Journal CRTJRN • Fill in the name of the journal and the library that it is stored in. • Attach the journal receivers by listing them in the Journal Receiver Fields

  11. Start Journal Physical File STRJRNPF • Used to attach physical files to the Journal Receivers. • Record images parameter defines whether the before/after image of the file will be stored or just the after.

  12. Using the Journal Commitment Control

  13. Commit • Used to finalize the database change. • Happens automatically when a program is ended normally.

  14. Rollback • Uses the journal entries to take the database back to the state that it was in after the last commit.

  15. Displaying a Journal • DSPJRN

  16. SQL in Cobol

  17. Working Storage • Include SQLCA • SQLSTATE (PIC XXXXX)

  18. SQL Equivalents Read a record? Delete a record? Add a record? Change a record?

  19. Retrieving more than one record • Declare a cursor • Contains a select statement that retrieves all of the records • Open the cursor • Loads the data into the cursor • Fetch • Fetches a record from the cursor (default is next) • Close the cursor • Clears the data in the cursor

More Related