The purpose of SQLView is to create a user friendly interface for browsing a SQL database and modifying SQL tables. This documentation outlines the basic functionality of SQLView and provides a quick reference for more experienced users.
SQLView is available at SourceForge. Refer to these pages for more details on the use of this application, obtaining this program, it's configuration and installation.
To connect to your SQL database, enter the following information into the appropriate text fields on the main screen. Depending on the local configuration, any of the following fields might be defaulted - so you will not even see it.
Database Type
This is the type of database to be used and may be any database supported
by PEAR::DB which includes
MySQL, Sybase, Oracle, DB2 and Postgres among others.
ex: "mysql"
Database Host
This is the name of the database host website or host associated with the
SQL database.
ex: "myhostname.net"
Database Name
This is the name of the database you wish to view or modify.
ex: "db1"
User Name
ex: "user101"
Password
ex: "abc123"
Optional Table Name
If you know the name of the specific table you wish to view or modify, enter one.
If this field is left blank, the program will query your database and
generate a list of tables for you to choose from.
You will be presented with a list of the tables in the database. Click on any one of the tables to perform a query of that table.
Once you have chosen a table, you are presented with a row of functions at the top of the screen. These functions will allow you to perform several basic sets of operations. These options are available:
Select Table
This operation will leave the current table and generate a list of tables
in the database. Click on any one of the tables to perform a query of that table.
Desc <table_name>
This operation will query the database for information about the current table.
It will then display a list of the field names, field types, and keys pertaining
to that table. This could be incomplete if the method tableInfo
in PEAR::DB does not provide flags indicating
the primary key or auto increment flags for a column.
Add Record
This operation will query the database for the field names and data types
of the current table. Then, it will display a form containing a list of
the fields and blank "Value" text boxes to be filled out.
After completing the form, you may click "Add This Record" to add
the new row to the table. This capability is not enabled if the table
has no primary key.
Show All Records
This operation will select the contents of the current table and display them
in a table format on the screen.
Disconnect
This will leave the database and return to the login page, where you may
connect to a different database or leave the system entirely.
New Session
This will bring up a new window at the login page, where you may connect
to a different database or load another session of the same database.
This feature can be used effectively to compare the contents of two
or more tables side-by-side.
If you are viewing the contents of a table, there should be a query box near the top of the screen, just under the function bar. There are several settings in this box which you may find useful.
Records per Page:
Notice that the default number of records per page displayed on one screen is 25.
You may change that to various other values.
Page Navigation
There are two main forms of navigating through the pages of your tables.
First, you may simply click the "Previous" or "Next"
buttons to navigate one page back or one page forward.
Or, you may enter a page number into the "Page" textbox and
click "Show" to jump directly to that page (if it exists).
Query Field
In the query field, you may enter a SQL query to your database and
click the "Query" button to perform the query.
The default query is "Select * FROM <table_name>",
where <table_name> is the name of the table you are currently viewing.
One source for help writing SQL queries can be found on the MySQL Documentation
page at http://www.mysql.com/documentation/.
Given any table of data, the table layout will have the same basic structure. The table will have columns across the page and rows down the page. For user clarity, field name headers are placed at the top of the columns in the table.
Editing Data
You may edit any particular row of data by simply clicking the link in
the left-most column of that row.
This will bring up a table editing form to be used for changing the
contents of that row. You may also copy or delete rows by clicking
the respective links in the "Modify" column, the right-most
column of the table. For more information on editing tables,
read the Editing a Table section below.
Once you understand the basic layout of a table, you may edit the table in several ways. The easiest ways to edit a table are using the provided links in the table view.
Editing a Row
For each row of data in your table, there will be a link to edit the row
in the left-most column.
If you click this link, you will be directed to a form where you may
edit the contents of that particular row.
The form is a table with the column headers "Field Name",
"Value", and "Data Type".
Each field name in your SQL table has a separate row, and you may
modify the contents of the field by changing the text in the
"Value" textbox.
The "Data Type" field shows the type of data that can be
stored in each particular field. When you are done editing the row of data,
simply click the "Update This Record" button.
This capability is not enabled if the table has no primary key.
Copying a Row
For each row, there is a link to copy the row in the right-most column
(the "Modify" column).
If you click this link, you will be directed to the same edit form
mentioned above, with a few main differences.
First, the contents of the form will match the contents of the row exactly.
If you have a primary key set, that field must be unique for each row in the table.
Thus, if you try to copy a row and do not change the primary key,
the SQL insert statement will fail and you will not be able to add the row.
When you are ready to insert the row of data, click the
"Add This Record" button.
This capability is not enabled if the table has no primary key.
Deleting a Row
For each row, there is a link to delete the row in the right-most column
(the "Modify" column).
If you click this link, you will be directed to a confirmation form.
The form will display the contents of the row you chose to delete.
If you want to proceed, click the "Remove This Record" button
to delete the row of data. This capability is not enabled if the
table has no primary key.