How do I add automated comments line in user’s SQL. Is it done in Designer ? Once users run an query in webi or deski, there are comments lines in his/her SQL.
/UNV:ORDER:/
SELECT
GDW.D_CALL.CALL_ID
FROM
GDW.D_CALL
/UNV:Orderl:@VARIABLE(‘BOUSER’):@VARIABLE(‘DOCNAME’):/
or
/UNV:CONTRACTS:/
SELECT
SA.TABLE.OBJID
FROM
SA.TABLE
/CONTRACTS:@VARIABLE(‘BOUSER’):@VARIBALE(‘DOCNAME’):/
You can use the END_SQL parameter to add a comment at the end of any SQL generated from the universe. I’m not sure if we can add a comment to the beginning in any sort of automatic fashion. For example, here’s what I have in one of my universes for the END_SQL parameter:
/* User = @variable('BOUSER') Report = @variable('DOCNAME') */
Hi, Dennis, welcome back. The challenge with the solution you provided is it relies on the user to take some action. The END_SQL parameter was added so that folks could include special database instructions like “for uncommitted read” and so on, but it works perfectly for adding comments to the SQL as well. By setting it as a universe parameter, it’s going to be automatic on every query, including adhoc.
I was doing some real complex Oracle Financials development at a client for a long time and I fell out of the habit of posting. My account was locked when I tried to sign in.
Depending on the users to do something is folly. However, the SQL monitoring tool may always want the information in the same place in the SQL and if it is at the end, it will never be in the same place. Reports developed by IT could always have the object included. The solution depends on the requirements.
It’s a very cool feature that I hadn’t heard of before. I wish I had because it would have simplified a lot of support issues - DBA’s calling me about SQL that is running long but they don’t know if it is from a universe I support or if it is from a published report.