-
1. Re: BQT - Sort result set before comparison
shawkins Nov 18, 2015 8:23 AM (in response to jpmat)BQT does not have a notion of order insensitive results. You could log an enhancement request for that or a workaround would be to use an anonymous procedure block as the query:
begin
insert into #temp ... desired query ...;
select * from #temp order by ... desired ordering ...;
end
That will separate the affect of the sort.
-
2. Re: BQT - Sort result set before comparison
van.halbert Nov 18, 2015 8:26 AM (in response to jpmat)Jean-Pierre,
Currently, there's no option to do a sort after retrieving the results. But I can see your reason for wanting one. If you could create an issue in the github instance, we can take a look at it.
Thanks.
Van
-
3. Re: BQT - Sort result set before comparison
jpmat Dec 17, 2015 8:11 AM (in response to shawkins)Hi Steven
Could you give a short example of use of anonymous procedure block ? I have not been able to find by myself.
Thanks in advance
-
4. Re: BQT - Sort result set before comparison
jpmat Dec 17, 2015 8:14 AM (in response to van.halbert)Hi Van
vhalbert/SQLBulkQueryTool · GitHub
I cannot create issue in GitHub. It looks like "Issue Creation" is not enabled on it.
Thanks
Jean-Pierre
-
5. Re: BQT - Sort result set before comparison
shawkins Dec 17, 2015 8:34 AM (in response to jpmat)Example sql for an anonymous block is shown above, it's just begin / end wrapping a series of statements. You can issue it the same way you would a regular sql statement. See also DML Commands - Teiid 9.0 (draft) - Project Documentation Editor
-
6. Re: BQT - Sort result set before comparison
jpmat Dec 17, 2015 10:21 AM (in response to shawkins)I've tried, with SQUirreL:
BEGIN
select *
from dimME_OCN.MATERIAL ma
where ma.material_number = 10131227
END
-- => Error TEIID31100 Parsing error: Encountered "ma.material_number = 10131227 [*]END[*]"
SELECT *
FROM (
BEGIN
select *
from dimME_OCN.MATERIAL ma
where ma.material_number = 10131227
END) as t1
-- => Error TEIID31100 Parsing error: Encountered "* FROM ( [*]BEGIN[*] select *" at line 3, column 9.
SELECT *
FROM ( EXEC
BEGIN
select *
from dimME_OCN.MATERIAL ma
where ma.material_number = 10131227
END) as t1
-- => Error TEIID31100 Parsing error: Encountered "FROM ( EXEC [*]BEGIN[*] select *" at line 3, column 9.
I'm using JBoss DV 6.2 with Teiid 8.7. Is it the reason it doesn't work ?
-
7. Re: BQT - Sort result set before comparison
shawkins Dec 17, 2015 10:35 AM (in response to jpmat)> I'm using JBoss DV 6.2 with Teiid 8.7. Is it the reason it doesn't work ?
Yes, the first one is lacking a ; at the end of the statement in the block.
... ma.material_number = 10131227;
END
On the others you can't nest an anonymous procedure block because it is a top level command not a query expression.
-
8. Re: BQT - Sort result set before comparison
jpmat Dec 17, 2015 10:52 AM (in response to shawkins) -
9. Re: BQT - Sort result set before comparison
shawkins Dec 17, 2015 12:10 PM (in response to jpmat)In squirrel under the sql tab in the session properties, there is a setting for the statement separator. You have to use something other than a semicolon.
> May I ask you what is the JDBC client you use yourself ?
SQuirreL or Teiid Designer mostly.
-
10. Re: BQT - Sort result set before comparison
jpmat Dec 22, 2015 9:44 AM (in response to jpmat)Thanks. The anonymous procedure does what I'd like in BQT.
I have also create Jira entry as you requested: