GETTING STARTED WITH SQLGATEWAY TO ORACLE

Everyday Examples

The following examples describe a number of short-cuts for solving everyday problems within ACCENT R.  The scripts can be modified to fit your exact situation.  Refer to the following pages for a detailed description of the functions described.  The Books Sample Database can be accessed for these examples.

Prototyping An Application

$ACCENT

Execute the Oracle version of ACCENT R.
Choose "ICL" from the Guide Menu
 
*CREATE DBL ORDER
Build a Central Application Repository, first session only.
*USE DBL ORDER
Access a Central Application Repository, second and subsequent sessions.  
*USE ORACLE SERVER AS WAGNER PASSWORD IS XYZXYZ password:
Connect to the Oracle Server.
*OSQL CREATE DS FOR ALL TABLES enter the user name:enter the user password:
Copy the table definitions from your existing Oracle Server. 
*OSQL SELECT * FROM CUSTOMER WITH WINDOW DEFINE PM CUSTOMER_VIEW ONLY
Create a screen to view customers.
*OSQL INSERT INTO CUSTOMER WITH WINDOW DEFINE PM CUSTOMER_ADD ONLY
Create a screen to add customers.  
*OSQL UPDATE CUSTOMER WITH WINDOW DEFINE PM CUSTOMER_CHANGE ONLY
Create a window to change customer information.  
*LIST PM CUSTOMER_VIEW
Examine the modifiable source code.
OSQL MENU Customer Menu HORIZONTAL &ITEM VIEW CUSTOMERS USE PM CUSTOMER_VIEW &ITEM UPDATE CUSTOMERS USE PM CUSTOMER_CHANGE &ITEM ADD CUSTOMERS USE PM CUSTOMER_ADD &DEFINE PM CUSTOMER_MENU ONLY OSQL USE PM CUSTOMER_MENU
Create and execute a menu for our new application.  
*QUIT
You’ve just prototyped an application in on-line SQL.  Each of the PM’s created can be easily modified or extended.

Generating the Default Maintenance Screens

$ACCENT
Execute the Oracle version of ACCENT R. 
Choose "ICL" from the Guide Menu
 
*CREATE DBL MAINT
Build a Central Application Repository, first session only. 
*USE DBL MAINT
Access a Central Applications Repository, second and subsequent sessions.  
*USE ORACLE SERVER AS WAGNER PASSWORD IS XYZXYZ password:
Connect to the Oracle Server.  
*OSQL CREATE DS FOR ALL TABLES
Copy table definitions from your existing Oracle Server. 
*OSQL BUILD FOR ALL TABLES DEFINE CM BUILD_ALL ONLY
Build the script which creates a screen to SELECT, INSERT and UPDATE tables and corresponding menus
*USE CM BUILD_ALL
Execute the script.
*OSQL USE PM MAINT_MAIN_MENU
Run the main menu to access the maintenance screens.  
*QUIT
You’ve just implemented a complete system for adding, changing, and viewing records on the Oracle Server.

Exporting RMS Files to Oracle

$ACCENT
Execute the Oracle version of ACCENT R.
Choose "ICL" from the Guide Menu
 
*USE DBL ORDER
Access a Central Application Repository.  
*OSQL EXPORT FROM NISDATA:STORES_RMS.DAT TO STORES_ORA
Convert the data from one DS object to another. 

Getting a Table Listing to Disk File

$ACCENT
Execute the Oracle version of ACCENT R.
Choose "ICL" from the Guide Menu
 
*USE DBL ORDER
Access a Central Application Repository.  
*USE ORACLE SERVER AS WAGNER PASSWORD IS XYZXYZ
Identify your user name on the Oracle Server. 
*USE SF CUSTOMER.LIS AS LOG
Open an SF (System File) Object as a log file.
*OSQL SELECT * FROM CUSTOMER WHERE STATE = 'CA'
Display all customers in the customer table that reside in California. 
*USE NO SF LOG
Close the SF Object that contains our report.
*QUIT
Leave the ACCENT R environment.
$TYPE CUSTOMER.LIS
Use DCL to view the report we created.

Defining or Modifying a DBL Object

$ACCENT
Execute the Oracle version of ACCENT R.
Choose "ICL" from the Guide Menu 
 
*USE DBL ORDER
Access a Central Application Repository.  
*SET 'EDIT/EDT' TO @EDITOR
Tell ACCENT R about your editor.
*DEFINE (or MODIFY) CM SETUP
Your favorite editor is invoked here to modify the DBL Object.

Customizing your Development Environment

$CREATE BEGIN.ACC
The file BEGIN.ACC is invoked each time ACCENT R is started.
*SET 'EDIT/EDT' TO @EDITOR
We always wish to use EDT as our editor.
*ENABLE PM DEBUG
The PM (Process Module) Object debugging should always be enabled for our sessions in ACCENT R.
*EQUATE COMMAND GO TO CM SETUP WITH OPTIONAL TEXT
Set up a special command for my ACCENT R environment.
*CONTROL-Z
Close the file at DCL level.

Overview    Oracle Nameing Convention