for inject custom SQL I am trying to use custom macros.
I need to define custom fields which at run-time can refer to tables on different schemes. Now if I define only one macro the SchemaModeler validates it correctly while if I define 2 or more macros the validation fails.
There are no limits however there are 3 things you should be aware of:
Custom macros are calculated at runtime. So it is not possible for Schema Modeler to properly verify statements containing custom macros or to create field definitions from the statement results. DASM cannot set correct macro values so it just uses macro name as a default value.
Custom macros are not secure. You should not allow to set their values from client side. Otherwise it would be an open SQL Injection vulnerability
By default custom macros are disabled on the DataService level. You’ll need to set corresponding service property to enable them.
Ok. But why if I insert a custom macro the Schema Modeler validates the statment correctly while if I insert 2 it doesn’t? Conceptually either it always validates it or it never validates it.
Yes, I know. I use it only server side and based on the name of the macro I have already defined the SQL statment to replace. Nothing is built at run-time