Hi,
Has anyone worked on a project where you have written a COBOL code with similar specifications written below? If yes, can you share your experience on how good or bad this is compared to the traditional approach of embedding the SQL directly in the module?
SPEC:
Lets assume that we have a table called EMPLOYEE. and an application written in COBOL.
Instead of embedding the SQL to access this table in every program that has to access this module, we create a sub-module that contains all the SQL statements.
So whenever there is a need to access this table, we just call the sub-module with enough input.
#DB2#COBOLDB2 must be the same as all other sql database as oracle, mssql, mysql, and others over ODBC-Driver or ADO
Yes, ii is possible to have all sql-commands in a separate program, but must not.
First make a connection to the database, then use you sql commands between the two commands.
exec sql
.....
end-exec
What is your database name?
Then you can access all tables in this database.
Share your cbl program and we can give you any tips and code!
DB2 must be the same as all other sql database as oracle, mssql, mysql, and others over ODBC-Driver or ADO
Yes, ii is possible to have all sql-commands in a separate program, but must not.
First make a connection to the database, then use you sql commands between the two commands.
exec sql
.....
end-exec
What is your database name?
Then you can access all tables in this database.
Share your cbl program and we can give you any tips and code!
Thanks for the response, Greiner.
I am working on a project where we are on the process of migrating from IMS DLI database to DB2.
Since we are creating new DB2 tables, wanted to know different opinions on the idea described below.
Lets say we have
PROGRAM A that does SELECT,UPDATE in table_1.
PROGRAM B also does exactly the same SELECT,UPDATE in table_1.
Instead of having the same query in two different programs, we thought of discussing about the option of writing a common routine that can contain all potential queries that can be performed against table_1.
If you could share your opinion on this approach, it would be great!
Thanks!!!