Professional Documents
Culture Documents
NET
VB.NET is implemented by Microsoft's .NET framework. Therefore, it has full access to all the
libraries in the .Net Framework. It's also possible to run VB.NET programs on Mono, the open -
source alternative to .NET, not only under Windows, but even Linux or Mac OSX.
Object oriented.
Component oriented.
Easy to learn.
Structured language.
.Net Framework
The .Net framework is a revolutionary platform that helps you to write the following types of
applications:
Windows applications
Web applications
Web services
The .Net framework applications are multi – platform applications. The framework has been
designed in such a way that it can be used from any of the following languages: Visual Basic,
C#, C++, Jscript, and COBOL, etc.All these languages can access the framework as well as
communicate with each other.
The .Net framework consists of an enormous library of codes used by the client languages like
VB.Net. These languages use object - oriented methodology.
Windows Forms
ADO.Net
The last two are free. Using these tools, you can write all kinds of VB.Net programs from simple
command - line applications to more complex applications. Visual Basic Express and Visual
Web Developer Express edition are trimmed down versions of Visual Studio and has the same
look and feel. They retain most features of Visual Studio. In this tutorial, we have used Visual
Basic 2010 Express and Visual Web Developer (for the web programming chapter). You can
download it from here. It gets automatically Istalled in your machine. Please note that you need
an active internet connection for installing the express edition.
Introduction to SQL
SQL is nonprocedural language that provides database access. It is nonprocedural in that users
describe in SQL what they want done, and the SQL language compiler automatically generates a
procedure to navigate the database and perform the desired task.
Oracle SQL includes many extensions to the ANSI/ISO standard SQL language, and Oracle tools
and applications provide additional statements. The Oracle tools SQL*Plus and Oracle
Enterprise Manager let you run any ANSI/ISO standard SQL statement against an Oracle
database, as well as additional statements or functions that are available for those tools.
Although some Oracle tools and applications simplify or mask SQL use, all database operations
are performed using SQL. Any other data access method circumvents the security built into
Oracle Database and potentially compromises data security and integrity.
SQL Statements:
All operations performed on the information in Oracle Database are run using SQL statements. A
statement consists of identifiers, parameters, variables, names, datatypes, and SQL reserved
words. SQL reserved words have special meaning in SQL and cannot be used for any other
purpose. For example, SELECT and UPDATE are reserved words and cannot be used as table
names.
A SQL statement is a computer program or instruction. The statement must be the equivalent of
a complete SQL sentence, such as:
Only complete SQL statements can be run. A fragment such as the following generates an error
indicating that more text is required before a SQL statement can run:
SELECT last_name;
Data manipulation language (DML) statements query or manipulate data in existing schema
objects. They enable you to:
Retrieve or fetch data from one or more tables or views (); fetches can be scrollable
(see "Scrollable Cursors").
Lock a table or view, temporarily limiting other users' access (LOCK TABLE).
DML statements are the most frequently used SQL statements. Some examples of DML
statements are:
’14-FEB-1988’,1600,500,30);
When a DML statement encounters an error, the statement can continue processing while the
error code and the associated error message text is logged to an error logging table. This is
particularly helpful to long-running, bulk DML statements. After the DML operation completes,
you can check the error logging table to correct rows with errors.
New syntax is added to the DML statements to provide the name of the error logging table, a
statement tag, and a reject limit. The reject limit determines whether the statement should be
aborted. For parallel DML operations, the reject limit is applied for each slave. The only values
for the reject limit that are precisely enforced on parallel operations are zero and unlimited.
With data conversion errors, Oracle Database tries to provide a meaningful value to log for the
column. For example, it could log the value of the first operand to the conversion operator that
failed. If a value cannot be derived, then NULL is logged for the column.
Data Definition Language Statements
Data definition language (DDL) statements define, alter the structure of, and drop schema
objects. DDL statements enable you to:
Create, alter, and drop schema objects and other database structures, including the
database itself and database users (CREATE, ALTER, DROP).
Delete all the data in schema objects without removing the objects' structure
(TRUNCATE).
DDL statements implicitly commit the preceding commands and start new transactions. Some
examples of DDL statements are:
Transaction control statements manage the changes made by DML statements and group DML
statements into transactions. They enable you to:
Session control statements manage the properties of a particular user's session. For example, they
enable you to:
Alter the current session by performing a specialized function, such as enabling and
disabling the SQL trace facility (ALTERSESSION).
Enable and disable roles (groups of privileges) for the current session (SET ROLE).
System control statements change the properties of the Oracle database instance. The only
system control statement is ALTERSYSTEM. It enables you to change settings (such as the
minimum number of shared servers), terminate a session, and perform other tasks.
Embedded SQL statements incorporate DDL, DML, and transaction control statements within a
procedural language program. They are used with the Oracle precompilers. Embedded SQL
statements enable you to:
Oracle Database automatically notices when applications send similar SQL statements to the
database. The SQL area used to process the first occurrence of the statement is shared—that is,
used for processing subsequent occurrences of that same statement. Therefore, only one shared
SQL area exists for a unique statement. Because shared SQL areas are shared memory areas, any
Oracle Database process can use a shared SQL area. The sharing of SQL areas reduces memory
use on the database server, thereby increasing system throughput.
In evaluating whether statements are similar or identical, Oracle Database considers SQL
statements issued directly by users and applications as well as recursive SQL statements issued
internally by a DDL statement.
Parsing
Parsing is one stage in the processing of a SQL statement. When an application issues a SQL
statement, the application makes a parse call to Oracle Database. During the parse call, Oracle
Database:
Determines whether the process issuing the statement has privileges to run it.
Oracle Database also determines whether or not there is an existing shared SQL area containing
the parsed representation of the statement in the library cache. If so, the user process uses this
parsed representation and runs the statement immediately. If not, Oracle Database generates the
parsed representation of the statement, and the user process allocates a shared SQL area for the
statement in the library cache and stores its parsed representation there.
Note the difference between an application making a parse call for a SQL statement and Oracle
Database actually parsing the statement.
A parse call by the application associates a SQL statement with a private SQL area. After
a statement has been associated with a private SQL area, it can be run repeatedly without
your application making a parse call.
A parse operation by Oracle Database allocates a shared SQL area for a SQL statement.
Once a shared SQL area has been allocated for a statement, it can be run repeatedly
without being reparsed.
Both parse calls and parsing can be expensive relative to execution, so perform them as seldom
as possible.
See Also:
"Overview of PL/SQL"
Although parsing a SQL statement validates that statement, parsing only identifies errors that can
be found before statement execution. Thus, some errors cannot be caught by parsing. For
example, errors in data conversion or errors in data (such as an attempt to enter duplicate values
in a primary key) and deadlocks are all errors or situations that can be encountered and reported
only during the execution stage.
Query Processing
Queries are different from other types of SQL statements because, if successful, they return data
as results. Whereas other statements simply return success or failure, a query can return one row
or thousands of rows. The results of a query are alwaysin tabular format, and the rows of the
result are fetched (retrieved), either a row at a time or in groups.
Several issues relate only to query processing. Queries include not only
explicit SELECT statements but also the implicit queries(subqueries) in other SQL statements.
For example, each of the following statements requires a query as a part of its execution:
In particular, queries:
Can require the describe, define, and fetch stages of SQL statement processing.
SQL Processing
This section introduces the basics of SQL processing. It starts with a flowchart of typical SQL
statement execution which generally covers most types of SQL statements. followed by a general
description of the stages of SQL statement processing, and then a section indicating how the
flowchart and description may differ for different types of SQL statements.
Topics include:
Figure 24-1 outlines the stages commonly used to process and run a SQL statement. In some
cases, Oracle Database can run these stages in a slightly different order. For example,
the DEFINE stage could occur just before the FETCH stage, depending on how you wrote your
code.