asfernandes 7ca129fd6e Fixed doc. mismatch reported by Paul Vinkenoog 15 лет назад
..
README.PSQL_stack_trace.txt 89af0c2a66 Little corrections. 21 лет назад
README.aggregate_tracking 70ac4f226c Please give some comments 22 лет назад
README.builtin_functions.txt 37d3a5825d CORE-3102 (minor documentation mistake) 15 лет назад
README.case 56892f3fb0 update readme's with method used for determing result data type 21 лет назад
README.coalesce 56892f3fb0 update readme's with method used for determing result data type 21 лет назад
README.common_table_expressions 12e4a9ef8a Changes suggested by Philippe Makowski - avoid non-asci symbols 17 лет назад
README.context_variables 099f99cde2 Fixed docs. 18 лет назад
README.context_variables2 773cd71543 Document the new context variable - thanks to Maicon Ferraça 19 лет назад
README.current_time d094341e79 Typo. 20 лет назад
README.cursors 735f10b5a1 More docs. 21 лет назад
README.data_type_results_of_aggregations.txt 7fd8985732 Corrections. 19 лет назад
README.data_types 37278240a9 no message 22 лет назад
README.db_triggers.txt 1c4d0a2629 Misc. 18 лет назад
README.ddl.txt 24d11d0b36 Document the blob filter restriction in FB2. 20 лет назад
README.default_parameters c0e9a56fc8 1. Added new EXECUTE BLOCK statement 22 лет назад
README.derived_tables.txt 56892f3fb0 update readme's with method used for determing result data type 21 лет назад
README.distinct a77d9e3a79 More docs. 21 лет назад
README.domains_psql.txt d455c9f170 Misc. 19 лет назад
README.exception_handling 099f99cde2 Fixed docs. 18 лет назад
README.execute_block c0e9a56fc8 1. Added new EXECUTE BLOCK statement 22 лет назад
README.execute_statement b43ad7ae16 Misc, adding example. 19 лет назад
README.explicit_locks 4234b34098 Fix typo 22 лет назад
README.expression_indices 12e4a9ef8a Changes suggested by Philippe Makowski - avoid non-asci symbols 17 лет назад
README.global_temporary_tables 12e4a9ef8a Changes suggested by Philippe Makowski - avoid non-asci symbols 17 лет назад
README.iif dc04b6d07c More docs. 21 лет назад
README.isc_info_xxx 240f5d25e7 Correct documentation for isc_info_creation_date 20 лет назад
README.joins.txt fd33f237d2 Doc. for new join types 19 лет назад
README.keywords 0994323b77 Corrections for the v2.1 docs. 17 лет назад
README.leave_labels d44367f80b Added some docs. 21 лет назад
README.length 59213efe7e Merge INTL branch into HEAD 20 лет назад
README.list 620d0550d0 Updated LIST documentation - thanks to Maycon Ferraça 19 лет назад
README.merge.txt 09ccfb5c6a Documentation for MERGE 19 лет назад
README.null_value fe5aa5e822 Placeholders for further docs. 21 лет назад
README.nullif 56892f3fb0 update readme's with method used for determing result data type 21 лет назад
README.order_by_expressions_nulls 1c5c4e0feb Corrections for v2.0 and above. 18 лет назад
README.plan 607816519d Minor fixes. 21 лет назад
README.returning b06deea4c6 CORE-1226: Allow RETURNING in INSERT...SELECT, UPDATE and DELETE 19 лет назад
README.rows f472ed3086 More docs. 21 лет назад
README.savepoints 9f6ac0a96f Added docs for savepoints 22 лет назад
README.select_expressions 43e6fc05c8 Corrections, thanks to Claudio. 20 лет назад
README.sequence_generators 607816519d Minor fixes. 21 лет назад
README.set_transaction.txt 322d28a1c7 Add documentation for the extra options exposed through the DSQL's SET TRANSACTION command. This functionality exists already using TPB's. 20 лет назад
README.trim 59213efe7e Merge INTL branch into HEAD 20 лет назад
README.universal_triggers 4ec2700475 Fixed typos. 20 лет назад
README.update_or_insert 7ca129fd6e Fixed doc. mismatch reported by Paul Vinkenoog 15 лет назад
README.view_updates fe5aa5e822 Placeholders for further docs. 21 лет назад

README.PSQL_stack_trace.txt

PSQL stack trace

Function:
Send to client within status-vector simple stack trace with names of stored procedures
and/or triggers. Status-vector appends with following items :

isc_stack_trace, isc_arg_string, ,

isc_stack_trace is a new error code with value of 335544842L

Stack trace is represented by one string and consists from all the sp/trigger names
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.

Author:
Vlad Horsun

Examples:

0. Create metadata:

CREATE TABLE ERR (ID INT NOT NULL PRIMARY KEY, NAME VARCHAR(16));

CREATE EXCEPTION EX '!';

CREATE OR ALTER PROCEDURE ERR_1 AS
BEGIN
EXCEPTION EX 'ID = 3';
END;

CREATE OR ALTER TRIGGER ERR_BI FOR ERR BEFORE INSERT AS
BEGIN
IF (NEW.ID = 2)
THEN EXCEPTION EX 'ID = 2';

IF (NEW.ID = 3)
THEN EXECUTE PROCEDURE ERR_1;

IF (NEW.ID = 4)
THEN NEW.ID = 1 / 0;
END;

CREATE OR ALTER PROCEDURE ERR_2 AS
BEGIN
INSERT INTO ERR VALUES (3, '333');
END;



1. User exception from trigger:

SQL> INSERT INTO ERR VALUES (2, '2');
Statement failed, SQLCODE = -836
exception 3
-ID = 2
-At trigger 'ERR_BI'


2. User exception from procedure called by trigger:

SQL> INSERT INTO ERR VALUES (3, '3');
Statement failed, SQLCODE = -836
exception 3
-ID = 3
-At procedure 'ERR_1'
At trigger 'ERR_BI'


3. Division by zero occurred in trigger:

SQL> INSERT INTO ERR VALUES (4, '4');
Statement failed, SQLCODE = -802
arithmetic exception, numeric overflow, or string truncation
-At trigger 'ERR_BI'


4. User exception from procedure:

SQL> EXECUTE PROCEDURE ERR_1;
Statement failed, SQLCODE = -836
exception 3
-ID = 3
-At procedure 'ERR_1'


5. User exception from procedure with more deep call stack:

SQL> EXECUTE PROCEDURE ERR_2;
Statement failed, SQLCODE = -836
exception 3
-ID = 3
-At procedure 'ERR_1'
At trigger 'ERR_BI'
At procedure 'ERR_2'