Programmer's Guide to the Pro*Ada Precompiler Go to Product Documentation Library
Library
Go to books for this product
Product
Go to Contents for this book
Contents
Go to Index
Index



Go to previous file in sequence Go to next file in sequence

Syntactic Checking


By checking the syntax of embedded SQL statements and PL/SQL blocks, the Pro*Ada Precompiler helps you quickly find and fix coding mistakes. This appendix shows you how to use the SQLCHECK option to control the type and extent of checking. The discussion includes the following topics:


Rules of Syntax

Rules of syntax specify how language elements are sequenced to form valid statements. Thus, syntactic checking verifies that keywords, object names, operators, delimiters, and so on are placed correctly in your SQL statement. For example, the following embedded SQL statements contain syntax errors:

EXEC SQL DELETE FROM EMP WHER DEPTNO = 20; 
    -- misspelled keyword, WHERE 
EXEC SQL INSERT INTO EMP COMM, SAL VALUES (NULL, 1500); 
    -- missing parentheses around column names, COMM and SAL 

The rules of SQL syntax are defined in the Oracle7 Server SQL Language Reference Manual.


Controlling the Type and Extent of Checking

You control the type and extent of checking by specifying the SQLCHECK option on the command line. With SQLCHECK, the type of checking can be syntactic or none. The extent of checking can include the following:

However, SQLCHECK cannot check dynamic SQL statements because they are not fully defined until run time.

You can specify the following values for SQLCHECK: SYNTAX or NONE. The default value is SYNTAX. The use of SQLCHECK does not affect the normal syntax checking done on data control, cursor control, and dynamic SQL statements.


Specifying SQLCHECK=SYNTAX

When you specify SQLCHECK=SYNTAX, the precompiler checks the syntax of

No semantic check is done, and the following restrictions apply:

When checking data manipulation statements, the precompiler uses Oracle Version 6 syntax and semantic rules. These rules are upwardly compatible with those of Version 5, so specify SQLCHECK=SYNTAX when migrating your precompiled programs.


Specifying SQLCHECK=NONE

When you specify SQLCHECK=NONE (the default), a minimal syntactic check is done and the following restrictions apply:

Specify SQLCHECK=NONE only if




Go to previous file in sequence Go to next file in sequence
Prev Next
Oracle
Copyright © 1996 Oracle Corporation.
All Rights Reserved.
Go to Product Documentation Library
Library
Go to books for this product
Product
Go to Contents for this book
Contents
Go to Index
Index