HPlogo Up and Running with ALLBASE/SQL: HP 3000 and HP 9000 Computer Systems > Chapter 1 Very Basic...

How Do I Access a Database?

» 

Technical documentation

Complete book in PDF
» Feedback

 » Table of Contents

 » Index

You use the SQL CONNECT statement to establish a connection to the DBEnvironment. You can then access a particular database as follows:

  • Through ISQL.

  • Through application programs you create yourself.

During database access, you perform queries or other operations that manipulate data by inserting, deleting, or modifying rows in tables. This process is called data manipulation.

Queries and Other Data Manipulation

Data manipulation statements access the data in databases. An example is a query using the SQL SELECT statement, which displays a selection of data from database tables. Here is a simple query for information from the Employees table. The asterisk means all rows and columns:

   SELECT * FROM Employees;

Below is the query result:

   select * from employees;                                                

   --------------+-----------+-----------         

   LASTNAME      |FIRSTNAME  |EMPNUMBER           

   --------------+-----------+-----------         

   Harrison      |Gerald     |    2432099         

   Abelson       |Annette    |    3510044         

   Stanley       |Peter      |    3540011         

   Walters       |Georgia    |    9124772         

The query result is also known as a result table.

Other data manipulation statements include the SQL INSERT, UPDATE, and DELETE statements. These let you add rows to a table, update specific column values in existing rows, or delete rows. Many examples of data manipulation are shown in later chapters.

Feedback to webmaster