00001 {*********************************************************}
00002 { }
00003 { Zeos Database Objects }
00004 { SQL Statements Analysing classes }
00005 { }
00006 { Originally written by Sergey Seroukhov }
00007 { }
00008 {*********************************************************}
00009
00010 {@********************************************************}
00011 { Copyright (c) 1999-2006 Zeos Development Group }
00012 { }
00013 { License Agreement: }
00014 { }
00015 { This library is distributed in the hope that it will be }
00016 { useful, but WITHOUT ANY WARRANTY; without even the }
00017 { implied warranty of MERCHANTABILITY or FITNESS FOR }
00018 { A PARTICULAR PURPOSE. See the GNU Lesser General }
00019 { Public License for more details. }
00020 { }
00021 { The source code of the ZEOS Libraries and packages are }
00022 { distributed under the Library GNU General Public }
00023 { License (see the file COPYING / COPYING.ZEOS) }
00024 { with the following modification: }
00025 { As a special exception, the copyright holders of this }
00026 { library give you permission to link this library with }
00027 { independent modules to produce an executable, }
00028 { regardless of the license terms of these independent }
00029 { modules, and to copy and distribute the resulting }
00030 { executable under terms of your choice, provided that }
00031 { you also meet, for each linked independent module, }
00032 { the terms and conditions of the license of that module. }
00033 { An independent module is a module which is not derived }
00034 { from or based on this library. If you modify this }
00035 { library, you may extend this exception to your version }
00036 { of the library, but you are not obligated to do so. }
00037 { If you do not wish to do so, delete this exception }
00038 { statement from your version. }
00039 { }
00040 { }
00041 { The project web site is located on: }
00042 { http:
00043 { http:
00044 { svn:
00045 { }
00046 { http:
00047 { http:
00048 { }
00049 { }
00050 { }
00051 { Zeos Development Group. }
00052 {********************************************************@}
00053
00054 unit ZOracleAnalyser;
00055
00056 interface
00057
00058 {$I ZParseSql.inc}
00059
00060 uses Classes, ZGenericSqlAnalyser;
00061
00062 type
00063
00064 {** Implements an Oracle statements analyser. }
00065 TZOracleStatementAnalyser = class (TZGenericStatementAnalyser)
00066 public
00067 constructor Create;
00068 end;
00069
00070 implementation
00071
00072 const
00073 {** The generic constants.}
00074 OracleSectionNames: array[0..13] of string = (
00075 'SELECT', 'UPDATE', 'DELETE', 'INSERT', 'FROM',
00076 'WHERE', 'INTO', 'GROUP*BY', 'HAVING', 'ORDER*BY',
00077 'ORDER*SIBLINGS*BY', 'FOR*UPDATE', 'START*WITH', 'CONNECT*BY'
00078 );
00079 OracleSelectOptions: array[0..2] of string = (
00080 'DISTINCT', 'ALL', 'UNIQUE'
00081 );
00082 OracleFromJoins: array[0..7] of string = (
00083 'NATURAL', 'RIGHT', 'LEFT', 'FULL', 'INNER', 'OUTER', 'JOIN', 'CROSS'
00084 );
00085 OracleFromClauses: array[0..1] of string = (
00086 'ON', 'USING'
00087 );
00088
00089 { TZOracleStatementAnalyser }
00090
00091 {**
00092 Creates the object and assignes the main properties.
00093 }
00094 constructor TZOracleStatementAnalyser.Create;
00095 begin
00096 SectionNames := ArrayToStrings(OracleSectionNames);
00097 SelectOptions := ArrayToStrings(OracleSelectOptions);
00098 FromJoins := ArrayToStrings(OracleFromJoins);
00099 FromClauses := ArrayToStrings(OracleFromClauses);
00100 end;
00101
00102 end.
00103