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
PSQL SELECT with ORDER BY :variable [DOC4] #18
Comments
Commented by: Alice F. Bird (firebirds) Date: 2006-03-29 19:11 Ok Dmitry, I incline to your opinion too. The problem is This is now categorized as Documentation issue. |
Commented by: Alice F. Bird (firebirds) Date: 2006-03-29 19:07 The desired functionality is available through the use of Example: FOR |
Commented by: Alice F. Bird (firebirds) Date: 2006-03-29 18:51 Implementors did consider everything, people just don't want |
Commented by: Alice F. Bird (firebirds) Date: 2006-03-29 18:24 Certainly it's a side effect of ORDER BY <expression> What is the core of this issue is that the definition of I think that implementers did not considered the impact that So we can chose freely how to solve this issue: 1) We can mark it as pitfall (really anoying one, as people 2) If engine can detect constant expression, then it could 3) If expression is just single variable, engine can raise |
Commented by: Alice F. Bird (firebirds) Date: 2006-03-29 18:07 Ivan is 100% correct, this is as designed. Order by |
Commented by: Alice F. Bird (firebirds) Date: 2006-03-29 17:31 I think it is not a bug - in fact you are not sorting by |
Commented by: Alice F. Bird (firebirds) Date: 2006-03-29 16:58 Verified on Firebird 1.5.2 and 2.0 RC1 |
Submitted by: @pcisar
SFID: 1460715#
Submitted By: pcisar
Resultset is ordered "randomly" when sort order field
No. is specified by variable. It's undocumented "grey
zone" as it's not specified whether Firebird support
this or not. Anyway, it's a bug as Firebird should
either report an error or return corectly ordered result.
Sample procedure using example EMPLOYEE.FDB database:
SET TERM ^ ;
CREATE PROCEDURE TEST_ORDER (
ORD INTEGER)
RETURNS (
COUNTRY VARCHAR(15),
CURRENCY VARCHAR(10))
AS
begin
for select * from country order by :ord into
:country, :currency do
suspend;
end
^
SET TERM ; ^
COMMIT;
select * from test_order(1);
returns:
COUNTRY CURRENCY
=============== ==========
Germany D-Mark
Australia ADollar
Fiji FDollar
Belgium BFranc
France FFranc
Switzerland SFranc
Hong Kong HKDollar
Austria Schilling
Canada CdnDlr
Japan Yen
Italy Lira
USA Dollar
England Pound
Netherlands Guilder
The text was updated successfully, but these errors were encountered: