New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Execute statement 'select ....' into new.... [CORE1444] #1862
Comments
Commented by: Sean Leyne (seanleyne) You are missing the ":" in front of the new.c1 and new.c2 references. Try: execute statement sql |
Commented by: @asfernandes Variables in INTO doesn't need the colon anymore, and the colon is currently not a valid syntax with NEW or OLD. The problem exists, but it's already fixed in HEAD. I'm not sure if the colon should or should not be allowed with NEW and OLD. |
Commented by: kotrc (pkotrc) Colon should not by used with NEW and OLD. What is it "Fixed in HEAD" ? |
Modified by: @AlexPeshkoffassignee: Alexander Peshkov [ alexpeshkoff ] |
Commented by: @AlexPeshkoff Reason of a bug was removed by Adriano when adding INTL support to EXECUTE STATEMENT. Since given versions works fine. |
Modified by: @AlexPeshkoffstatus: Open [ 1 ] => Resolved [ 5 ] resolution: Fixed [ 1 ] Fix Version: 2.0.3 [ 10200 ] Fix Version: 2.1 Beta 2 [ 10190 ] |
Commented by: @pcisar Verified, test added. |
Modified by: @pcisarstatus: Resolved [ 5 ] => Closed [ 6 ] |
Modified by: @pcisarWorkflow: jira [ 12990 ] => Firebird [ 14622 ] |
Modified by: @pavel-zotovQA Status: No test |
Modified by: @pavel-zotovQA Status: No test => Done successfully |
Submitted by: kotrc (pkotrc)
Is related to QA172
/*
Problem with
in before insert,update triggers.
When new.c1,... has null value before execution,
so execute ... do not fill new.c1,... with value
from select.
Server WI-V2.0.1.12855 Firebird 2.0
System Windows2000 5.00.2195 Service Pack 4
AMD Athalon(TM)
Server WI-V1.5.4.4910 Firebird 1.5
System Windows2000 5.00.2195 Service Pack 4
AMD Athalon(TM)XP 1800+
*/
CREATE EXCEPTION DEXC '???';
CREATE TABLE TEST
(
C1 char(31),
C2 char(31)
);
commit;
SET TERM ^ ;
CREATE TRIGGER TEST_BI FOR TEST
ACTIVE BEFORE INSERT POSITION 20
AS
declare variable sql varchar(30000);
declare variable wrk_c1 char(31);
declare variable wrk_c2 char(31);
BEGIN
/* when new.c1,new.... isn't NULL -> execute statement work ok.
when new.c1,new.c2, is null -> execute statement has some problem */
sql=' select first 1 RDB$CHARACTER_SET_NAME,RDB$DEFAULT_COLLATE_NAME
from RDB$CHARACTER_SETS
where RDB$CHARACTER_SET_NAME is not null';
execute statement sql
into new.c1,new.c2;
select first 1 RDB$CHARACTER_SET_NAME,RDB$DEFAULT_COLLATE_NAME
from RDB$CHARACTER_SETS
where RDB$CHARACTER_SET_NAME is not null
into :wrk_c1,:wrk_c2;
if (wrk_c1 is not null and
new.c1 is null) then
exception dexc 'Is it a bug ? I think yes, it is.';
END
^
set term ; ^
commit;
/* Bug */
insert into test(C1,C2) values (NULL,NULL);
/* OK */
insert into test(C1,C2) values ('A','A');
commit;
The text was updated successfully, but these errors were encountered: