DB2 - Problembeschreibung
Problem IC64012 | Status: Geschlossen |
SQLCODE -1224 FROM TRIGGER OR IF STATEMENT UNDER CERTAIN CONDITIONS | |
Produkt: | |
DB2 FOR LUW / DB2FORLUW / 970 - DB2 | |
Problembeschreibung: | |
SQL1224N may result when the condition in a trigger WHEN clause or an IF statement references both: 1. an SQL scalar or row function 2. a subquery Example: CREATE TABLE PARTITION ( ID INT NOT NULL, STATUS SMALLINT NOT NULL, LOAD_ID INT NOT NULL ) CREATE TABLE DOMAIN ( PROPERTY VARCHAR ( 32 ) NOT NULL, NAME VARCHAR ( 32 ) NOT NULL, CODE SMALLINT NOT NULL ) CREATE FUNCTION GET_PROPERTY(p VARCHAR(32), s VARCHAR(32)) RETURNS INT READS SQL DATA DETERMINISTIC RETURN SELECT domain.code FROM domain WHERE domain.property = p AND domain.name = s CREATE FUNCTION GET_STATUS(s VARCHAR(32)) RETURNS INT READS SQL DATA DETERMINISTIC RETURN GET_PROPERTY('STATUS', s) CREATE TRIGGER RECORD_HISTORY AFTER UPDATE OF STATUS ON PARTITION REFERENCING NEW AS N FOR EACH ROW MODE DB2SQL WHEN (((N.status = get_status('STORED'))) AND ((SELECT COUNT(*) FROM partition)=0) ) BEGIN END update partition set status = get_status('STORED') where id = 562126 DB21034E The command was processed as an SQL statement because it was not a valid Command Line Processor command. During SQL processing it returned: SQL1224N The database manager is not able to accept new requests, has terminated all requests in progress, or has terminated your particular request due to an error or a force interrupt. SQLSTATE=55032 | |
Problem-Zusammenfassung: | |
**************************************************************** * USERS AFFECTED: * * All * **************************************************************** * PROBLEM DESCRIPTION: * * SQL1224N may result when the condition in a trigger WHEN * * clause * * or an IF statement references both: * * 1. an SQL scalar or row function * * 2. a subquery * * * * Example: * * CREATE TABLE PARTITION ( ID INT NOT NULL, STATUS SMALLINT * * NOT * * NULL, LOAD_ID INT NOT NULL ) * * * * CREATE TABLE DOMAIN ( PROPERTY VARCHAR ( 32 ) NOT NULL, NAME * * * * VARCHAR ( 32 ) NOT NULL, CODE SMALLINT NOT NULL ) * * * * * * CREATE FUNCTION GET_PROPERTY(p VARCHAR(32), s VARCHAR(32)) * * * * RETURNS INT * * READS SQL DATA * * DETERMINISTIC * * RETURN SELECT domain.code FROM domain WHERE domain.property * * = p * * AND domain.name = s * * * * * * CREATE FUNCTION GET_STATUS(s VARCHAR(32)) * * RETURNS INT * * READS SQL DATA * * DETERMINISTIC * * RETURN GET_PROPERTY('STATUS', s) * * * * CREATE TRIGGER RECORD_HISTORY * * AFTER UPDATE OF STATUS ON PARTITION * * REFERENCING NEW AS N * * FOR EACH ROW MODE DB2SQL * * WHEN (((N.status = get_status('STORED'))) AND ((SELECT * * COUNT(*) * * FROM partition)=0) ) * * BEGIN * * END * * * * update partition set status = get_status('STORED') where id * * = * * 562126 * * DB21034E The command was processed as an SQL statement * * because * * it was not a * * valid Command Line Processor command. During SQL processing * * it * * returned: * * SQL1224N The database manager is not able to accept new * * * * requests, has * * terminated all requests in progress, or has terminated your * * * * particular request * * due to an error or a force interrupt. SQLSTATE=55032 * **************************************************************** * RECOMMENDATION: * * Upgrade to DB2 Version 9.7 Fix Pack 1 or later. * **************************************************************** | |
Local-Fix: | |
Do not specify both an SQL function and a subquery in the condition in the trigger WHEN clause or the IF statement. | |
verfügbare FixPacks: | |
DB2 Version 9.7 Fix Pack 1 for Linux, UNIX, and Windows | |
Lösung | |
The problem has been fixed in DB2 Version 9.7 Fix Pack 1 | |
Workaround | |
keiner bekannt / siehe Local-Fix | |
Weitere Daten | |
Datum - Problem gemeldet : Datum - Problem geschlossen : Datum - der letzten Änderung: | 22.10.2009 16.02.2010 16.02.2010 |
Problem behoben ab folgender Versionen (IBM BugInfos) | |
9.7.FP1 | |
Problem behoben lt. FixList in der Version | |
9.7.0.1 |