SQL/400 by Example

SQL/400 by Example

by James Coolbaugh
     
 

View All Available Formats & Editions

From basic terminology and syntax to copious examples of real-life code, this is the complete guide to SQL/400. It offers a thorough grounding in the program for novices, but even very experienced AS/400 programmers will find it an invaluable guide to such issues as how to embed SQL within an RPG program, how to use SQL on distributed databases, and how to embed SQL… See more details below

Overview

From basic terminology and syntax to copious examples of real-life code, this is the complete guide to SQL/400. It offers a thorough grounding in the program for novices, but even very experienced AS/400 programmers will find it an invaluable guide to such issues as how to embed SQL within an RPG program, how to use SQL on distributed databases, and how to embed SQL statements within an HLL program.

Editorial Reviews

Booknews
A resource for both novices and experienced programmer, covering everything from syntax and rules to the specifics of embedding SQL within an RPG program. Features plenty of introductory level text and examples for novice SQL users, covering all features and terminology of SQL/400, and offers specific examples for experienced AS/400 programmers designed to increase understanding on SQL concepts and improve programming skills. Annotation c. by Book News, Inc., Portland, Or.

Product Details

ISBN-13:
9781583040300
Publisher:
29th Street Press
Publication date:
03/15/1999
Series:
News 3x-400 Technical Reference Series
Edition description:
PENTON TECHNOLOGY MEDIA
Pages:
179
Product dimensions:
7.04(w) x 8.96(h) x 0.48(d)

Read an Excerpt

Chapter 1: What Is SQL?

SQL stands for Structured Query Language. SQL was developed at IBM labs in the 1970s with the idea of providing an English-like language with which to access a database. But SQL is more than just a query language; SQL lets you create database files and make changes to a database file.

Standard SQL statements can run on many different operating systems. Therefore, once you have mastered SQL on one machine, you can use it on any other machine that has SQL. However, SQL is not a magic tool. You still must have an excellent understanding of your database to effectively extract the data you need. Without that knowledge, SQL won't help you any more than any other query tool will.

On the AS/400, SQL is part of the base operating system. However, unless you purchase a third-party package or SQL/400, you cannot easily execute SQL statements. This book focuses on both the SQL/400 product offered by IBM and the other SQL statements available.

The SQL offered on the AS/400 contains many of the same functions as SQL offered on other platforms. However, IBM has incorporated some new functions not available on other platforms. Likewise, some SQL functions available on other platforms may not be available on the AS/400. We make no attempt in this book to compare SQL on the AS/400 to other SQL products available.

Before we discuss the available SQL statements, let's look at several of the components of SQL and the features available with the SQL/400 product.

SQL Language Components
We can break the SQL language into four basic types of statements: Data Definition Language (DDL), Data Manipulation Language (DML), Dynamic SQL, andMiscellaneous. Two of these components - DDL and DML - are called languages to differentiate their purpose from that of other SQL statements, but both are part of SQL.

Data Definition Language (DDL)
DDL consists of those statements that let you create, delete, and control access to SQL libraries, files, indexes, views, and packages. These statements are similar to the CRT, DLT, GRT, and RVK commands on the AS/400.

Data Manipulation Language (DML)
DML consists of those statements that let you read, update, add, and delete records in a database file. DML statements are the ones you will use most often. Also included in this category are those statements used during the programming of SQL statements in a high-level language (HLL), such as RPG or Cobol.

Dynamic SQL Statements
Dynamic SQL statements are those statements that require SQL to interpret and execute at the time they are encountered in an HLL program. These statements require greater overhead when they are processed in an HLL program.

Miscellaneous Statements
Miscellaneous statements include all statements that do not fall into the above three categories. As with any language, you will use the various types of SQL statements as you need them. You need to remember that, with a few exceptions, you can use almost any statement at any time. The main exceptions are those statements that are used solely within an HLL program.

SQL/400 Product Features
The SQL/400 product consists of several different features that offer you a variety of methods for entering and executing SQL statements. We cover each of these components in more depth later in this book.

Interactive SQL

Read More

Customer Reviews

Average Review:

Write a Review

and post it to your social network

     

Most Helpful Customer Reviews

See all customer reviews >