OpenVMS Notes:
RMS / Oracle-RDB / MySQL Quick Index
Question: If RMS-Indexed (ISAM) technology is so fast and cheap, then
why consider changing?
Answer: Evolution
| Feature | Relational | RMS |
|---|---|---|
| relational tables? | built-in | maybe 1 |
| SQL? | built-in | no 2 |
| can add/drop indexes without changes to the application software? | yes | no |
| can modify field sizes and data types (within reason) without changes to the application software? | yes | no |
|
possible to place all desired constraints (rules) into the database
rather than the application software? (thus protecting the database from access via 3rd party software like ODBC etc.) |
yes | no |
|
possible to trigger software when just accessing the database? (thus protecting the database from access via 3rd party software like ODBC etc.) |
yes | no |
| can be made transaction safe? | yes | maybe 3 |
| can keep a running log of all "before/after" changes? | yes | maybe 3 4 |
| maintains a limited online-log of all "before" changes? | yes 5 | difficult 3 |
| possible to do file maintenance (like rebuilding indexes) on the fly to support a true 7x24 operation? | yes 6 | no |
Subscript Notes:
Relational databases are "relational in both time and space". Consider the following example from Oracle 9i
SQL compliant databases first look at your SQL Statement, then look at the current database structure before building the "execution plan" to carry your desires (experts have told me that there are. on average, 20 different ways to get at your data). If you decide to rebuild an index during an online maintenance operation, the database will produce a different execution plan in order to carry out your request. Access to the data might be a little slower (because the index is unavailable) but it will never be blocked as long as the database is still running. (note that clever forms of index maintenance can even prevent this problem; for example, just create the new index before deleting the old one)
A really neat product which all VMS developers should try at least once.
| Rdb/RDO Commands | Rdb/SQL (equivalent command) |
|---|---|
| $RDO | $SQL |
| AT END | IF SQLCODE=SQLCODE_EOS |
| DECLARE TRANSACTION | SET TRANSACTION |
| FETCH/GET | FETCH INTO |
| INVOKE DATABASE | DECLARE DATABASE |
| ON ERROR | IF SQLCODE<SQLCODE_SUCCESS |
| MODIFY | UPDATE |
| REMOVE | DELETE |
| START STREAM | DECLARE/OPEN CURSOR |
| STORE | INSERT |
| DCL Command | Yields | Notes |
|---|---|---|
| $SQL$MOD program_bas.sqlmod | program_bas.obj | your SQL subroutines are located here |
| $basic program.bas | program.obj | compile the way you normally would |
| $link program.obj, program_bas.obj | program.exe | include the new object file to your link command |
| DCL Command | Yields | Notes |
|---|---|---|
| $SQL$PRE/cobol program.sco | program.cob |
- Your COBOL source code must be maintained in ".sco" format - This new ".cob" file is expendable |
| $cobol program.bas | program.obj | compile the way you normally would |
| $link program.obj | program.exe | link the way you normally would |
| DCL Command | Yields | Notes |
|---|---|---|
| $rdbpre/basic program.rba | program.bas |
- Your BASIC source code must be maintained in ".rba" format - This new ".bas" file is expendable |
| $basic program.bas | program.obj | compile the way you normally would |
| $link program.obj | program.exe | link the way you normally would |
Symbol Definition For Various Languages |
$ SADA :== $SQL$PRE/ADA |
Caveat: the following information came from tests on OpenVMS-7.3-2 Alpha. I can only assume it would be the same on OpenVMS-8-4.
| sys$help | RDB071.INSTALL_GUIDE RDB071A.RELEASE_NOTES ... RDB071D.RELEASE_NOTES |
| sys$examples | various things |
| sys$manager | control + shutdown scripts |
| sys$startup | startup scripts |
| sys$library | version control scripts |
$!============================================================
$! title : rdb_demo1_create_db.com
$! author : Neil Rieck
$! created: 2004-09-11
$! NSR 051231 tweaked for public display
$!============================================================
$ env_verify = f$environment("verify_procedure") ! remember verify_state
$ set nover ! now force verify: OFF
$ say :== write sys$output !
$ ask :== inquire/nopunct !
$ bel[0,8]==7 !
$ on warn then goto warning_handler ! don't take any chances
$ set on !
$ say "" !
$ say "rdb_demo1_create_db.com" !
$ say "=======================" !
$ temp = f$trnlnm("csmis$dat") ! does this logical exist?
$ if temp .eqs. "" ! nope
$ then !
$ temp2 = f$environment("DEFAULT") ! get our current default directory
$ set ver !
$ def/sys/log csmis$dat 'temp2' ! so we'll create the file in current directory
$ setnover !
$ endif !
$ temp = f$search("csmis$dat:rdb_demo1_db.rdb") !
$ if temp .nes. "" !
$ then
$ say "-w- warning: database 'csmis$dat:rdb_demo1_db.rdb' already exists"
$ say " and continuing will create a new database over the old one"
$ ask choice "Continue? (y/N) " !
$ choice = f$extract(0,1,choice) !
$ if choice .nes. "Y" then goto sortie1 ! don't take any chances
$ endif
$ set ver ! watch the SQL$ statements
$sql$ ! this will only work after "@sys$library:RDBVMS_SETVER.COM reset"
!
! WARNING: if the database already exists, this command will create another new one
!
create database filename csmis$dat:rdb_demo1_db.rdb
number of users 500 ! number of connections (e.g. 125 users x 4 connections each)
number of cluster nodes 1; ! if not in an OpenVMS cluster then set to 1 to improve performance
!
! domains can be used to provide a uniform column definition between tables
! eg. alter table customer add column tel3 standard_tel after column tel2;
!
create domain standard_address char(25);
create domain standard_city char(20);
create domain standard_name char(30);
create domain standard_tel char(10);
commit;
!
create table customer(
name char(30),
address char(25),
city char(20),
tel1 char(10),
tel2 char(10));
commit;
!
alter table customer add column postal char(6) after column city;
alter table customer add column province char(15) after column city;
commit;
!
insert into customer values(
'Neil Rieck',
'20 Water St N',
'Kitchener',
'Ontario',
'N2H5A5',
'5195551212',
'');
insert into customer values(
'Steve Kennel',
'20 Water St N',
'Kitchener',
'Ontario',
'N2H5A5',
'5195551212',
'');
insert into customer values(
'Dave McNeil',
'140 Bayfield St',
'Barrie',
'Ontario',
'L4M3B1',
'7055551212',
'');
insert into customer(
name,address,city,province,postal,tel1,tel2)
values(
'Karim Macklai',
'220 Simcoe St',
'Toronto',
'Ontario',
'M5T1T4',
'4165551212',
'');
commit;
!
exit ! exit from SQL$
$sortie1: !
$ set nover !
$ goto sortie2 !
$warning_handler: !
$error_handler: !
$ set noon !
$ set nover !
$ say "-e- did you execute the script '@sys$library:RDBVMS_SETVER.COM reset' ?"
$sortie2: !
$ if env_verify .eqs. "TRUE" then set verify
$ exit ! adios
Note that "Rdb Web Agent" is not recommended for new code development. In 2004-11-xx I sent a note to the "Oracle-Rdb team" asking them why the "Rdb Web Agent" links were buried in their web site. Here is their response:The Rdb Web Agent software works well but it is very much out of date. We are working hard to help you deliver great web based applications by enhancing our support for Java and JDBC based applications and by working on integration of Oracle-Rdb with Oracle Application Server. We don't want customers to make a mistake by starting new development work with the Rdb Web Agent. That's why we don't have links to these pages.
Note: Be sure not to confuse "Oracle-Rdb" with "Oracle Database" (a.k.a. Oracle 8i, Oracle 9i, Oracle 10g, Oracle 11g, etc.). They are two different product lines.
Product Note Description Oracle 8 Just a very cool SQL-compliant database Oracle 8i i=internet Oracle 8 with added Java support for easy interfacing to the INTERNET (built-in callable Internet package s/w) Oracle 9i i=internet Oracle 8i with many more features including auto-tuning Oracle 10g g=grid Oracle 9i with many more features including support for GRID computing Oracle 11g g=grid Oracle 10g with many more features including automated self-management and testing; XML support; compression
Link: Programming examples of how to access 'Oracle Rdb' from 'HP-BASIC for OpenVMS' using SQLMOD
FIND #31, KEY# NXEQ target$ ! set the key of reference
label_1:
GET #31,REGARDLESS ! read a record but don't apply a lock
test the data, then...
goto label_1 ! read more
or...
goto label_2 ! exit
or...
modify the current record like so:
my_rfa = GETRFA(31) ! determine the RFA that we've stopped on
GET #42, RFA my_RFA ! place a lock on the record using another channel
change the record data !
UPDATE #42 ! write the change back to disk using another channel
then...
goto lable_1 ! read more
or...
fall thru to label_2 ! exit
label_2:

"TP
Software Development for OpenVMS"
"Rdb:
A Comprehensive Guide - Third Edition
"Rdb:
A Comprehensive Guide - Second Edition
"Rdb/VMS:
A Comprehensive Guide (First Edition)
"SQL
for Dummies"Links: Click to here to download a quick hack demo program that shows how to extract information from a web page submitted to Apache for OpenVMS (CSWS) using CGI (Common Gateway Interface). This program can run in four different modes: CRT (green screen), WEB=GET, WEB=POST and WEB=GET+POST. It shows how to submit forms. It contains a small amount of RMS code to show how to interface RMS to the WEB. It also shows how to do a JAVASCRIPT pop-up window. Click OpenVMS Notes: CSWS-Tips if you need to modify your Apache environment.
Business over the web (an OpenVMS future without VT-100 terminals)
Back
to
OpenVMS
Back
to Home