DDieterich / DTGen

DTGEN Code Generation Tool for Relational Designers (See Wiki Branch)
http://dtgen.org
3 stars 0 forks source link

Deal with (PL/SQL and SQL) (Reserved Words and Keywords) #51

Open GoogleCodeExporter opened 9 years ago

GoogleCodeExporter commented 9 years ago
What will the enhancement do?

  -) Deal with (PL/SQL and SQL) (Reserved Words and Keywords)

How is this currently done or handled?

  Reserved Word and Keyword conflicts must be manually avoided

What version of the product are you using? On what operating system?

  -) Pre-Release 0.11

Please provide any additional information below.

  -) Two possible strategies for dealing with Reserved Words and Keywords
     -) Prohibit the use of Reserved Words and Keywords within DTGEN
     -) Use Double Quotes around Reserved Words and Keywords when they are  used as identifiers and/or types.

Original issue reported on code.google.com by Duane.Di...@gmail.com on 7 Aug 2012 at 12:40

GoogleCodeExporter commented 9 years ago
Possible identifiers that could cause Reserved Word and/or Keyword conflict:
domains.abbr, domains.name, tables.abbr, tables.name, tab_cols.name, 
programs.name, exceptions.name

PL/SQL Reserved Words:
You cannot use reserved words as ordinary user-defined identifiers.
ALL, ALTER, AND, ANY, AS, ASC, AT, BEGIN, BETWEEN, BY, CASE, CHECK, CLUSTERS, 
CLUSTER, COLAUTH, COLUMNS, COMPRESS, CONNECT, CRASH, CREATE, CURSOR, DECLARE, 
DEFAULT, DESC, DISTINCT, DROP, ELSE, END, EXCEPTION, EXCLUSIVE, FETCH, FOR, 
FROM, FUNCTION, GOTO, GRANT, GROUP, HAVING, IDENTIFIED, IF, IN, INDEX, INDEXES, 
INSERT, INTERSECT, INTO, IS, LIKE, LOCK, MINUS, MODE, NOCOMPRESS, NOT, NOWAIT, 
NULL, OF, ON, OPTION, OR, ORDER, OVERLAPS, PROCEDURE, PUBLIC, RESOURCE, REVOKE, 
SELECT, SHARE, SIZE, SQL, START, SUBTYPE, TABAUTH, TABLE, THEN, TO, TYPE, 
UNION, UNIQUE, UPDATE, VALUES, VIEW, VIEWS, WHEN, WHERE, WITH

