第八章 其他参考资料(一)

2022-06-14  本文已影响0人  Cache技术分享

第八章 其他参考资料(一)

默认用户名和密码(SQL)

IRIS® 数据平台提供了用于登录数据库和开始使用的默认用户名和密码。默认用户名为“_SYSTEM”(大写),密码为“sys”。

SQLCODE错误代码(SQL)

执行大多数 SQL操作都会发出SQLCODE值。发出的SQLCODE值为0100和负整数值。

字段约束(SQL)

字段约束指定管理字段允许的数据值的规则。一个字段可能有以下约束:

数据值必须适合该字段的数据类型。空字符串不是数值字段的可接受值。

保留字(SQL)

SQL保留字列表。

%AFTERHAVING | %ALLINDEX | %ALPHAUP | %ALTER | %BEGTRANS | 
%CHECKPRIV | %CLASSNAME | %CLASSPARAMETER | %DBUGFULL | %DELDATA | 
%DESCRIPTION | %EXACT | %EXTERNAL | %FILE | %FIRSTTABLE | %FLATTEN | 
%FOREACH | %FULL | %ID | %IDADDED | %IGNOREINDEX | %IGNOREINDICES | 
%INLIST | %INORDER | %INTERNAL | %INTEXT | %INTRANS | %INTRANSACTION | 
%KEY | %MATCHES | %MCODE | %MERGE | %MINUS | %MVR | %NOCHECK | 
%NODELDATA | %NOFLATTEN | %NOFPLAN | %NOINDEX | %NOLOCK | 
%NOMERGE | %NOPARALLEL | %NOREDUCE | %NORUNTIME | %NOSVSO | %NOTOPOPT | 
%NOTRIGGER | %NOUNIONOROPT | %NUMROWS | %ODBCIN | %ODBCOUT | 
%PARALLEL | %PLUS | %PROFILE | %PROFILE_ALL | %PUBLICROWID | %ROUTINE | 
%ROWCOUNT | %RUNTIMEIN | %RUNTIMEOUT | %STARTSWITH | 
%STARTTABLE | %SQLSTRING | %SQLUPPER | %STRING | %TABLENAME | 
%TRUNCATE | %UPPER | %VALUE | %VID
ABSOLUTE | ADD | ALL | ALLOCATE | ALTER | AND | ANY | ARE | AS | 
ASC | ASSERTION | AT | AUTHORIZATION | AVG | BEGIN | BETWEEN | 
BIT | BIT_LENGTH | BOTH | BY | CASCADE | CASE | CAST |
CHAR | CHARACTER | CHARACTER_LENGTH | CHAR_LENGTH | 
CHECK | CLOSE | COALESCE | COLLATE | COMMIT | CONNECT | 
CONNECTION | CONSTRAINT | CONSTRAINTS | CONTINUE | CONVERT | 
CORRESPONDING | COUNT | CREATE | CROSS | CURRENT | 
CURRENT_DATE | CURRENT_TIME | CURRENT_TIMESTAMP | 
CURRENT_USER | CURSOR | DATE | DEALLOCATE | DEC | DECIMAL | 
DECLARE | DEFAULT | DEFERRABLE | DEFERRED | DELETE | DESC | 
DESCRIBE | DESCRIPTOR | DIAGNOSTICS | DISCONNECT | DISTINCT | 
DOMAIN | DOUBLE | DROP | ELSE | END | ENDEXEC | ESCAPE | EXCEPT | 
EXCEPTION | EXEC | EXECUTE | EXISTS | EXTERNAL | EXTRACT | 
FALSE | FETCH | FIRST | FLOAT | FOR | FOREIGN | FOUND | FROM | FULL | 
GET | GLOBAL | GO | GOTO | GRANT | GROUP | HAVING | HOUR | 
IDENTITY | IMMEDIATE | IN | INDICATOR | INITIALLY | 
INNER | INPUT | INSENSITIVE | INSERT | INT | INTEGER | INTERSECT | 
INTERVAL | INTO | IS | ISOLATION | JOIN | LANGUAGE | LAST | 
LEADING | LEFT | LEVEL | LIKE | LOCAL | LOWER | MATCH | MAX | MIN | 
MINUTE | MODULE | NAMES | NATIONAL | NATURAL | NCHAR | 
NEXT | NO | NOT | NULL | NULLIF | NUMERIC | OCTET_LENGTH | OF | ON | 
ONLY | OPEN | OPTION | OR | OUTER | OUTPUT | OVERLAPS | 
PAD | PARTIAL | PREPARE | PRESERVE | PRIMARY | PRIOR | PRIVILEGES | 
PROCEDURE | PUBLIC | READ | REAL | REFERENCES | RELATIVE | 
RESTRICT | REVOKE | RIGHT | ROLE | ROLLBACK | ROWS | 
SCHEMA | SCROLL | SECOND | SECTION | SELECT | SESSION_USER | 
SET | SHARD | SMALLINT | SOME | SPACE | SQLERROR | SQLSTATE | 
STATISTICS | SUBSTRING | SUM | SYSDATE | SYSTEM_USER | TABLE | 
TEMPORARY | THEN | TIME | TIMEZONE_HOUR | TIMEZONE_MINUTE | 
TO | TOP | TRAILING | TRANSACTION | TRIM | TRUE | UNION | UNIQUE | 
UPDATE | UPPER | USER | USING | VALUES | VARCHAR | VARYING | WHEN | 
WHENEVER | WHERE | WITH | WORK | WRITE 

描述

在SQL中,某些字是保留的。不能将SQL保留字用作SQL标识符(如表、列、AS别名或其他实体的名称),除非:

该列表仅包含在此意义上保留的那些单词;它不包含所有SQL关键字。上面列出的几个单词以"%"字符开头,表示它们是 SQL专有扩展关键字。通常,不建议使用以"%"开头的单词作为表名和列名等标识符,因为将来可能会添加新的 SQL扩展关键字。

可以通过调用IsReserve vedWord()方法来检查某个字是否为SQL保留字,如下例所示。将保留字指定为引号字符串;保留字不区分大小写。$SYSTEM.SQL.IsReserve vedWord()返回布尔值。

/// d ##class(PHA.TEST.SQLFunction).ReservedWord()
ClassMethod ReservedWord()
{
    w !,"Reserved?: ",$SYSTEM.SQL.IsReservedWord("VARCHAR")
    w !,"Reserved?: ",$SYSTEM.SQL.IsReservedWord("varchar")
    w !,"Reserved?: ",$SYSTEM.SQL.IsReservedWord("VarChar")
    w !,"Reserved?: ",$SYSTEM.SQL.IsReservedWord("FRED")
}
DHC-APP> d ##class(PHA.TEST.SQLFunction).ReservedWord()
 
Reserved?: 1
Reserved?: 1
Reserved?: 1
Reserved?: 0

此方法也可以作为存储过程从ODBC或JDBC调用:%SYSTEM.SQL_IsReservedWord("nnnn")

上一篇下一篇

猜你喜欢

热点阅读