Forum Discussion

doug_bowen's avatar
doug_bowen
Occasional Contributor
8 years ago

How can I read the SQL from DB checkpoint?

I only want to output this information to the log. I have read in various posts that dynamically changing SQL on a DB Checkpoint is not supported. I only need to read this info and present it to the Log.

 

Is this possible?

  • The alternative is, rather than using the build in DBTable check points, write your own code to retrieve the SQL data based upon an SQL query and then do your own comparison against the DBTable object rather than using the built in "Check" method.  The table can still be stored and used for your expected values for your test, you'd just have to loop through your own SQL query result and do the comparisons in code.

  • tristaanogre's avatar
    tristaanogre
    Esteemed Contributor

    I did a bit of looking around and, as far as I can tell, the tables stored in DBTables don't really have any SQL exposed to the test environment. You can get the SQL Connection string, though, but the actual query used to retrieve the data.... not so much.

    • doug_bowen's avatar
      doug_bowen
      Occasional Contributor

      I found the same thing! This is quite unfortunate. 

       

      Being able to access this information as well as the check() output from within a script would be super helpful.

       

      This would allow me to disable the log and check for something, only presenting a failure if I chose to.

      • tristaanogre's avatar
        tristaanogre
        Esteemed Contributor

        The alternative is, rather than using the build in DBTable check points, write your own code to retrieve the SQL data based upon an SQL query and then do your own comparison against the DBTable object rather than using the built in "Check" method.  The table can still be stored and used for your expected values for your test, you'd just have to loop through your own SQL query result and do the comparisons in code.