PL/SQL Keywords:
You can use keywords as ordinary user-defined identifiers
A, ADD, AGENT, AGGREGATE, ARRAY, ATTRIBUTE, AUTHID, AVG, BFILE_BASE, BINARY, 
BLOB_BASE, BLOCK, BODY, BOTH, BOUND, BULK, BYTE, C, CALL, CALLING, CASCADE, 
CHAR, CHAR_BASE, CHARACTER, CHARSET, CHARSETFORM, CHARSETID, CLOB_BASE, CLOSE, 
COLLECT, COMMENT, COMMIT, COMMITTED, COMPILED, CONSTANT, CONSTRUCTOR, CONTEXT, 
CONTINUE, CONVERT, COUNT, CURRENT, CUSTOMDATUM, DANGLING, DATA, DATE, 
DATE_BASE, DAY, DEFINE, DELETE, DETERMINISTIC, DOUBLE, DURATION, ELEMENT, 
ELSIF, EMPTY, ESCAPE, EXCEPT, EXCEPTIONS, EXECUTE, EXISTS, EXIT, EXTERNAL, 
FINAL, FIXED, FLOAT, FORALL, FORCE, GENERAL, HASH, HEAP, HIDDEN, HOUR, 
IMMEDIATE, INCLUDING, INDICATOR, INDICES, INFINITE, INSTANTIABLE, INT, 
INTERFACE, INTERVAL, INVALIDATE, ISOLATION, JAVA, LANGUAGE, LARGE, LEADING, 
LENGTH, LEVEL, LIBRARY, LIKE2, LIKE4, LIKEC, LIMIT, LIMITED, LOCAL, LONG, LOOP, 
MAP, MAX, MAXLEN, MEMBER, MERGE, MIN, MINUTE, MOD, MODIFY, MONTH, MULTISET, 
NAME, NAN, NATIONAL, NATIVE, NCHAR, NEW, NOCOPY, NUMBER_BASE, OBJECT, OCICOLL, 
OCIDATE, OCIDATETIME, OCIDURATION, OCIINTERVAL, OCILOBLOCATOR, OCINUMBER, 
OCIRAW, OCIREF, OCIREFCURSOR, OCIROWID, OCISTRING, OCITYPE, OLD, ONLY, OPAQUE, 
OPEN, OPERATOR, ORACLE, ORADATA, ORGANIZATION, ORLANY, ORLVARY, OTHERS, OUT, 
OVERRIDING, PACKAGE, PARALLEL_ENABLE, PARAMETER, PARAMETERS, PARENT, PARTITION, 
PASCAL, PIPE, PIPELINED, PRAGMA, PRECISION, PRIOR, PRIVATE, RAISE, RANGE, RAW, 
READ, RECORD, REF, REFERENCE, RELIES_ON, REM, REMAINDER, RENAME, RESULT, 
RESULT_CACHE, RETURN, RETURNING, REVERSE, ROLLBACK, ROW, SAMPLE, SAVE, 
SAVEPOINT, SB1, SB2, SB4, SECOND, SEGMENT, SELF, SEPARATE, SEQUENCE, 
SERIALIZABLE, SET, SHORT, SIZE_T, SOME, SPARSE, SQLCODE, SQLDATA, SQLNAME, 
SQLSTATE, STANDARD, STATIC, STDDEV, STORED, STRING, STRUCT, STYLE, SUBMULTISET, 
SUBPARTITION, SUBSTITUTABLE, SUM, SYNONYM, TDO, THE, TIME, TIMESTAMP, 
TIMEZONE_ABBR, TIMEZONE_HOUR, TIMEZONE_MINUTE, TIMEZONE_REGION, TRAILING, 
TRANSACTION, TRANSACTIONAL, TRUSTED, UB1, UB2, UB4, UNDER, UNSIGNED, UNTRUSTED, 
USE, USING, VALIST, VALUE, VARIABLE, VARIANCE, VARRAY, VARYING, VOID, WHILE, 
WORK, WRAPPED, WRITE, YEAR, ZONE

PL/SQL Predefined Identifiers:
Predefined identifiers are declared in the predefined package STANDARD. An 
example of a predefined identifier is the exception INVALID_NUMBER.
For a list of predefined identifiers, use this query:
SELECT TYPE_NAME FROM ALL_TYPES WHERE PREDEFINED='YES';

SQL Reserved Words and Keywords:
V$RESERVED_WORDS displays a list of all SQL keywords. To determine whether a 
particular keyword is reserved in any way, check the RESERVED, RES_TYPE, 
RES_ATTR, and RES_SEMI columns.
Column  Datatype    Description
KEYWORD VARCHAR2(30)    Name of the keyword
LENGTH  NUMBER  Length of the keyword
RESERVED    VARCHAR2(1) Indicates whether the keyword cannot be used as an 
identifier (Y) or whether the keyword is not reserved (N)
RES_TYPE    VARCHAR2(1) Indicates whether the keyword cannot be used as a type 
name (Y) or whether the keyword is not reserved (N)
RES_ATTR    VARCHAR2(1) Indicates whether the keyword cannot be used as an 
attribute name (Y) or whether the keyword is not reserved (N)
RES_SEMI    VARCHAR2(1) Indicates whether the keyword is not allowed as an 
identifier in certain situations, such as in DML (Y) or whether the keyword is 
not reserved (N)
DUPLICATE   VARCHAR2(1) Indicates whether the keyword is a duplicate of another 
keyword (Y) or whether the keyword is not a duplicate (N)

Original comment by Duane.Di...@gmail.com on 7 Aug 2012 at 12:46