This project is read-only.
1

Closed

Wrong SQL displayed for C/AL Code in some cases

description

I have see situations, where there is wrong SQL statement displayed for e.g. FINDSET C/AL command. It looks like situations when the object is loaded from the DB first. Instead the SELEC over data the SELECT for the object is displayed. See the screenshot attachement taken from Sales order Posting...

file attachments

Closed Mar 5, 2015 at 8:29 PM by dwortho

comments

dmytrositnik wrote Nov 26, 2013 at 1:30 PM

The FINDFIRST operation was executed on the temp record so there should not be any SQL query which directly corresponds to it.
But in some cases server issues queries to metadata tables. For example if the record is accessed very first time. Metadata caches can be invalidated in this case server will re-fetch the metadata. In the trace from your screenshot FINDFIRST call caused metadata query, that is why metadata query is mapped to the FINDFIRST call.

kine wrote Nov 27, 2013 at 8:23 AM

Ok, thanks, than it is my wrong understanding of the result. In case, when the FINDFIRST will be over real data, will be there mapped both queries? For data and for metadata? If yes, than it is ok.

Thanks for explanation and thanks for the tool!

dmytrositnik wrote Nov 27, 2013 at 3:19 PM

Yes, you should see SQL queries for metadata and data.

wrote Apr 30, 2014 at 10:52 AM

wrote Mar 5, 2015 at 8:29 PM