SQL query to get the list of approvals
Hi,
Could someone let me know the SQL query to get the list of all the pending approvals for a user in OIM 11g R2.
Thanks
There are a few ways to do this:
- The easiest would be to use a Relationship Query from the CMC. To do this, go to the Universes section on the CMC, right click on the relevant universe, select tools >> Check Relationships.
- Use Query Builder. You will need more than one query to pull the information you need. You could try something like the below (for Webi)
SELECT SI_NAME, SI_WEBI, SI_DATACONNECTION FROM CI_APPOBJECTS
WHERE SI_KIND = 'universe' and SI_NAME = 'Universe Name'
This will give you a list of Webi Reports by SI_ID.
You'll need another query to list Webi report names:
SELECT SI_NAME FROM CI_INFOOBJECTS WHERE SI_ID IN (SI_ID from query above)
- This is trivial via Auditing / the Activity universe. This of course will only return reports that have already run.
Best.
Srinivas
Similar Messages
-
SQL query to get a list of relations between workitems
How can I create a SQL query to get a list of all problems with related changes? And all problems with related incidents?
I have tried to join the tables RelationshipTypeDim with ProblemDimKey and ChangeRequestDim, but the results are not correct.The relationships in the data warehouse can be kind of tricky. The relationships are contained in the WorkItemRelatesToWorkItemFactvw table. This table lists the related items by their WorkItemDimKey, so you cannot reference directly from the ChangeRequestDimvw
or ProblemDimvw. You will need to reference the WorkItemDimvw to get the WorkItemDimKey for each entry.
The query below will get all of the related work items from the Change Request class. The way the joins work is ChangeRequestDimvw gets the list of change requests. Then inner joins WorkItemDimvw to get the WorkItemDimKey for each CR. Then inner joins WorkItemRelatesToWorkItemFactvw
to get all of the CRs with related work items. Then inner joins the WorkItemDimvw again to get the ID of the related work item.
Now the tricky part is it appears that these relationship are set based on which item that created the relationship. So you need to union a second query that reverse the relationship on the WorkItemRelatesToWorkItemFactvw.
This query should give you a good start on getting the related work items. You can filter it down from here if you only want to include problems.
SELECT C.ID, WIWI.ID
FROM dbo.ChangeRequestDimvw C
INNER JOIN dbo.WorkItemDimvw WI ON
WI.EntityDimKey = C.EntityDimKey
INNER JOIN dbo.WorkItemRelatesToWorkItemFactvw AS WIRWI ON
WIRWI.WorkItemDimKey = WI.WorkItemDimKey
INNER JOIN dbo.WorkItemDimvw AS WIWI ON
WIWI.WorkItemDimKey = WIRWI.WorkItemRelatesToWorkItem_WorkItemDimKey
union
SELECT C.ID, WIWI.ID
FROM dbo.ChangeRequestDimvw C
INNER JOIN dbo.WorkItemDimvw WI ON
WI.EntityDimKey = C.EntityDimKey
INNER JOIN dbo.WorkItemRelatesToWorkItemFactvw AS WIRWI ON
WIRWI.WorkItemRelatesToWorkItem_WorkItemDimKey = WI.WorkItemDimKey
INNER JOIN dbo.WorkItemDimvw AS WIWI ON
WIWI.WorkItemDimKey = WIRWI.WorkItemDimKey
Order by C.ID
Matthew Dowst |
Blog | Twitter -
SQL query to get the Datetime 06 hours prior to the table Datetime value
Hi Experts,
I'm just trying to create a SQL query to get the Datetime which should be 06 hours prior to my Table column value(Executiontime),
Eg: my Executiontime(column) value is 07:00AM means, this query should fetch the detail of first VMName from table at 01:00AM,
SQL Table Name: TestTable
Columns: VMName(varchar),status(varchar) Executiontime(Datetime)
SQL Query : Select Top 1 VMName from
TestTable where convert(date,Exeutiontime)=convert(date,getdate()) and
status='0' and ExecutionTime > dateadd(hour,6,getdate())
Request someone to alter this Query to my requirement or give me the new one.
Regards,
Sundar
SundarHi All,
Thanks for your Prompt response. I tried the below queries, but still I don't have any luck. Actually the queries are returning the value before the condition met (say when the time difference is more than 06 hours). I want the
query to return exactly @ 06 hour difference or less than 06 hours,
Query 01: Select Top 1 VMName from TestTable where
convert(date,Exeutiontime)=convert(date,getdate())
and status='0'
and ExecutionTime >
dateadd(hour,-6,getdate())
Query 02: Select
Top 1 VMName from TestTable where
status='0'
and ExecutionTime >
dateadd(hour,-6,getdate())
Query 03: Select
Top 1 VMName from TestTable where status='0'
and ExecutionTime >
dateadd(hour,-6,ExecutionTime)
Can someone point out the mistake please.
Regards,
Sundar
Sundar -
OIM sql Query for getting the status of the task which got failed
Hi Everyone,
We have a requirement like we need to get the status of a particular task(say Create User in OID resource - Completed\Rejected status) for the particular user.We are able to get the status of the resource provisioed to the user but not the status of the particular task getting trigerred for the user.can someone put some light on this.We need to get the SQL query for this.
Thanks in Advance.
Regards,
MKNHi
Use this sample query to get the task status, also check the cooments
SELECT USR.USR_LOGIN, OSI.SCH_KEY,SCH.SCH_STATUS,STA.STA_BUCKET FROM
OSI,SCH,STA,MIL,TOS,PKG,OIU,USR,OBJ,OST
WHERE OSI.MIL_KEY=MIL.MIL_KEY
AND SCH.SCH_KEY=OSI.SCH_KEY
AND STA.STA_STATUS=SCH.SCH_STATUS
AND TOS.PKG_KEY=PKG.PKG_KEY
AND MIL.TOS_KEY=TOS.TOS_KEY
AND OIU.USR_KEY=USR.USR_KEY
AND OIU.OST_KEY=OST.OST_KEY
AND OST.OBJ_KEY=OBJ.OBJ_KEY
AND OSI.ORC_KEY=OIU.ORC_KEY
AND OBJ.OBJ_NAME='AD User'
AND OST.OST_STATUS = 'Provisioning' -- filter accordinglly
AND STA.STA_BUCKET = 'Pending' -- filter accordinglly
AND PKG.PKG_NAME='AD User' -- filter accordinglly
AND MIL.MIL_NAME='System Validation' ---- filter accordinglly
Thanks,
Kuldeep -
SQL Query, to know the list of Invoices associated with a sales order
Hello All,
Can any one let me know the query to know the list of all the invoices associated with a sales order.
Please do the needful.
Thanks,Hello All,
Please let me know is this possible to have the list of Invoices for an associated Sales Order.
Thanks,
Abdul -
SQL Query to get the # of files in folders in a library
Anyone has the SQL query to list the number of files in each folders in a SharePoint library?
Technically it's a grey area of support as MS don't mind you doing it but won't help you if you encounter problems, the script is much better though.
Scratch that, the script isn't that good. It's using .items which won't work on large lists and is slow. The version below is untested but should be significantly faster and work on large lists.
$starttime = Get-Date
#Creating new site object
$siteurl = Read-Host "Enter the name of your site and press enter"
$site = New-Object Microsoft.SharePoint.SPSite($siteurl)
#Assigning all webs (sites) to $webs
$webs = $site.Allwebs
#System Libraries defined so they won't be touched##
$systemlibs =@("Converted Forms", "Customized Reports", "Documents", "Form Templates",
"Images", "List Template Gallery", "Master Page Gallery", "Pages",
"Reporting Templates", "Site Assets", "Site Collection Documents",
"Site Collection Images", "Site Pages", "Solution Gallery",
"Style Library", "Theme Gallery", "Web Part Gallery", "wfpub")
Write-Host "Total number of webs that will be traversed: " $webs.count
$DocLibsCount = 0
$DocLibwItems = 0
$totalitems = 0
$subfolderitems = 0
foreach($web in $webs)
$listcoll = $web.lists
foreach($list in $listcoll)
if($list -eq $null)
Write-Host
else
$base = $list.GetType()
if($base.name -eq "SPDocumentLibrary")
if ($systemlibs -contains $list)
{ continue}
else
$DocLibsCount += 1
$totalitems += $List.itemcount
$name = $list.Title
$folders = $web.GetFolder($name).SubFolders
for($etr = 0;$etr -lt $folders.count; $etr++)
if($folders[$etr].Name -ne "Forms")
Write-Host "Processing SubFolder ItemCount" -ForegroundColor Red
$tempcount = $folders[$etr].ItemCount
$subfolderitems += $tempcount
Write-Host
Write-Host
Write-Host "Total # of Document Libraries: " $DocLibsCount -ForegroundColor Green
Write-Host "Total # of Document Libraries that contain items: " $DocLibwItems -ForegroundColor Green
Write-Host "Total # of items: " $totalitems -ForegroundColor Green
Write-Host "Total # of items in DocLib\Subfolders: " $subfolderitems -ForegroundColor Green
$finishtime = Get-Date
Write-Host
Write-Host “Script Duration” –ForegroundColor Yellow
Write-Host “Started: “ $starttime –ForegroundColor Yellow
Write-Host “Finished: “ $finishtime –ForegroundColor Yellow
Stop-SPAssignment -Global -
SQL query to get the monitor target on a monitor
Hi!
I have a list of some custom created Monitors. I need a list of which computers that are using the monitors, the "Monitor target". Please help me with this. It need to be a SQL Query because my powershell have stopped working.Yes that is what i have explained you with the screenshot right it is the one in your screen shot also which is mentioned as (This). If this is a default group then you will not get agents for that refer the below link on how to pull agent list of the Target
group
http://msdn.microsoft.com/en-us/library/bb960484.aspx?cs-save-lang=1&cs-lang=vb#code-snippet-1
Or look at this. You can see what groups the agents are associated manually one by one by using the default SCOM Task.
Go to Administration==> Agent managed==> Select the agent ==> Right click it and click View ==> Select state view.
Once you select this you will have another window opened for that particular agent.
Then click on the name of the agent and on the right hand side bottom you will have a default made task to check to what group's or Targets this agent is associated to. Run that task and you will get the output.
Look at the ones highlighted in RED
Below is the screenshot for your reference. Hope this helps
Gautam.75801 -
MS SQL query to get Subscription list from Operations Manager
Hi Experts,
Is there anyway get Subscription list from Operations Manager DB using SQL query? I lost subscription list, and need to create subscription as it was. Very urgent.
Thanks in advance.
Regards
Karthick MHi,
Hope the powershell command Get-SCOMNotificationSubscription can be helpful for you:
Get-SCOMNotificationSubscription
Retrieves a list of notification subscriptions.
https://technet.microsoft.com/en-us/library/hh918490(v=sc.20).aspx
Regards,
Yan Li
Please remember to mark the replies as answers if they help and unmark them if they provide no help. If you have feedback for TechNet Subscriber Support, contact [email protected] -
SQL query to get the without SCCM agent for a Server
Hello every one,
Can I get the SQL query for a server without a SCCM agent .Here you go!!
Add the version for windows 2012 server if you have them as well in your environment
v_R_System.Netbios_Name0
,v_R_System.Full_Domain_Name0
,v_R_System.User_Name0
,case
When v_R_System.Operating_System_Name_and0 LIKE N'%Server 6.1'THEN 'Windows Server 2008 R2'
When v_R_System.Operating_System_Name_and0 LIKE N'%Server 6.0'THEN 'Windows Server 2008'
When v_R_System.Operating_System_Name_and0 LIKE N'%Server 5.2'THEN 'Windows Server 2003 R2'
ELSE 'Unknown Version' END AS 'OS version'
FROM
v_R_System
WHERE
v_R_System.Operating_System_Name_and0 LIKE N'%server%' and v_R_System.Client0 is null
Kindly mark as answer/Vote as helpful if a reply from anybody helped you in this forum. Delphin -
Query to get the List of Reports on a Universe
Hi All,
I want to write a query to get all the Web I and Crystal Reports that access a particular universe.
Can anyone suggest me where to start.
This is in BO 3.1 against Oracle databse.There are a few ways to do this:
- The easiest would be to use a Relationship Query from the CMC. To do this, go to the Universes section on the CMC, right click on the relevant universe, select tools >> Check Relationships.
- Use Query Builder. You will need more than one query to pull the information you need. You could try something like the below (for Webi)
SELECT SI_NAME, SI_WEBI, SI_DATACONNECTION FROM CI_APPOBJECTS
WHERE SI_KIND = 'universe' and SI_NAME = 'Universe Name'
This will give you a list of Webi Reports by SI_ID.
You'll need another query to list Webi report names:
SELECT SI_NAME FROM CI_INFOOBJECTS WHERE SI_ID IN (SI_ID from query above)
- This is trivial via Auditing / the Activity universe. This of course will only return reports that have already run.
Best.
Srinivas -
SQL Query to get the desired result
Can someone give the SQL to get this output.
input is like this in table.
cola colb fromdate todate
1 100 1/5/2010 1/9/2010
1 101 1/10/2010 1/25/2010
1 102 1/26/2010 12/31/2900
2 201 3/1/2011 3/10/2011
2 202 3/11/2011 12/31/2900
3 301 1/5/2010 1/9/2010
3 302 1/10/2010 1/25/2010
3 303 1/26/2010 1/28/2010
3 304 1/29/2010 12/31/2900
I want to get the output like this.
cola colb fromdate todate
1 100 1/5/2010 1/9/2010
2 201 3/1/2011 3/10/2011
3 301 1/5/2010 1/9/2010
More info:
I want to get the rows where fromdate is the min(fromdate) from each cola's unique values i.e. 1,2,3
Please let me know the SQL.
Thanks.
[email protected]This way!!!
with data(cola, colb, st_dt, ed_dt) as
select 1, 100, to_date('01/05/2010', 'MM/DD/YYYY'), to_date('01/09/2010', 'MM/DD/YYYY') from dual union all
select 1, 101, to_date('01/10/2010', 'MM/DD/YYYY'), to_date('01/25/2010', 'MM/DD/YYYY') from dual union all
select 1, 102, to_date('01/26/2010', 'MM/DD/YYYY'), to_date('12/31/2900', 'MM/DD/YYYY') from dual union all
select 2, 201, to_date('03/01/2011', 'MM/DD/YYYY'), to_date('03/10/2011', 'MM/DD/YYYY') from dual union all
select 2, 202, to_date('03/11/2011', 'MM/DD/YYYY'), to_date('12/31/2900', 'MM/DD/YYYY') from dual union all
select 3, 301, to_date('01/05/2010', 'MM/DD/YYYY'), to_date('01/09/2010', 'MM/DD/YYYY') from dual union all
select 3, 302, to_date('01/10/2010', 'MM/DD/YYYY'), to_date('01/25/2010', 'MM/DD/YYYY') from dual union all
select 3, 303, to_date('01/26/2010', 'MM/DD/YYYY'), to_date('01/28/2010', 'MM/DD/YYYY') from dual union all
select 3, 304, to_date('01/29/2010', 'MM/DD/YYYY'), to_date('12/31/2900', 'MM/DD/YYYY') from dual
select cola, colb, st_dt, ed_dt
from (
select cola, colb, st_dt, ed_dt,
row_number() over (partition by cola order by st_dt) rn
from data
) a
where a.rn = 1;
COLA COLB ST_DT ED_DT
1 100 05-JAN-10 09-JAN-10
2 201 01-MAR-11 10-MAR-11
3 301 05-JAN-10 09-JAN-10 -
SQL query to get the responsibility name
Hi,
I require an SQL query which would give the responsibilty name to which the concurrent programs are assigned.
Thanks& Regards,SELECT fcpv.user_concurrent_program_name
FROM fnd_request_groups frg,
fnd_request_group_units frgu,
fnd_concurrent_programs_vl fcpv,
fnd_responsibility_vl frv
WHERE frgu.request_group_id = frg.request_group_id
AND frgu.request_unit_id = fcpv.concurrent_program_id
AND frv.request_group_id = frg.request_group_id
AND frgu.request_unit_type = 'P'
AND frv.responsibility_name =<Responsibility Name>Regards
Prashant Pathak -
Need SQL query to get the result.
Region
Month
Trx Type
Resolution Summary
AMERICAS
May-13
Adjustments
Correct
EMEA
May-13
Adjustments
Incorrect
AMERICAS
May-13
Credit Memo
Incorrect
EMEA
May-13
Invoice
Correct
AMERICAS
May-13
Credit Memo
Correct
OFD
May-13
Adjustments
Correct
AMERICAS
May-13
Invoice
Incorrect
LAD
May-13
Adjustments
Correct
LAD
May-13
Adjustments
Correct
OFD
May-13
Adjustments
Correct
Above is my Table and find below the required result.Similarly for other regions as well. Can anyone help me with the SQL Query?
Region
Resolution Summary
Adjustment
Credit Memo
Invoice
Grand Total
AMERICAS
Correct
1
1
2
Incorrect
0
1
1
2Like this?
SQL> select * from transaction_audit;
REGION MTH TRX_TYPE RESOLUTIO
AMERICAS may-13 ADJUSTMENTS CORRECT
EMEA may-13 ADJUSTMENTS INCORRECT
AMERICAS may-13 CREDIT MEMO INCORRECT
EMEA may-13 INVOICE CORRECT
AMERICAS may-13 CREDIT MEMO CORRECT
OFD may-13 ADJUSTMENTS CORRECT
AMERICAS may-13 INVOICE INCORRECT
LAD may-13 ADJUSTMENTS CORRECT
LAD may-13 ADJUSTMENTS CORRECT
OFD may-13 ADJUSTMENTS CORRECT
10 rows selected.
SQL> select region
2 , resolution_summary
3 , count(decode(trx_type, 'ADJUSTMENTS', trx_type)) adjustments
4 , count(decode(trx_type, 'CREDIT MEMO', trx_type)) credit_memo
5 , count(decode(trx_type, 'INVOICE' , trx_type)) invoice
6 from transaction_audit
7 group
8 by region
9 , resolution_summary
10 order
11 by region
12 , resolution_summary
13 /
REGION RESOLUTIO ADJUSTMENTS CREDIT_MEMO INVOICE
AMERICAS CORRECT 1 1 0
AMERICAS INCORRECT 0 1 1
EMEA CORRECT 0 0 1
EMEA INCORRECT 1 0 0
LAD CORRECT 2 0 0
OFD CORRECT 2 0 0
6 rows selected.
SQL> -
SQL query to get the current session info
I've a query in my application to view the all the sessions within database
select
substr(a.spid,1,9) pid,
substr(b.sid,1,5) sid,
substr(b.serial#,1,5) ser#,
substr(b.machine,1,6) box,
substr(b.username,1,10) username,
-- b.server,
substr(b.osuser,1,8) os_user,
substr(b.program,1,30) program
from
v$session b,
v$process a
where
b.paddr = a.addr
and type='USER'
order by spid;
Can someone help me with a query to view the info of the session where I'm in currently?
Thanks,
Gabriel Stephen.here's one way to do it.
select
substr(a.spid,1,9) pid,
substr(b.sid,1,5) sid,
substr(b.serial#,1,5) ser#,
substr(b.machine,1,6) box,
substr(b.username,1,10) username,
-- b.server,
substr(b.osuser,1,8) os_user,
substr(b.program,1,30) program
from
v$session b,
v$process a
where
b.paddr = a.addr
and type='USER'
and b.sid=(select sid from v$mystat where rownum=1)
order by spid-------------
Anwar -
I have a database table where it keeps record of the transaction when it starts at StartTime and when it ends at EndTime. Both these entries are having the timestamp entries. Say for example, I have a tuple with Entries like 'Transaction A' starts at '2014-05-07
20:55:03.170' and ends at '2014-05-08 08:56:03.170'. I need to find the difference between these two timestamps and my expected output is 12:01:00.000. Let me know how to achieve this ?Hi,
You can use below script which calculates difference as DD:HH:MM:SS. You can modify the same:
DECLARE @startTime DATETIME
DECLARE @endTime DATETIME
SET @startTime = '2013-11-05 12:20:35'
SET @endTime = '2013-11-10 01:22:30'
SELECT [DD:HH:MM:SS] =
CAST((DATEDIFF(HOUR, @startTime, @endTime) / 24) AS VARCHAR)
+ ':' +
CAST((DATEDIFF(HOUR, @startTime, @endTime) % 24) AS VARCHAR)
+ ':' +
CASE WHEN DATEPART(SECOND, @endTime) >= DATEPART(SECOND, @startTime)
THEN CAST((DATEDIFF(MINUTE, @startTime, @endTime) % 60) AS VARCHAR)
ELSE
CAST((DATEDIFF(MINUTE, DATEADD(MINUTE, -1, @endTime), @endTime) % 60)
AS VARCHAR)
END
+ ':' + CAST((DATEDIFF(SECOND, @startTime, @endTime) % 60) AS VARCHAR),
[StringFormat] =
CAST((DATEDIFF(HOUR , @startTime, @endTime) / 24) AS VARCHAR) +
' Days ' +
CAST((DATEDIFF(HOUR , @startTime, @endTime) % 24) AS VARCHAR) +
' Hours ' +
CASE WHEN DATEPART(SECOND, @endTime) >= DATEPART(SECOND, @startTime)
THEN CAST((DATEDIFF(MINUTE, @startTime, @endTime) % 60) AS VARCHAR)
ELSE
CAST((DATEDIFF(MINUTE, DATEADD(MINUTE, -1, @endTime), @endTime) % 60)
AS VARCHAR)
END +
' Minutes ' +
CAST((DATEDIFF(SECOND, @startTime, @endTime) % 60) AS VARCHAR) +
' Seconds '
Reference:
http://sqlandme.com/2013/12/23/sql-server-calculating-elapsed-time-from-datetime/
- Vishal
SqlAndMe.com
Maybe you are looking for
-
How can I delete the Photostream folder in iOS?
So yeah hi everyone! I guess the title says it. I'd like to delete the Photostream folder in iOS from my "Photos" App? I've already tried: to reset Photostream on icloud.com. turn off Photostream on my iOS Device. deleting the iCloud Account from my
-
Flex 2 Beginners - A must see website for good examples of components, samples created by Shigeru Nakagaki. http://shigeru-nakagaki.com/index.cfm?Content=Flex2Samples Thanks to Shigeru Regards, Arthur
-
IPod Nano manually manage songs - please help
I've set iPod to manually manage as I have music on home computer and have purchased music on the office computer since we have DSL. I have tried to drag each purchased song from Library to my iPod in the source list but they never show up once I dis
-
How can I exit and save my open tags at the same time?
If I am exiting Firefox, the next time I open it I would like to see the same tags I was working on there. Why I only get the Home page?
-
How to make message IW 703 as error in T-Code: IW31.
Hi All, In SAP R/3 PM, during the Work Oder creation in T-Code: IW31, we are getting the Message "IW 703 - Work Centre -- Locked in Plant -- " as WARNING. This happens whenever we use a locked Work Centre. But further it allows us to create the order