Building Oracle Database


All the COBOL File Definitions are translated by COBOLTranslator to SQL Data-Definition Language. They can be used to create the table schemas in ANY SQL Compliant database. Following is a rough guide to building them into an ORACLE database. You will need access to SQL PLUS.

CREATE USER PERSONNL
IDENTIFIED BY XXXXs;

CREATE ROLE role_app_dev;
GRANT dba to role_app_dev;

GRANT role_app_dev to PERSONNL;

<Output directory>\sql-ddl\

Type *.* ..\build.sql

This will create one script in the output directory containing all the table definitions.
You can run this script from SQL PLUS by typeing

C:\<Output Directory>\build.sql;

Or alternatively

C:\<Output Directory>\sql-ddl\table1. sql;

Where table1.sql is the script for generation of table1- You will need to do this for all the tables (scripts) generated.

Select * from PERSONNL.Table1;

You now need to create public synonyms to so the tables can be accessed without the owner-name - i.e. to allow users to run the following SQL statement:

Select * from Table1;

To create the public synonym run the following script from SQL PLUS :

spool C:\auto.sql;

select 'Create public synonym ' || table_name

|| ' FOR ' || table_name || ';'

from user_tables ;

spool off;

This creates the file auto.sql in you c:\ directory.
Open this file (using notepad or other editors) and remove the SQL Header lines.
Then return to SQL - PLUS and type

C:\auto.sql;

Now all your tables can be accessed normally.

Note that for DELPHI applications You will also need to create an ALIAS for the database using the Delphi BDE Configuration utility.