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
stored procedure do not work correctly BUG??? [CORE2911] #3295
Comments
Commented by: fulvio (fulvio) this is the image of results |
Modified by: fulvio (fulvio)Attachment: result.jpg [ 11591 ] |
Commented by: @asfernandes The behavior of using the same variable as both input and output in the same command is undefined AFAIK. |
Commented by: @dyemanov Correct, it's dictated by the FB internals and thus can be considered "as designed". However, AFAIU it doesn't comply with the SQL specification. So I'm not sure what is better: close this ticket as "won't fix" or just downgrade its priority and keep it open until it's fixed some day. |
Commented by: @hvlad This is how it works from the day one. PS EMS, IBE, etc "debuggers" is just emulators, they can't work exactly same way as Firebird |
Modified by: @pcisarstatus: Resolved [ 5 ] => Closed [ 6 ] |
Commented by: fulvio (fulvio) and now, how to resolve this problem? |
Commented by: @hvlad Don't use the same variable as both input and output in the same command |
Commented by: @dyemanov temp_idarticolo = out_idarticolo; for select |
Commented by: fulvio (fulvio) hi, I've insert a tmp variable the result is always the same.... can you tell me whot is wrong? thanks CREATE PROCEDURE ARTICOLIFIGLI (
end |
Commented by: @asfernandes You used same variable in different nesting commands. When evaluating the outer ones, the variable will have changed and will be compared with something you assigned in the inner loops. Please move this to support list, as the tracker is not for this. |
Submitted by: fulvio (fulvio)
Attachments:
result.jpg
Hi to all,
running my stored procedure with two parameters: idpadrein = null, idarticoloin=1
the result should be 9 rows!
the wrong result is 7 rows!
with EMS debugger the result is 9 rows, but running the stored procedure with EMS (no debugger) the result is 7 rows!
please tell me what is wrong.
thanks
this is my table
CREATE TABLE DISTINTABASE (
ID INTEGER NOT NULL,
IDARTICOLO INTEGER NOT NULL,
IDARTICOLODISTINTA INTEGER NOT NULL);
this is my data
INSERT INTO DISTINTABASE (ID, IDARTICOLO, IDARTICOLODISTINTA) VALUES (9906, 4, 3);
INSERT INTO DISTINTABASE (ID, IDARTICOLO, IDARTICOLODISTINTA) VALUES (6, 4, 2);
INSERT INTO DISTINTABASE (ID, IDARTICOLO, IDARTICOLODISTINTA) VALUES (4, 4, 1);
INSERT INTO DISTINTABASE (ID, IDARTICOLO, IDARTICOLODISTINTA) VALUES (9908, 1, 6);
INSERT INTO DISTINTABASE (ID, IDARTICOLO, IDARTICOLODISTINTA) VALUES (7, 2, 3);
INSERT INTO DISTINTABASE (ID, IDARTICOLO, IDARTICOLODISTINTA) VALUES (9909, 1, 7);
INSERT INTO DISTINTABASE (ID, IDARTICOLO, IDARTICOLODISTINTA) VALUES (12, 3, 6);
INSERT INTO DISTINTABASE (ID, IDARTICOLO, IDARTICOLODISTINTA) VALUES (9901, 1, 2);
INSERT INTO DISTINTABASE (ID, IDARTICOLO, IDARTICOLODISTINTA) VALUES (9902, 1, 3);
INSERT INTO DISTINTABASE (ID, IDARTICOLO, IDARTICOLODISTINTA) VALUES (19, 3, 5);
this is my simple stored procedure:
CREATE PROCEDURE ARTICOLIFIGLI (
idpadrein integer,
idarticoloin integer)
returns (
out_id integer,
out_idarticolopadre integer,
out_idpadre integer,
out_idarticolo integer)
as
begin
/* Procedure Text */
end
The text was updated successfully, but these errors were encountered: