Forum Discussion

CARQUESTTechnol's avatar
CARQUESTTechnol
Contributor
15 years ago

JDBC Request and Count

I'm trying to get the count of the number of rows returned by a specific query to compare to a webservice.

When I write the SQL:
Select Count(*) from table where cat_id='-1'

The query works in the SQL builder but doesn't work as a JDBC step. This query fails with a "Error getting response; null".

What do I need to do to have this query return a value that I can compare against?

12 Replies

  • Hi!

    hmm.. what soapUI Pro version are you using? And what database is this?

    regards!

    /Ole
    eviware.com
  • Hi!

    hmm.. not yet. Are you getting any errors in the error log tab at the bottom of the soapUI window?

    regards!

    /Ole
    eviware.com
  • Yes I do:

    Tue Jan 11 15:33:03 EST 2011:ERROR:org.w3c.dom.DOMException: INVALID_CHARACTER_ERR: An invalid or illegal XML character is specified.
    org.w3c.dom.DOMException: INVALID_CHARACTER_ERR: An invalid or illegal XML character is specified.
    at org.apache.xerces.dom.CoreDocumentImpl.createElement(Unknown Source)
    at com.eviware.soapui.support.xml.XmlUtils.addResultSetXmlPart(XmlUtils.java:1516)
    at com.eviware.soapui.support.xml.XmlUtils.createJdbcXmlResult(XmlUtils.java:1449)
    at com.eviware.soapui.impl.wsdl.panels.teststeps.JdbcResponse.<init>(JdbcResponse.java:36)
    at com.eviware.soapui.impl.wsdl.panels.teststeps.JdbcSubmit.createResponse(JdbcSubmit.java:329)
    at com.eviware.soapui.impl.wsdl.panels.teststeps.JdbcSubmit.runQuery(JdbcSubmit.java:198)
    at com.eviware.soapui.impl.wsdl.panels.teststeps.JdbcSubmit.run(JdbcSubmit.java:160)
    at java.util.concurrent.Executors$RunnableAdapter.call(Unknown Source)
    at java.util.concurrent.FutureTask$Sync.innerRun(Unknown Source)
    at java.util.concurrent.FutureTask.run(Unknown Source)
    at java.util.concurrent.ThreadPoolExecutor$Worker.runTask(Unknown Source)
    at java.util.concurrent.ThreadPoolExecutor$Worker.run(Unknown Source)
    at java.lang.Thread.run(Unknown Source)


    This is for the following Query:

    Select Count(ACES.MAKE.MAKEID)
    From ACES.MAKE

    This query works when I preview it in the SQL builder.
  • Hi!

    ok thanks, this is hopefully fixed in the upcoming nightly build. Please go for that or try giving the count(*) column a valid xml name, for example

    Select Count(ACES.MAKE.MAKEID) "Count"
    From ACES.MAKE

    Does that help?

    regards!

    /Ole
    eviware.com
  • That workaround fixed it for me. Thanks. What will be in the new release to address this issue?
  • Hi!

    Great! The upcoming release will normalize column names to be valid xml element names, currently it is trying to create an element named "Count(*)" which isn't valid.

    regards!

    /Ole
    eviware.com
    • kkannan's avatar
      kkannan
      New Contributor

      Hi,

       

      I'm trying to get the count of the number of rows returned by a specific query to compare to a webservice.

      When I write the SQL:
      Select Count(*) from table where visitorid='Khjs769'

      The query works in the SQL builder but doesn't work as a JDBC step. This query fails with a "Error getting response; null".

      What do I need to do to have this query return a value?

       

      Am using SOAPUI Pro 5.1.2   DB : Mongo DB

      • nmrao's avatar
        nmrao
        Icon for Champion Level 1 rankChampion Level 1
        What do you see in the log files of soapui?