Universal Database (netDB2) Introductory Guide
The netDB2 Environment
When you log onto netDB2, the browser will display the netDB2 interface
which allows you single click access to a commercial-strength database
management system. Using the interface, you can create, drop, and alter
the tables in your database, load data into the tables, run SQL queries
and save results in files. The netDB2 interface offers you the following
functionalities:
- The SQL Textbox:
You can enter your SQL queries including
commands to create, alter, and drop tables, and run SQL queries into
the textbox. If you need to save your queries, we suggest that you write
your SQL commands into a file on your local machine and use the cut and
paste options to enter command into the textbox. This will prevent you
from losing the work since currently the SQL command entered into the textbox
is not saved by the system. Please note that you can use the textbox
to enter only a SINGLE SQL command only. If you enter multiple commands,
only the first command will be executed. Also, do not need to terminate
your command with a semi-colon (;) as is usually done in SQL.
- Get Table Information:
You can use the get table information
button to display the schema of the current tables in your databases.
The table information is displayed in the panel on the right hand side.
Since your database may consist of many tables, you will need to use the
scroll button to look through the schema definition of all your tables.
Please note that currently, netDB2 DOES NOT display the information about
constraints (e.g., primary key, unique, check constraints, referential
integrity constraints, etc.) you may have specified as part of your schema.
When you create tables, we suggest that you save the commands used for
this purpose in a file in your local machine. Else, later you will not
be able to figure out the constraints declared on the table. As we mentioned
in class, netDB2 is a system prototype which is still being built, and
future iterations of netDB2 will provide support for users to visualize
the schema including table level as well as general constraints more properly.
- netDB2 Load Facility:
netDB2 allows you a powerful
mechanism to load data into tables from files on your local computer. All
you need to do is to specify the table into which you wish the data loaded,
and also the local file on your machine containing the data. The local
file can be accessed by using the browse button which allows you to look
navigate through your local directory to get to the file to be loaded.
Please note that the file to be loaded must adhere to a specified syntax
as is specified in the load section of this introductory guide.
- netDB2 Script Center:
Often you would find yourself
wanting to run multiple SQL commands one after another. For example, once
you have decided on the schema for your tables, you need to enter them
into netDB2. If you use the SQL textbox for this purpose, you will only
be able to enter a single create table command at one time. You may find
it more useful to enter multiple commands (one for each table to be created)
all at once using the netDB2 script center. To access the Script Center,
simply press the Script Center button. This will pop up a new window for
you which has a textbox into which you can enter your script. As suggested
before, it is advisable that you write your script into a file on your
local computer and use the cut and paste option of your local computer
to enter the script into the netDB2 script textbox. This way your work
is saved on your local machine.
- netDB2 Stored Procedures Tool:
netDB2 allows you to enter
SQL procedures using its Stored Procedure tool. Simply click on the stored
procedure tool and another window will pop up.. The Stored procedure window
will allow you to list the procedures that you have declared so far.
Also, a textbox allows you to create new procedures. As with the SQL query
textbox and the Script textbox, remember to save your stored procedures
in a local file and use cut and paste to enter the procedures into netDB2.
This way you will have a copy of all the procedures you have declared so
far. Once you have declared stored procedures, you can use them in any
SQL query.
|