db2 V8的有关SQL limits
The following tables describe certain SQL
limits. Adhering to the most restrictive case can help the programmer
design application programs that are easily portable.
Table 7. Identifier Length Limits
Description
Limit in Bytes
Longest authorization
name (can only be single-byte characters)
30
Longest
constraint name
18
Longest correlation name
128
Longest condition name
64
Longest
cursor name
18
Longest unqualified column name (nickname)
128
Longest data source index name
128
Longest
data source name
128
Longest data source table name (remote-table-name
)
128
Longest
external program name
8
Longest host identifiera
255
Longest identifier of a data source user (remote-authorization-name
)
30
Longest label name
64
Longest method name
18
Longest parameter nameb
128
Longest
password to access a data source
32
Longest savepoint name
128
Longest schema namec
30
Longest server
(database alias) name
8
Longest SQL variable name
64
Longest
statement name
18
Longest transform. group name
18
Longest unqualified column name
30
Longest
unqualified package name
8
Longest unqualified user-defined type,
user-defined function, user-defined method, buffer pool, table space,
database partition group, trigger, index, or index specification name
18
Longest unqualified table name, view name, stored procedure
name, sequence name, nickname, or alias
128
Longest
wrapper name
128
Notes:
a
Individual
host language compilers may have a more restrictive limit on variable
names.
b
Parameter names in an SQL procedure are
limited to 64 bytes.
c
The schema name for a
user-defined type is limited to 8 bytes.
Table 8. Numeric Limits
Description
Limit
Smallest INTEGER value
-2 147 483 648
Largest INTEGER value
+2 147 483 647
Smallest BIGINT value
-9 223 372 036 854 775 808
Largest BIGINT value
+9 223 372 036 85
相关文档:
昨天我的SQL(Microsoft SQL Server 2005 )登录不上去了,原来是出现了几个小问题,现在记录一下我的解决这几个情况的办法。(解决方法有很多种,这些只是我的解决方法,仅供参考)
查找问题的过程:(注:用windows账号还是可以登录的)
第一步:启动所有与SQL有关的服务,问题依旧;
第二步:查看windows防火墙,被默 ......
On BULK COLLECT
By Steven Feuerstein Oracle ACE
Best practices for knowing your LIMIT and kicking %NOTFOUND
I have started using BULK COLLECT whenever I need to fetch large volumes of data. This has caused me some trouble with my DBA, however. He is complaining that although my programs mig ......
DECLARE @temp TABLE(
id INT,
[name] VARCHAR(50),
class VARCHAR(50)
)
INSERT INTO @temp
SELECT 1,'a','A'
UNION ALL SELECT 2,'b','C'
UNION ALL SELECT 3,'c','B'
UNION ALL SELECT 4,'d','C'
UNION ALL SELECT 5,'e','B'
UNION ALL SELECT 6,'f','A'
SELECT * from @temp AS _temp WHERE [name] IN
(
......
1.多where,少having
where用来过滤行,having用来过滤组
2.多union all,少union
union删除了重复的行,因此花费了一些时间
3.多Exists,少in
Exists只检查存在性,性能比in强很多,有些朋友不会用Exists,就举个例子
例,想要得到有电话号码的人的基本信息,table2有冗余信息
select * from table1;--(id,n ......