Written by

Senior Cloud Architect at InterSystems
MOD
Question Eduard Lebedyuk · Jul 14, 2017

How can I determine if a query is an SQL or an MDX query

I have a query text that I need to execute and return results as xml.

It may be an SQL query or an MDX query. Is there some easy way to determine which one is it?

Any ideas?

Comments

Peter Steiwer · Jul 14, 2017

In MDX, you need to include "on AXIS" where AXIS can be 0,1,2,rows,columns. I think it would be rare to find this text in an SQL query.

Is calling %DeepSee.ResultSet.%PrepareMDX() and checking the status an option? If this succeeds, you are ready to Execute and if it does not, then you can proceed with SQL.

0
Eduard Lebedyuk  Jul 14, 2017 to Peter Steiwer

Thank you.

I thought about using prepare, but I'm searching for solutions without it.

"ON AXIS" should work

0