Extract BAQ actual SQL queries

I fear I already know the answer here, but here goes :crossed_fingers:

I have a gigantic BAQ, consisting of 1 CTE, and 22 subqueries. The BAQ was constructed from working SQL code (this is a migration of an old Crystal Report that used an ODBC connection for a subreport).

I have completed the conversion from SQL to BAQ, the SQL code shown in the BAQ query window looks ok, but when trying it out, I get those nonsensical errors:


      Incorrect syntax near 'm'.
      Incorrect syntax near 'SubAllBin'.
      Incorrect syntax near 'm'.
      Incorrect syntax near 'SubAllBin'.
      Incorrect syntax near 'SubAsOfTran'.
      Incorrect syntax near 'm'.
      Incorrect syntax near 'SubAllBin'.
      Incorrect syntax near 'SubAsOfQtyTran'.

Now, I know that the SQL code shown isn’t the actual query being executed. I am wondering if there is a way to capture the actual SQL being executed, in order for me to figure out where the problem is in the generated code?

Otherwise I am kind of at a loss as to how I am supposed to debug this…

It can be dumped to the server log with trace flag

<add uri="profile://ice/fw/DynamicQuery/BaqStatement" />

6 Likes

Awesome! I need to add this to the user config file, or can I pass it as a flag in the tracelog window?

it is in AppServer.config in server folder. and dump will also be on server.

2 Likes

Wow, I never even knew this file existed! Amazing, many thanks I think you just saved me a few hours of work… :smiley:

1 Like

where’s the actual dump? Haven’t managed to find it…

In the trace log.

1 Like

oh, I see - it’s a parameter of normal tracing, thanks!