Follow

SQLWrite() statement shows no queries

Problem:

You are trying to use the Agent Procedure function "SQLWrite()" in an agent procedure. You have copied the XML to \Kaseya\xml\Procedures\AgentProcSQL\0\SQLWrite, but the Agent Procedure interface does not allow you to select the XML file from the list

 

Cause:

The XML file is parsed by the system in the background and must be correct. If the XML has errors, either in the XML format itself, or the query in the XML is invalid - a table name is incorrect, or there is a spelling mistake in the query - then the XML file will not be available in the list.

 

Solution / Workaround:

Check your XML file for errors. Try running the SQL query outside of the XML to check that the query is valid.

Was this article helpful?
1 out of 1 found this helpful
Have more questions? Submit a request

3 Comments

  • 0
    Avatar
    Jason Hoyt

    Oh, additional information - I am trying to write to a table that was added in as a test. The table does exist and everything points to it just fine.

  • 0
    Avatar
    Jason Hoyt

    Apologies, the first comment did not take leaving the above comment rather out of place.

    If all of the XML has been checked and the SQL statement runs correctly on its own is there anything else that will keep this from showing up? Namely is there a length limit on the sql="" part of the xml definition?

  • 0
    Avatar
    Thomas Heafner

    I have found that there is a 1092 character limit in the .xml file for it to be available in the procedure. I counted including my xml tag code, maybe it's only the SQL data.....but yes there is a limit around 1100.

Please sign in to leave a comment.