Find the application from which TD query submitted - teradata

I am using Teradata v14. I want to use the PDCRINFO.DBQL* history tables to find out the application from which a particular query was submitted by a user.
For instance, I would like to know if a query was submitted from SQL Asst or by Business Objects, or by Informatica or may be even by a bteq script from unix etc.
Can anyone please advise ? Any pointers appreciated..
Thanks in advance

In DBQL you have the AppID. This one is provided by the Application itself and sadly not always that self-explaining. But you can identify the App.
Mostly you have to group some AppIDs to one App when doing reporting. E.g
WHEN DBQL.AppID LIKE ANY ('QUERYMAN', 'SQLA%') THEN 'TD SQL Assistant'
,WHEN DBQL.AppID LIKE ANY ('BUSOBJ', 'WEBIRICHCLIENT', 'WIREPORTSERVER') THEN 'SAP BusinessObjects'

Related

Why is the same query syntax not supported in Log Analytics and Application Insight Logs?

I am trying to figure out why the same query is not valid in both a Log Analytics and Application Insights workspace.
I've been working on creating a cross-resource query and when I write the syntax in Log Analytics it has a syntax error around the workspace operator. It is successful when I do the same thing in an Application Insights query.
The query looks like this:
union
workspace("DefaultWorkspace-b432aa91-rrrr-qqqq-zzzz-aabbba7e8f42-WUS2").SecurityEvent
,workspace("DefaultWorkspace-fca02198a-aaaa-eeee-cccc-aaad9fbf7302-EUS").SecurityEvent
| count
Since in both workspaces it references other workspaces, I would think it would be portable if queried under the same tenant (which I am). In Azure Log Analytics it gives me the error:
Unknown function: 'workspace'.
I am running these in the Azure portal at the moment.
Can you try adding a space after the comma? This query is working for my own workspaces.
union
workspace("DefaultWorkspace-b432aa91-rrrr-qqqq-zzzz-aabbba7e8f42-WUS2").SecurityEvent
, workspace("DefaultWorkspace-fca02198a-aaaa-eeee-cccc-aaad9fbf7302-EUS").SecurityEvent
| count
This is not a direct answer, but suggestions.
As far as I know, only if the query missing table name, then it will cause the error "Unknown function: 'workspace'.". Like below:
So first, make sure in your query, you are adding table name after workspace("xxx"). I notice that in your query, you're using the correct syntax, but just want to make sure the table name is there.
Second, if you're adding table name after workspace("xxx"), and still get this error. You can try just use the query below to check if the workspace("xxx") works:
workspace("adsmit-test").Heartbeat
| count
Please feel free to let me know if you still have the issue.
I tried the same statement 2 weeks later in both an Application Insights and Log Analytics and it works in both.

How to get column wise data using AEM query SQL2?

I am running a following AEM Query SQL2 on CRXDE and it is successfully returning me nodes as per following given screenshot.
But I need data like column wise (jcr properties) like SQL table. Can anyone help me if it is possible.
You can't do this with CRXDE. It shows only the path of the most outer node, even if the query has multiple columns. This is especially limiting, if your query uses joins.
In your case I would recommend the Query Builder. It has a totally different syntax, but the JSON or XML result contains all data you need.
I don't know other tools. As AEM developer I usually write a quick & dirty servlet, and let it run on my local instance (with production content)
Query Builder Debugger
http://localhost:4502/libs/cq/search/content/querydebug.html
Example Query
path=/content/we-retail/language-masters/en/experience
property=sling:resourceType
property.value=weretail/components/content/image
p.hits=full
p.nodedepth=2
Resulting JSON Query
http://localhost:4502/bin/querybuilder.json?p.hits=full&p.nodedepth=2&path=%2fcontent%2fwe-retail%2flanguage-masters%2fen%2fexperience&property=sling%3aresourceType&property.value=weretail%2fcomponents%2fcontent%2fimage
http://localhost:4502/bin/querybuilder.json?p.hits=full&p.nodedepth=2&path=%2fcontent%2fwe-retail%2flanguage-masters%2fen%2fexperience&property=sling%3aresourceType&property.value=weretail%2fcomponents%2fcontent%2fimage
Documentation
https://docs.adobe.com/content/help/en/experience-manager-64/developing/platform/query-builder/querybuilder-api.html
In your case especially see: Refining What Is Returned
You will find much more with Google, as the Query Builder is pretty old in AEM/CQ.

Triggers in PeopleSoft

Can we create triggers in PeopleSoft when running Peoplesoft App Engine?
We want to create triggers for some tables based on the selection at the time of App Engine
Thanks in advance
Take a look at the %Execute function to execute multiple sql statements or an pl/sql block from an AE program. This way you could create a trigger in an AE Program.
Documentation can be found in the Oracle PeopleBooks here: https://docs.oracle.com/cd/E55243_01/pt854pbr0/eng/pt/tape/langref_UsingApplicationEngineMeta-SQL-0771d9.html#topofpage
yes you can do that.
you can create a trigger on insert on PSPRCSRQST table, you will have process name in prcsname field, capture and do what ever you want

Beginning ASP.NET. using login name as sql parameter

Does anyone have some code or a link as to how to create the user login name as a parameter during a sql query in ASP.NET?
Basically I want to use the default membership structure with a new field ClubID, then I want to add a new table called aspnet_Clubs which contains things such as Club Name, stadium name, Balance etc etc... and then use a relationship between ClubID and a field in the aspnet_Clubs table to tie things together.
Then when each user logs in they should see the clubs information specific to their loginID.
I know the syntax to use for the query, its getting the loginname parameter and being able to use/assign it as part of the search that is causing me the problem.
In general it is not recommended to break the default schema of the aspnetdb where the Membership data is stored. It can bring you to unexpected consequences in the future.
I had a similar question a couple of days ago, please check it here, may be you will be able to adopt something from the discussion to your situation.

Sql Database Server

Hi i have a sql database server runnin on my desktop. I want to create an asp.net application to detect when new data has been inserted into the database. Is there a command in visual studio to detect when theres new data right away?
Use the timestamp datatype on each column. This will stay identical until a change is made to any column in that row. If you combine this with the rowcount you can be certain if anything has changed in your database. You would need to cache the current timestamps and row count and compare them with the results of a query, you can then find out if there is a change.
So in your answer to:
Is there a command in visual studio to
detect when theres new data right
away?
Yes there is, although its not a command is the timestamp function (not to be confused with anything to do with the time)
Perhaps you need to provide more details to your scenario since constant querying of the database might not be the best way forward.
You can get a row count of your dataset and create a application
IN VB
Dim i as Integer
i=dataset.tables("table").rows.count
in sql backed return a count of a table and create a ASP.Net website to get the count and when count change alerts you
It may be heavier duty than you are looking for, but SQL Notification Services will do what you want. Essentially you execute a query and tell notification services you want to be notified whenever re-running that query would produce different results.
if you are using caching you can make it dependent on sql.
or you can fire email using sql trigger so when ever trigger get fired you will receive an email.
otherwise you will have to check your db again and again for any changes.
if you can provide more details about exact situation , we can provide more specific solution
You can create a webservice and call it using javascript.
here you can find sample how to call webservice using javascript:
function CallWebservice()
{
myWebService.isPrimeNumberWebService.callService(isPrimeNumberResult, "IsPrime",
testValue.value);
setTimeout("CallWebservice()",100);//here set time according to your requirement
}
For timer in javascript:
http://dotnetacademy.blogspot.com/2010/09/timer-in-javascript.html
For webservice in javaScript:
http://www.webreference.com/js/tips/020715.html
How to call webservice in JavaScript for FireFox 3.0

Resources