DB Accesses

Help Version: 3.15 - 23/MAR/2021

DB Accesses

DB Detail

Note that these options are not always implemented. For example if your are planning a markup language (i.e. HTML) there is no sense to activate them.

The DB Accesses Dialog allow you to set various information about the number of accesses you've previously selected in the "Base Parameter Panel"; If you've specified "3 SELECT", you will obtain a panel configured correspondingly.

DB accesses integrate the C.R.U.D system in order to capture the most common implementations. Moreover there is a special checkbox for Commit and Rollback functions.

Fields description

  • Number Button: Clicking the first time this button, a file manager will open asking to select a DCLGEN file. Once selected and clicking again, you will EDIT this file. Read below for details about DCLGEN. Internal parsing also process the sql "CREATE TABLE" definitions. In this case you will obtain only the DB definitions of the SQL COLUMNS. DCLGEN have extension ".dcl", while SQL CREATE TABLE are ".sql".
  • DCLGEN/SQL FILE: Contains the file name selected. This file is parsed and modified to handle the sql accesses and undestand table structure. During FTP transfer you will obtains DCLGEN files downloaded into your setup directory, while using the Generate SQL file button you will obtain Sql files of your tables. Clicking the left number and selecting DCLGEN files you can access previously downloaded DCLGENS or Sql files.
  • OWNER/SCHEMA: It's the owner (or schema) that will be set for that table into the program; ex. "OWNER.tablename"
  • TABLE NAME: It's the name of the table; ex. "owner.TABLENAME"
  • CURSOR: It's the name of the DB Cursor you are using inside a FETCH, a variable that resolves DB reading inside specific languages. Where it's not necessary can be ignored.
  • DESCRIPTION: It's the detail used into the comments area to better identify the DB Accesses.
  • FIELD SELECT BUTTONS: this two buttons enables in function of the DB access. For example DELETE will just have "W" enabled (i.e. Where), while SELECT will have both enabled. As obvious, S stand for SELECT, W stand for WHERE. Refer to DB Fields Selection.
  • AUTO FILL OWNER/TABLE NAME: This option analyze your DB files and set automatically the OWNER and the TABLE NAME where is empty.
  • COPY THE FIRST OWNER UPON THE OTHERS: This Option copy the OWNER/Schema from the first position to the others.Useful when programs always use the same owner/schema for every table
  • Generate SQL FILES from "TABLE CREATE" definitions: when you click this button a wizard will start. After this short wizard you will obtain the sql CREATE TABLE files useful to gain fields information and proceed with DB Fields Selection. Here the process steps:
    1. Copy and paste into the temporary file that is opening all your SQL TABLE CREATE definitions, saving the file.
    2. Return to software and confirm.
    3. Watch the Software intermediate preview of all tables that will be parsed and transformed into a sql file.
    4. Confirm the creation of checked tables, or cancel.

File Examples

In order to IMPLEMENT the code that uses DB DIRECTIVES, the convenient way is to build a MOCK M.P.S.C. from the language setup page (Advanced Options and Language Definition), and understand the generated DB code using this documentation Advanced User Guide.

DCLGEN NOTE: these files are a text representation of a SQL table with the corresponding COBOL fields below. If you provide a only SQL file the COBOL conversion will not be implemented but the SQL part will be useful. The current implementation of DCLGEN is oriented to Mainframe IBM.

DCLGEN file example

******************************************************************
* DCLGEN TABLE(MYOWN.MYTABLE) *
* LIBRARY(TSOXXYY.USER.DATA(DCLGEN01)) *
* ACTION(REPLACE) *
* LANGUAGE(COBOL) *
* QUOTE *
* ... IS THE DCLGEN COMMAND THAT MADE THE FOLLOWING STATEMENTS *
******************************************************************
EXEC SQL DECLARE MYOWN.MYTABLE TABLE
( USER_NAME CHAR(40) NOT NULL,
USER_AGE DECIMAL(3,0) NOT NULL,
USER_EYES CHAR(20) NOT NULL,
USER_WEIGHT DECIMAL(6, 0) NOT NULL,
USER_DESCR CHAR(50) NOT NULL
) END-EXEC.
******************************************************************
* COBOL DECLARATION FOR TABLE MYOWN.MYTABLE *
******************************************************************
01 DCLMYTABLE.
10 USER-NAME PIC X(40).
10 USER-AGE PIC S9(3)V USAGE COMP-3.
10 USER-EYES PIC X(20).
10 USER-WEIGHT PIC S9(6)V USAGE COMP-3.
10 USER-DESCR PIC X(50).
******************************************************************
* THE NUMBER OF COLUMNS DESCRIBED BY THIS DECLARATION IS 5 *
******************************************************************

CREATE TABLE: these files contain fields definition as well as the table name. Providing this kind of file will enable the Fields Selection panel.

CREATE TABLE file example

-- Description: ACTION
CREATE TABLE ACTION (
ACTION_ID INTEGER NOT NULL PRIMARY KEY AUTOINCREMENT,
ACTION_VALUE TEXT,
ACTION_DESCRIPTION TEXT
)

Advertising