Consultor Eletrônico



Kbase 21228: How Are ESQL/C R-code Files Named, Used and Stored?
Autor   Progress Software Corporation - Progress
Acesso   Público
Publicação   17/03/2003
Status: Unverified

GOAL:

How Progress names, uses and stores the r-code files generated by the ESQL Preprocessor

FIX:

-- File location:


The r-code files generated by the ESQL Preprocessor precompiled option are not located based on the -T startup parameter and therefore, are not located in the temporary directory pointed to by the -T parameter.

The ESQL Preprocessor (provided as sqlcpp in your ESQL installation directory) accepts as input a PROGRESS/ESQL source file that contains a mixture of PROGRESS/ESQL and C language statements.  It converts the ESQL statements into calls to ESQL-LIB functions, and produces a pure C source file with optional r-code for any Static ESQL statements.

Unless you specify other paths, the Preprocessor places all its output in your current working directory.  Therefore if you need the generated r-code files to be in a specific directory, you can do one of the following.  Either make that directory your current directory before invoking the ESQL Preprocessor with the precompile option, or define that temporary directory by setting the environment variable TPE_TMPDIR.


-- File name structure:


The developer may specify an application name that generates the names for these r-code files by calling the sqllogin() function and passing it the application name as one of its parameters.  The Preprocessor then uses the first two characters of the application name as a prefix for each r-code filename, and assigns the next six characters of the name by generating a hexadecimal number from the text of the compiled SQL request, finally adding the .r extension.

If, however, the developer does not specify an application name parameter for the sqllogin() function, ESQL generates the entire r-code file name that it compiles using a random hexadecimal number string such as, 0fdb81.r, 13f87d.r, or 7fca34.r.

Note that the ( -T ) startup parameter defines the temporary directory where the temporary client session files are stored.  If you do not use this parameter, Progress puts these temporary files in the current working directory.  

On UNIX these filenames begin with a prefix of lbi, dbi, pge, srt, or trp, and end with the process ID of the user's Progress session.  In other words, they take the form, LBInumber, SRTnumber, PGEnumber, DBInumber, and TRPnumber where number is the PID of the user's session.

On Windows the file names also begin with a prefix of lbi, dbi, pge,
srt, or trp, but they end with a random number and not the PID of the
user's Progress session.


-- File usage:


The LBI file is used to back out of sub transactions and variable value changes.  The DBI file is used to store temporary tables.  
The PGE file is used to edit the buffer contents.  
The SRT file is used as a temporary sort space and session compile storage.  
The TRP file is used to store the Data Dictionary changes until they are saved.