Question

How is the logic for database accesses operating within the exit programs?

Answer

Read user record, Field = 2/3
Depending on application SQL/ODBC, ShowCase, FTP, DDM Field = 0 access will be rejected, 1 = no control

Determining library and file-name
For SQL/ODBC accesses, all files used will be determined from the SQL string. Nested SQL commands are also supported

as well as all other SQL commands interlinked with SELECT. one SQL string may be 32512 Bytes long.For DDM accesses (non DRDA)

and file transfers via exit program interface PCSACC, normally used by e.g. ShowCase or file trasfer from Reflection,

the library and file name is directly available.

Long file names - up to 128 Bytes.
'This is my file' is a valid file name. As this name is longer than 10 Bytes, a 10 Bytename will be specified by the system.

It will always be used for SQL/ODBC from the PC.

A CRTPF QGPL/"abc_§()e" RCDLEN(80) is valid. If the name is being specified in " ", all characters are allowed.
Blanks within the name and names longer than 10 Bytes are possible only for accesses from PC via SQL/ODBC.

For a long file name, the i5/OS name will be determined. For a CREATE TABLE, the WRITE of the record into the PCSACC/400 file

will be delayed as the i5/OS name is not determined yet. The WRITE will be performed at the subsequent access to the file,

e.g. an INSERT INTO. Creation of a file has to be allowed in the library record.

If no library name exists, checking will be performed first for an existing OVRDBF. For an OVRDBF FILEA FILEB,

the library for FILEB will be determined from *CURLIB, *LIBL, the default library or a library set via SET SCHEMA,

if OVRDBF does not contain a library or no OVRDBF has been found. For a CREATE TABLE, the default library will be taken.

Alias resolution
If the PCSACC/400 system value for alias resolution has been activated, the SQL/ODBC exit program will check,

whether the name found (library/file) is an alias name. If this is true, the name will be replaced by the original name.

Alias names will be used for assignment to a certain file member if the file contains multiple file members.

If no alias files are being used, the system value should not be active in order to prevent unnecessary checking.

If no alias checking is being performed, the Programm will operate with the name found.

Checking for help library #BLANK
Before reading of the library record, the program checks whether the file is being stored in help library #BLANK.

All files stored in #BLANK are allowed for all libraries.

Note: If log data are being converted into access authorities in batch, library #BLANK will be considered.

When converting single records via option S or G, no checking will be performed for library #BLANK.

When storing a user record #BLANK at user QDEFAULT = *PUBLIC, certain files in all libraries can be released for all users.

 back to top

Read library record, Field 2/3
Depending on application SQL/ODBC, ShowCase, FTP, DDM Field = 0 access will be rejected, 1 = no control

Read file record
Existing record, access not allowed - access rejected
Existing record, data authorities
(ADD, UPDATE, READ, DELETE of records) and

application authority (S=SQL/ODBC, F=FTP, D=DDM V=ShowCase) control, allow access or reject.

Controlling of file-level or format-level ID
The format level-ID (level check parameter) consists of number, length and type of fields.

This value is independent from creation date and will only be changed if the file structure is being changed.

For Querie's with file output it is possible to ensure that the file structure shall not be changed.

Otherwise, message MSG0035 = no access to this file as structure has been changed, will appear.

File record missing, generic name possible ?
Search with first character of file name in file PCFUNC2. This file only contains Generic names.

If a record is being found, it is the key for access.

Read (SELECT) ? Library = 3 access generally is allowed

Library record missing - error message MSG0102 ?
Read (SELECT) ? On user level = 3, access is allowed.

This evaluation will be performed per group - this implicates up to 5 x performance problems for very long SQL strings.

Checking will be performed for each level, whether the data record is stored at user QDEFAULT = *PUBLIC.

 

 back to top