Page 1 of 1

Exception thrown when using RunQuery Service

Posted: April 25th, 2022, 11:28 am
by smackie
I am trying to use the runquery database service and when I attempt to run it it throws an exception. The query is SELECT max(QDBN03) FROM <xsl:value-of select="$EP_Connection_Database_JDEdwards_TablePath_Data"/>.F560001 where QDNAME='APAHSTAX' and the exception is "The '(' character, hexadecimal value 0x28, cannot be included in a name." Below is the entire exception string that is being thrown. I've verified the query in sql developer.

<Result><Message>The '(' character, hexadecimal value 0x28, cannot be included in a name.</Message><StackTrace> at System.Xml.XmlDocument.CheckName(String name)
at System.Xml.XmlElement..ctor(XmlName name, Boolean empty, XmlDocument doc)
at System.Xml.XmlDocument.CreateElement(String prefix, String localName, String namespaceURI)
at System.Xml.XmlDocument.CreateElement(String name)
at KRise.EASYProcess.Utils.ServiceRow.AddColumn(String columnName, String columnValue) in C:\EASYProcess\EPSources\Git\EASYProcess5_ECC\Utility\ServiceRow.cs:line 115
at KRise.EASYProcess.Workshop.DBWorkshop.Services.RunQuery(Service service) in C:\EASYProcess\EPSources\Git\EASYProcess5_ECC\DBWorkShop\Services.cs:line 1141</StackTrace></Result>

Re: Exception thrown when using RunQuery Service

Posted: April 25th, 2022, 5:15 pm
by SteveCap
You should alias the column. Change the query to:
SELECT max(QDBN03) AS QDBN03 FROM <xsl:value-of select="$EP_Connection_Database_JDEdwards_TablePath_Data"/>.F560001 where QDNAME='APAHSTAX'

Re: Exception thrown when using RunQuery Service

Posted: April 26th, 2022, 7:50 am
by smackie
Thanks Steve, that worked perfectly and I will make note of this for future reference.