Can I push down a comment in Teiid to the source query? - jboss

Is it possible to push down comments to the source database query?
Given example Teiid query:
select /* 'request_id' */ columnA, sum(columnB)
from tableA
I'd like to see the comment pushed down to the source database so that I can capture the request_id in the logs. I've looked at source hints, but have not had any luck getting those pushed down to the source query either.

See http://teiid.github.io/teiid-documents/master/content/reference/JDBC_Translators.html and search for UseCommentsInSourceQuery

Related

How do I find the source code to a table in pgadmin?

I have a simple question. When you create a table/query from Pgadmin, how do you find the source code ( not sure if these are the correct words) you used?
I have looked under schema and can't find anything.
Attached is a photo. Thank you
Select the object on the left tree view and go to the SQL tab on the right to see the DDL.

See why an Amazon Redshift scheduled query fails

I have a scheduled query in Redshift that simply will not run. It works when I execute the query manually in the query editor, just not when scheduled. I can't seem to find any feedback about why it's failing, though. I can see the schedule history, a unique Id, and the status of "Failed", but no more info.
Is there a system table/view that I can dig into and find out what's going on with my query? The SQL consists of basic select, update, insert style code - nothing fancy, just long.
You can look for any errors using:
select
process,
errcode,
linenum as line,
trim(error) as err
from
stl_error;
Also: Retrieve Redshift error messages
Ref.: STL_ERROR
It says in the description that it doesn't record SQL errors which would likely be the problem of the failed query.
I'm trying to sort this one as well and it seems it's limited as I only see the
Any idea how to get the associated query ID, PID, or EID so I can check maybe against the query history?

OrientDB -Order by FIELD not working

I want to order the table by the id's given within "IN Clause"
SELECT * FROM mytable WHERE id IN [1,2,3,4] ORDER BY FIELD(id,3,2,1,4);
But i am getting error as response.
Sorry, OrientDB does not support this in current release. Please open an issue on the official issue tracker, we'll consider it for next releases.

Unable to retrieve the latest data from DB2 using with ur clause

We are facing one interesting issue in my production DB.
We are using Db2 data base , after issuing update command(from command center, dqlsuirrel....all) and commit , not able to retrieve the latest data/updated data from select query with UR(It is returning previous data).But if i use the select clause with RR then i am able to see the latest data.
One more interesting thing if update the data today , i can't get the latest by using Select with UR on the same day but i am able to retrive the latest data(which i updated on previous day) on next day (By using select ...from ABC with UR).
I found the problem.
A MQT is created on this base table(XYZ) so whenever i query the against table (XYZ) it is getting data from MQT table/buffer.

DB2 AS400 Triggers

I've been tasked with finding a way to migrate data into a DB2 AS400 database. When the data is entered (currently manually) on the front end, the system is doing some calculations and inserting the results in a table.
My understanding is that it's using a trigger to do so. I don't know very much about this stuff, but I have written code to directly insert values into that same table. Is there a way for me to figure out what trigger is being fired when users enter data manually?
I've looked in QSYS2/SYSTRIGGERS and besides not making much sense to me, I see no triggers that belong to the SCHEMA with my table in it.
Any help here would be awesome, as I am stuck.
SELECT *
FROM QSYS2.SYSTRIGGERS
WHERE TABSCHEMA = 'MYSCHEMA'
AND TABNAME = 'MYTABLE'
Should work fine.
If you'd prefer to use a 5250 command line, the Display File Description (DSPFD) command will show you the triggers on a file (table)
DSPFD FILE(MYSCHMA/MYTABLE) TYPE(*TRG)
Lastly, trigger information is available via the IBM i Navigator GUI. Either the older fat client version or the newer web based one.