Subject Re: [firebird-support] Order by :variable in a S tored Procedure
Author Mark Rotteveel
If you pass a variable into an order by, it will sort on that *value*, and as that is the same for all rows, it is essentially a no-op. You can only do this by either sourcing the order by using a case to specify the column from a parameter, or by dynamically constructing the query, and executing it with execute statement, with risk for SQL injection.


----- Reply message -----
Van: "Gugui gugui_sarubi_macchi@... [firebird-support]" <>
Aan: <>
Onderwerp: [firebird-support] Order by :variable in a Stored Procedure
Datum: di, nov. 3, 2015 19:58

Hi all,
is it possible to pass a variable into a Order by ?

I did it and the StoredProcedure was created without errors
but the variable passed into an 'order by' was ignored and firebird 
assumed the primary key order instead

any tip ?





Visit and click the Documentation item
on the main (top) menu.  Try FAQ and other links from the left-side menu there.

Also search the knowledgebases at 


Yahoo Groups Links

<*> To visit your group on the web, go to:

<*> Your email settings:
    Individual Email | Traditional

<*> To change settings online go to:
    (Yahoo! ID required)

<*> To change settings via email:

<*> To unsubscribe from this group, send an email to:

<*> Your use of Yahoo Groups is subject to: