[Info-vax] SQLite port for OpenVMS (Re: Is there currently a functioning link for hobbyist licenses?)
Jan-Erik Soderholm
jan-erik.soderholm at telia.com
Fri Mar 13 19:16:53 EDT 2015
David Froble skrev den 2015-03-13 19:32:
> Bill Gunshannon wrote:
>
>> Hmmm.... Hey Dave, what about an SQLite Pre-compiler for VMS BASIC? :-)
>
> To be honest, I don't understand what a pre-compiler does.
Look at SQL as just another "language". If you have a Cobol file
with embedded SQL statements, the pre-compiler first "compiles"
the SQL into standard Cobol statements that then the Cobol
compiler understands. Then it all is compiled "as usual".
The precompiler doesn't change the pure Cobol code at all.
>
> The ony database I have used is MicroSoft's SQL-2000. With that, I built
> stored procedures, that were stored in the database. I then invoked the
> procedures from Visual Basic, passing parameters as required, and depending
> on the operation, got back record sets, or the procedure made changes int
> he database.
>
Yep, stored procedures (and functions) are suported by most DBs today.
> Included with the database is the "Enterprise Manager", which allowed you
> to do all kinds of things, define tables, look at tables, change tables,
> and such. There is also the "Query Analyzer", if I remember the correct
> name, it's been 13 years, which allowed you to write and run SQL
> statements. I always tested things in the analyzer.
>
> Both of those utilities were GUI based, as you'd expect on weendoze.
>
Yep, I had work mates that had taken the lessions and used the GUI.
But when they messed things up, I had to help them, since I had used
the command line tools (where you could do anything) for Sybase on VMS.
The GUI could not get them out of the catch-22 state they had put
themself into...
> Now, I have the impression that other database products don't work in the
> same manner.
In what "manner"? All databases let you manage your database and data!
> Because of that, I'm not sure how to begin to attempt to use
> another database product. The two utilities mentioned is what allowed me
> to learn how to use the database.
All databases let you create tables and make operations on the data.
What use whould it be otherwise? If you use a GUI or not is of
no importance, but the tools certenly are there.
Want to create a database? Right, look up "create a database"!
Want to create a table? OK, look up "create a table"!
I must be missing something fundamental in your question...
>
> I'd like to learn about other database products. While I may complain
> about C code examples as "documentation", I confess that I think the
> easiest way I could start with another database product would be to see
> some examples. Go figure ....
OK, here are some very simple examples using Rdb.
Create a new and empty database:
$ cre/dir <.rdbdemo>
$ set def <.rdbdemo>
$ dir
%DIRECT-W-NOFILES, no files found
$
$ sql$ create database filename mydemo;
$
$ dir/date/size
Directory USER:<JANNE.RDBDEMO>
MYDEMO.RDB;1 2943 13-MAR-2015 23:40:41.14
MYDEMO.SNP;1 404 13-MAR-2015 23:40:41.25
Total of 2 files, 3347 blocks.
$
Now open (attach to) the database and create a table:
$ sql$
SQL> attach 'filename mydemo';
SQL> create table mytab1 (f1 char(5), f2 integer, f3 char(5));
SQL> commit;
SQL>
SQL> show tables;
User tables in database with filename mydemo
MYTAB1
SQL> show table (columns) mytab1;
Information for table MYTAB1
Columns for table MYTAB1:
Column Name Data Type Domain
----------- --------- ------
F1 CHAR(5)
F2 INTEGER
F3 CHAR(5)
SQL>
Now add some data:
SQL> insert into mytab1 values('ABC', 5, 'DEF');
1 row inserted
SQL> insert into mytab1 values('GHI', 10, 'JKL');
1 row inserted
SQL> commit;
SQL>
And finaly get some data back from the table:
SQL> select * from mytab1;
F1 F2 F3
ABC 5 DEF
GHI 10 JKL
2 rows selected
SQL>
SQL> select * from mytab1 where f3='JKL';
F1 F2 F3
GHI 10 JKL
1 row selected
SQL>
Any questions on that?
Take a backup of your database:
$ rmu/backup mydemo mydemo_backup
$ dir/date/size
Directory USER:<JANNE.RDBDEMO>
MYDEMO.RDB;1 2943 13-MAR-2015 23:40:41.14
MYDEMO.SNP;1 404 13-MAR-2015 23:40:41.25
MYDEMO_BACKUP.RBF;1 756 14-MAR-2015 00:07:08.86
Total of 3 files, 4103 blocks.
$
Then you can go on and create anything else you need
in the database:
SQL> help create
CREATE
Additional information available:
CACHE CATALOG COLLATING_SEQUENCE DATABASE DOMAIN FUNCTION
INDEX MODULE OUTLINE PROCEDURE PROFILE ROLE Routine
SCHEMA SEQUENCE STORAGE_AREA STORAGE_MAP SYNONYM
TABLE TRIGGER USER VIEW
CREATE Subtopic?
These are of course extremely simple (but working just fine!)
examples.
For small and simple cases you just take the defaults and it will
run just fine. If you want you can tweek some parameters and get
better performance in your specific case.
More information about the Info-vax
mailing list