mirror of
https://github.com/FirebirdSQL/firebird.git
synced 2025-01-22 14:43:03 +01:00
Little corrections.
This commit is contained in:
parent
0c479c727e
commit
89af0c2a66
@ -1,7 +1,7 @@
|
|||||||
Alias handling and ambiguous field detecting has been improved in FB2.0.
|
Alias handling and ambiguous field detecting has been improved in FB2.0.
|
||||||
|
|
||||||
Changes:
|
Changes:
|
||||||
a) When a alias is present on a table, that alias must be used or no alias at
|
a) When an alias is present on a table, that alias must be used or no alias at
|
||||||
all, the tablename only is not valid anymore.
|
all, the tablename only is not valid anymore.
|
||||||
b) Fields without qualifier can now be used in a higher scope level. Own scope
|
b) Fields without qualifier can now be used in a higher scope level. Own scope
|
||||||
level is checked first and ambiguous field checking is done on scope level.
|
level is checked first and ambiguous field checking is done on scope level.
|
||||||
@ -12,7 +12,7 @@ Author:
|
|||||||
Examples:
|
Examples:
|
||||||
a)
|
a)
|
||||||
1.
|
1.
|
||||||
When a alias is present it must be used or no alias at all must be used.
|
When an alias is present it must be used or no alias at all must be used.
|
||||||
This query was allowed in FB1.5 and earlier versions:
|
This query was allowed in FB1.5 and earlier versions:
|
||||||
|
|
||||||
SELECT
|
SELECT
|
||||||
@ -23,7 +23,7 @@ a)
|
|||||||
but will now correctly report an error that the field
|
but will now correctly report an error that the field
|
||||||
"RDB$RELATIONS.RDB$RELATION_NAME" couldn't be found.
|
"RDB$RELATIONS.RDB$RELATION_NAME" couldn't be found.
|
||||||
|
|
||||||
Use this (preffered):
|
Use this (preferred):
|
||||||
|
|
||||||
SELECT
|
SELECT
|
||||||
R.RDB$RELATION_NAME
|
R.RDB$RELATION_NAME
|
||||||
@ -39,7 +39,7 @@ a)
|
|||||||
|
|
||||||
2.
|
2.
|
||||||
The statement below will now correctly use the FieldID from the subselect
|
The statement below will now correctly use the FieldID from the subselect
|
||||||
and from the updating table.
|
and from the updating table:
|
||||||
|
|
||||||
UPDATE
|
UPDATE
|
||||||
TableA
|
TableA
|
||||||
@ -48,10 +48,10 @@ a)
|
|||||||
|
|
||||||
In firebird it's possible to give an alias by an update statement, but by
|
In firebird it's possible to give an alias by an update statement, but by
|
||||||
many other database vendors this isn't supported. These SQL statements are
|
many other database vendors this isn't supported. These SQL statements are
|
||||||
now better interchangable between other SQL database products.
|
now better interchangeable between other SQL database products.
|
||||||
|
|
||||||
3.
|
3.
|
||||||
This example didn't run correctly in FB1.5 and earlier :
|
This example didn't run correctly in FB1.5 and earlier:
|
||||||
|
|
||||||
SELECT
|
SELECT
|
||||||
RDB$RELATIONS.RDB$RELATION_NAME,
|
RDB$RELATIONS.RDB$RELATION_NAME,
|
||||||
@ -77,7 +77,7 @@ b)
|
|||||||
|
|
||||||
2.
|
2.
|
||||||
Ambiguity checking in sub-selects. The query below did run on FB1.5
|
Ambiguity checking in sub-selects. The query below did run on FB1.5
|
||||||
without reporting an ambiguity, but will report it in FB2.0
|
without reporting an ambiguity, but will report it in FB2.0:
|
||||||
|
|
||||||
SELECT
|
SELECT
|
||||||
(SELECT
|
(SELECT
|
||||||
|
@ -2,31 +2,31 @@ PSQL stack trace
|
|||||||
|
|
||||||
Function:
|
Function:
|
||||||
Send to client within status-vector simple stack trace with names of stored procedures
|
Send to client within status-vector simple stack trace with names of stored procedures
|
||||||
and\or triggers. Status-vector appends with following items :
|
and/or triggers. Status-vector appends with following items :
|
||||||
|
|
||||||
isc_stack_trace, isc_arg_string, <string length>, <string>
|
isc_stack_trace, isc_arg_string, <string length>, <string>
|
||||||
|
|
||||||
isc_stack_trace is a new error code with value of 335544842L
|
isc_stack_trace is a new error code with value of 335544842L
|
||||||
|
|
||||||
Stack trace is represented by one string and consists from the all sp\trigger names
|
Stack trace is represented by one string and consists from all the sp/trigger names
|
||||||
starting from point where exception occured up to most outer caller. Maximum length of
|
starting from point where exception occurred up to most outer caller. Maximum length of
|
||||||
that string is 2048 bytes. If actual trace is longer then it will be truncated to this limit.
|
that string is 2048 bytes. If actual trace is longer then it will be truncated to this limit.
|
||||||
|
|
||||||
Autor:
|
Author:
|
||||||
Vlad Horsun <horsun at kdb.dp.ua>
|
Vlad Horsun <horsun at kdb.dp.ua>
|
||||||
|
|
||||||
Examples:
|
Examples:
|
||||||
|
|
||||||
0. Create metadata :
|
0. Create metadata:
|
||||||
|
|
||||||
CREATE TABLE ERR (ID INT NOT NULL PRIMARY KEY, NAME VARCHAR(16))
|
CREATE TABLE ERR (ID INT NOT NULL PRIMARY KEY, NAME VARCHAR(16));
|
||||||
|
|
||||||
CREATE EXCEPTION EX '!';
|
CREATE EXCEPTION EX '!';
|
||||||
|
|
||||||
CREATE OR ALTER PROCEDURE ERR_1 AS
|
CREATE OR ALTER PROCEDURE ERR_1 AS
|
||||||
BEGIN
|
BEGIN
|
||||||
EXCEPTION EX 'ID = 3';
|
EXCEPTION EX 'ID = 3';
|
||||||
END
|
END;
|
||||||
|
|
||||||
CREATE OR ALTER TRIGGER ERR_BI FOR ERR BEFORE INSERT AS
|
CREATE OR ALTER TRIGGER ERR_BI FOR ERR BEFORE INSERT AS
|
||||||
BEGIN
|
BEGIN
|
||||||
@ -66,7 +66,7 @@ exception 3
|
|||||||
At trigger 'ERR_BI'
|
At trigger 'ERR_BI'
|
||||||
|
|
||||||
|
|
||||||
3. Division by zero occured in trigger:
|
3. Division by zero occurred in trigger:
|
||||||
|
|
||||||
SQL> INSERT INTO ERR VALUES (4, '4');
|
SQL> INSERT INTO ERR VALUES (4, '4');
|
||||||
Statement failed, SQLCODE = -802
|
Statement failed, SQLCODE = -802
|
||||||
|
@ -35,9 +35,9 @@ Notes:
|
|||||||
constants should be added with an alias or the column list should be used.
|
constants should be added with an alias or the column list should be used.
|
||||||
The number of columns in the column list should be the same as the number of
|
The number of columns in the column list should be the same as the number of
|
||||||
columns from the query expression.
|
columns from the query expression.
|
||||||
The optimizer can handle an derived table very efficiently, but if the
|
The optimizer can handle a derived table very efficiently, but if the
|
||||||
derived table contains a sub-select then no join order can be made (if the
|
derived table contains a sub-select then no join order can be made (if the
|
||||||
derived table is included in a inner join).
|
derived table is included in an inner join).
|
||||||
|
|
||||||
|
|
||||||
Example(s):
|
Example(s):
|
||||||
@ -53,7 +53,7 @@ a) Simple derived table:
|
|||||||
RDB$RELATIONS) AS R (RELATION_NAME, RELATION_ID)
|
RDB$RELATIONS) AS R (RELATION_NAME, RELATION_ID)
|
||||||
|
|
||||||
|
|
||||||
b) Aggregate on a derived table which also contains a aggregate
|
b) Aggregate on a derived table which also contains an aggregate
|
||||||
|
|
||||||
SELECT
|
SELECT
|
||||||
DT.FIELDS,
|
DT.FIELDS,
|
||||||
|
Loading…
Reference in New Issue
Block a user