August 31st, 2009

Host Programs, Ada

Posted by admin in S. Host Programs
Syntax Element           In Ada
prefix                   EXEC SQL
terminator               ;
target                   label_name
Variable Definition Syntax
Ada variable definition =
    Ada variable name.,.. : Ada type spec
    [ = character representation...]
Ada type spec is given below.
The = character representation... sequence
  is an optional initial value.
The Ada variable definition is specified within the scope
of Ada WITH and USE clauses that specify the following:
with SQL_STANDARD;
use SQL_STANDARD;
use SQL_STANDARD.CHARACTER_SET;
This will import the following built-in SQL type definitions:
SQL_STANDARD.BIT (1..length)
SQL_STANDARD.CHAR [CHARACTER SET [IS]
  character set name] (1..length)
SQL_STANDARD.DOUBLE_PRECISION
SQL_STANDARD.INT
SQL_STANDARD.REAL
SQL_STANDARD.SMALLINT
SQL_STANDARD.SQLCODE_TYPE
SQL_STANDARD.SQLSTATE_TYPE
SQL Type                Ada Type
BIT(length)             BIT (1..length)
CHAR(length)            CHAR (1..length)
DOUBLE PRECISION        DOUBLE_PRECISION
INT                     INT
REAL                    REAL
SMALLINT                SMALLINT
SQLCODE                 SQLCODE_TYPE or INTEGER
SQLSTATE                SQLSTATE_TYPE or CHAR(5)
indicator               INDICATOR_TYPE
August 24th, 2009

Advance Topics, Performance Tuning

Posted by admin in T. Advance Topics

An SQL query is a non-procedural process. This means that one query may result in many thousands of rows being processed to give you just a few rows in the results table. With such vast amounts of data being processed, anything that can be done to make the process faster is called performance tuning.SQL tuning is the process of arranging the SQL statement for the most efficient access of the database. This includes such things as the order in the FROM clause, WHERE clause, use of an INDEX, etc.

Database tuning is the process of configuring the database for the most efficient access. This includes database design, layout of tables, creation or dropping of indexes, views, disk allocation, memory usage, etc.

To do SQL tuning, start with proper SQL formatting of the statement. See SQL Formatting under SQL Basics. While this will not improve performance, it is necessary for easy human comprehension of the statement.
> Many RDBMS systems have tools for evaluating an SQL statement.

> DB2 and Oracle have a tool called EXPLAIN PLAN.

August 21st, 2009

Advance Topics, Concurrency Control

Posted by admin in T. Advance Topics

Concurrency is when two users try to update the same data at nearly the same time.

 

RDBMS systems use locking to prevent users from reading data that is being changed by other users. This is why a SELECT statement may need the option FOR UPDATE. The locking ensures transaction integrity and database consistency. Concurrency transparency means that data locking makes each transaction appear as though it is the only transaction. Sometimes each user is trying to access data locked by the other user causing a deadlock. Most RDBMS systems unlock one user, process that user, and then unlock the other user.

Next Page »