In your %XML.Reader set IgnoreSAXWarnings to 1.

In your XML enabled classes set params:

Parameter XMLIGNOREINVALIDTAG As BOOLEAN = 1;
Parameter XMLIGNOREINVALIDATTRIBUTE As BOOLEAN = 1;

This would allow for errors to be skipped, but they wouldn't be reported either.

I'm not sure if the behavior you want is possible without some modifications.

Write statement does what it's name implies - outputs characters into a current device. It's a way to go if you're working from a terminal, but ZEN does it's own device management, so writing into a current device interferes with ZEN also writing into current device, which causes an error.

 

To make it work check if there's no data (SQLCODE=100) and set OutVal to empty (or error message) and work with that on a client.

To get query text you can query %Dictionary.QueryDefinition. For example:

SELECT *
FROM %Dictionary.QueryDefinition
WHERE Parent = class

Would return all queries for a class.

As for getting only columns, here's some ideas:

  • If the query was executed somewhen and cached, there would be a generated class, holding metadata among other things
  • There are generated methods QueyNameGetInfo and QueryNameGetODBCInfo - they return metainformation about query columns
  • Execute the query and iterate over metadata

What do you want to achieve?

Why is executing a query not possible?