Subject | Type of context variables changed in FB2.1.2? |
---|---|
Author | ainpoissee |
Post date | 2009-07-08T12:59:46Z |
Hi,
I just ran into a problem with CURRENT_USER variable - following trigger worked OK with 2.1.0 but raises exception with 2.1.2:
CREATE OR ALTER TRIGGER CheckUser ACTIVE ON CONNECT POSITION 32767 AS
DECLARE ID DOM_WEAK_FK = NULL;
BEGIN
SELECT UID FROM TAB_Users WHERE(UPPER(UserName) = CURRENT_USER) INTO :ID;
IF(ID IS NOT NULL)THEN UPDATE TAB_Users SET IsActive = 'T' WHERE(UID = :ID);
ELSE EXCEPTION EXP_UM 'No such user: '|| CURRENT_USER;
END;
Using Trim with CURRENT_USER (ie in the first select's where using Trim(CURRENT_USER)) fixes it. So it looks like the type of the CURRENT_USER variable has changed since FB2.1.0? Or is it a bug and should be reported?
TIA
ain
I just ran into a problem with CURRENT_USER variable - following trigger worked OK with 2.1.0 but raises exception with 2.1.2:
CREATE OR ALTER TRIGGER CheckUser ACTIVE ON CONNECT POSITION 32767 AS
DECLARE ID DOM_WEAK_FK = NULL;
BEGIN
SELECT UID FROM TAB_Users WHERE(UPPER(UserName) = CURRENT_USER) INTO :ID;
IF(ID IS NOT NULL)THEN UPDATE TAB_Users SET IsActive = 'T' WHERE(UID = :ID);
ELSE EXCEPTION EXP_UM 'No such user: '|| CURRENT_USER;
END;
Using Trim with CURRENT_USER (ie in the first select's where using Trim(CURRENT_USER)) fixes it. So it looks like the type of the CURRENT_USER variable has changed since FB2.1.0? Or is it a bug and should be reported?
TIA
ain