|
Data manipulation statements let you access and modify the contents of your database. Pervasive PSQL allows you to construct data manipulation statements to do the following:
The following sections briefly describe the SQL statements associated with each of these tasks.
All statements you use to retrieve information from a database are based on the SELECT statement.
When you create a SELECT statement, you can use various clauses to specify different options. (See the entry for the SELECT statement in ODBC Engine Reference for detailed information about each type of clause.) The types of clauses you use in a SELECT statement are as follows:
In addition, you can use the UNION keyword to obtain a single result table from multiple SELECT queries.
You can add, change, or delete data from tables and views by issuing statements such as the following:
|
Adds rows to one or more tables or a view.
|
|
|
Changes data in a table or a view.
|
|
|
Deletes rows from a table or a view.
|
When you create a DELETE or UPDATE statement, you can use a WHERE clause to define search criteria that restrict the data upon which the statement acts.
To update the data in a database, you can issue SQL statements individually or you can define transactions (logical units of related statements). By defining transactions, you can ensure that either all the statements in a unit of work are executed successfully or none are executed. You can use transactions to group statements to ensure the logical integrity of your database.
Pervasive PSQL supports the ODBC API SQLTransact. See the Microsoft ODBC Programmer's Reference for more information.
You can create and delete views by constructing SQL using the following statements:
|
Defines a database view and stores the definition in the dictionary.
|
|
|
Deletes a view from the data dictionary.
|
A stored procedure consists of statements that you can precompile and save in the dictionary. To execute stored procedures, construct statements using the following:
|
CALL or EXEC[UTE]
|
Recalls a previously compiled procedure and executes it.
|
A system stored procedure helps you accomplish those administrative and informative tasks that are not covered by the Data Definition Language. The system stored procedures have a psp_ prefix. To execute stored procedures, construct statements using the following:
|
CALL or EXEC[UTE]
|
Recalls a system stored procedure and executes it.
|
For more details, see System Stored Procedures .
A trigger consists of statements you can precompile and save in the dictionary. Triggers are executed automatically by the engine when the specified conditions occur.
|
Chapter contents
Prev topic: Data Definition Statements
|