Database Reference
In-Depth Information
Creating SQL Views for the View Ridge Gallery Database
In Chapter 7, we discussed the use of SQL views in a database. We now show how to create
and use them in the specific DBMS.
Database Application Logic and SQL/Persistent Stored Modules (SQL/PSM)
In order to be used in an application (such as a Web site application), a database must be ac-
cessible from that application, and several application-related problems (such as creating and
storing application variables) must be overcome. While this can be done within an application
programming language such as Java; a Microsoft .NET language such as C#.NET, C++.NET, or
VB.NET; or the PHP Web scripting language (discussed in Chapter 11), we base our main dis-
cussion on how application logic can be embedded in SQL/Persistent Stored Modules (SQL/
PSM)— user-defined functions , triggers , and stored procedures .
For each specific DBMS product, we examine and explain various SQL/PSM constructs
and features:
Variables
Parameters
Control-of-flow statements
BEGIN … END blocks
IF … THEN … ELSE structures
WHILE (looping) structures
RETURN {value} structures
Cursor structures and statements
SQL transaction control statements
Output statements
We then use these elements to build DBMS SQL/PSM-specific user-defined functions, stored
procedures, and triggers, and we cover these topics in a depth far beyond our coverage in
Chapter 7. We build and run several stored procedures and triggers, explaining both the
application use of the trigger or stored procedure and additional programming elements that
are useful when creating user-defined functions, stored procedures, and triggers.
DBMS Concurrency Control
We discussed the concept of concurrency control in Chapter 9. As you would expect, each DBMS
product implements concurrency transaction isolation level and locking behavior in its own
way, which we examine for each specific DBMS product in the appropriate online chapter.
DBMS Security
We discussed security in general terms in Chapter 9. For each specific DBMS product, we
summarize how those general ideas pertain to that product, examine the specific server and
database security options available, and create users with specific security privileges. We cover
these topics in a depth far beyond our coverage in Chapter 7, and when we are done creating
the needed database users for the VRG database, we are ready to use these users to provide the
needed database security for our Web database applications in Chapter 11.
DBMS Database Backup and Recovery
As explained in Chapter 9, databases and associated log files should be backed up periodically.
When backups are available, it is possible to recover a failed database by restoring it from a
prior database save and applying changes in the log. Again, we cover these topics in a depth far
 
 
 
 
 
 
Search WWH ::




Custom Search