DBA > Job Interview Questions > DB2 INTERVIEW QUESTIONS

What is a precompiler?

More DBA job interview questions and answers at http://dba.fyicenter.com/Interview-Questions/

(Continued from previous question...)

What is a precompiler?

Precompilor-:
Precompilor's main purpose is to check the syntactical error of COBOL programes which contains embeded SQL statements.It first compiles and then differentiates cobol and DB2 statements.It sends all the DB2 queries to DBRM(database request module) and in that cobol program control makes those query lines as comment lines & issues CALL statement and that moves to MSC(modified sourse code).
Precompiler:
1) Checks for SQL syntax in application prgram
2) Copies all the SQL statements into a sepearte member known as DBRM(DataBase Request Module)
3) Comment all the SQL statements
4) Replaces all the SQL statements with corresponding langauge call statements.
5) Finally Puts Timestamp
During Pre-compilation :
1. The embedded SQL statements are stripped out. In the source code they are commented out and instead CALL statements are inserted.
2. Based on the DECLARE TABLE statement, the columns of the tables used in the program are understood and the SQL statements are checked for any syntax errors.
3. The stripped out SQL is transformed into a DBRM with an identical time stamp on both the DBRM and the main source program.

(Continued on next question...)

Other Job Interview Questions