Is there a way to convert the TableRequestInfoV5 whereclause XML into an SQL where clause manually

Is there a way to convert the TableRequestInfoV5 whereclause XML into an SQL where clause manually

For some cloud server purpose I need to manually process the WhereClause in TableRequestInfoV5

I would need to translate the (Outer)Xml member field and make it an SQL where clause.

Is there an API call surfaced for that?

TIA,

Frederic

Ach, forgot to mention, this is .NET RO/DA server code (client is delphi) but the translation needs to happen server side

Hi,

You can try do this:

note: it will generate generic sql.

also you can review possibility to pass DA SQL with TableRequestInfoV6

How do you get the where expression from the xml?

I tried ParseExpression but this failed

Hi,

try WhereExpression.FromXmlNode()

This works perfectly, thanks

Hi,

After some more review it seems it still needs a translation of quotes. The literal strings in "

need to be in ‘’

Hi,

You can do conversion manually.
Check DynamicWhereTranslator class.
but you should generate sql here instead of transforming to DA SQL’s expression.

Hello,

How do I find how I should use DynamicWhereTranslator

Hi,

check ...\Data Abstract for .NET\Source\RemObjects.DataAbstract.Server\DASQL\Core\DynamicWhereTranslator.pas.

this class transforms DynamicWhere Expression to DASQL Expression.
you can take it as a base and create own class with similar logic, but only your class should generate SQL instead of.

Thanks,

I converted this code to C# .NET and then converted the resulting Expression object with ToString() and the result is a string with single quotes and correct escape for single quote in the strings

So it seems the DynamicWhereTranslator code did not need any changes

Thanks,

Frederic