Sorting on two reports based on same table
Hi,
I have two reports on the same page, that show rows from a table.
Each table has a different condition, so that there is no overlapping rows.
The problem i have run into, is that i have enabled sort on the columns in both reports - there are instances when there are no rows shown in one of the reports.
when i click on a column name to sort on that column, i get the error
failed to parse SQL query:
ORA-06502: PL/SQL: numeric or value error: NULL index table key value
in the report that shows no values. i understand what the error means, but am having some trouble finding a way of solving it.
any help would be much appreciated!
Look here:
Column sort gives "failed to parse SQL query"
Denes Kubicek
Similar Messages
-
Regarding locks in SAP ( concurrent access by two reports for a same table)
Hi All,
I have a problem regarding locks. I have designed a report using lock function modules to set locks and release them after the database operations and it works perfectly. There is another report which also does some DB operation on the same table but there are no table locks using enqueue function module implemented in this report and despite of lock set by first report on the table it is able to do the changes on the db table. I need to know how to overcome this problem.
Thanks for your solutions.
Regards,
SachinSachin Dangayach wrote:
Hi All,
>
> I have a problem regarding locks. I have designed a report using lock function modules to set locks and release them after the database operations and it works perfectly. There is another report which also does some DB operation on the same table but there are no table locks using enqueue function module implemented in this report and despite of lock set by first report on the table it is able to do the changes on the db table. I need to know how to overcome this problem.
> Thanks for your solutions.
>
> Regards,
> Sachin
lock procedure requires that all programs involved cooperate. Inconsistencies can occur if a program reads or changes data without having previously locked it. When a lock is set, the data records are only protected against changes by another program if this program also requests a lock before accessing the data.
Please check the above extract from [SAP help|http://help.sap.com/saphelp_nw04/helpdata/en/cf/21eed9446011d189700000e8322d00/frameset.htm], to maintain data consistency, it must be ensured that all the programs should lock the data before changing.
-Rajesh. -
Compare two rows in a same table
Dear all
I need to compare two rows in the same table, I dont know hoe to do it in pl/sql. Some one please help me on this.
example:
tr br price
xya0001 ama7 12
xya0003 ama6 14
xya0004 ama7 16
in the table tr is a unique value for each row, I need to compare price column and see whether the first value is less or greater than the next value and, if it is greater put the corresponding br value to a variable and if it is smaller put the corresponding br value to another variable. I dont know a method to do it, as I'm new to pl/sql. Some one please help me in thisnot sure what you intend to do as you have mentioned that "TR" is unique and you just want to compare each record with just the next record. Hope below query helps. The value "G" or "L" in flag would indicate if the current records price is greater than or less than the price in next record.
select tr,br,price,col4, case when price> col4 then 'G' when price< col4 then 'L' end flag from (
select tr,br,price,lag(price,1,0) over(order by tr) col4 from testcomp
) -
SUM two ROWS in the SAME Table
Hi,
I have a problem with this issue. I want to sum two rows from the same table, but I don´t know how to do that. I tried to do it with CTE, but always I get the same error "Ambiguous". I would like to ask you, if there is other manner to get that
data (sum two rows) and if it is possible to see examples about it.
Thank you in advanceHi Vaibhav,
I leave you my scrip:
USE Modelling
GO
--TABLE Aer_Lingus_Income_Statement
IF OBJECT_ID('Aer_Lingus_Income_Statement') IS NOT NULL
DROP TABLE Aer_Lingus_Income_Statement
GO
CREATE TABLE Aer_Lingus_Income_Statement
ID [nvarchar](255) NOT NULL,
Name_Account [nvarchar](255) NULL,
Company [nvarchar](255) NULL,
Level0_Account [nvarchar](255) NULL,
Level1_Account [nvarchar](255) NULL,
Level2_Account [nvarchar](255) NULL,
Level3_Account [nvarchar](255) NULL,
Level4_Account [nvarchar](255) NULL,
Level5_Account [nvarchar](255) NULL,
Level6_Account [nvarchar](255) NULL,
Level7_Account [nvarchar](255) NULL,
Level8_Account [nvarchar](255) NULL,
Year_2006 decimal (15,2) null,
Year_2007 decimal (15,2) null,
Year_2008 decimal (15,2) null,
Year_2009 decimal (15,2) null,
Year_2010 decimal (15,2) null,
Year_2011 decimal (15,2) null,
Year_2012 decimal (15,2) null,
Year_2013 decimal (15,2) null,
GO
ALTER TABLE Aer_Lingus_Income_Statement
ADD CONSTRAINT PK_Aer_Lingus_Income_Statement PRIMARY KEY (ID)
GO
INSERT INTO Aer_Lingus_Income_Statement
SELECT *
FROM Aer_Lingus_data_Income
IF OBJECT_ID('Aer_Lingus_Income_Statement_Historic') IS NOT NULL
DROP VIEW Aer_Lingus_Income_Statement_Historic
GO
CREATE VIEW Aer_Lingus_Income_Statement_Historic
as
Select Level0_Account , sum(Year_2006) as Y2006, sum (Year_2007) as Y2007, sum (Year_2008) as Y2008, sum (Year_2009) as Y2009, sum (Year_2010) as Y2010,
sum (Year_2011) as Y2011, sum (Year_2012) as Y2012, sum (Year_2013) as Y2013
FROM Aer_Lingus_data_Income
Where Level0_Account ='Revenue'
Group by Level0_Account
UNION ALL
Select Name_Account , sum(Year_2006) as Y2006, sum (Year_2007) as Y2007, sum (Year_2008) as Y2008, sum (Year_2009) as Y2009, sum (Year_2010) as Y2010,
sum (Year_2011) as Y2011, sum (Year_2012) as Y2012, sum (Year_2013) as Y2013
FROM Aer_Lingus_data_Income
Where Name_Account= 'Passenger revenue' and Level0_Account ='Revenue'
Group by Name_Account
UNION ALL
Select Name_Account , sum(Year_2006) as Y2006, sum (Year_2007) as Y2007, sum (Year_2008) as Y2008, sum (Year_2009) as Y2009, sum (Year_2010) as Y2010,
sum (Year_2011) as Y2011, sum (Year_2012) as Y2012, sum (Year_2013) as Y2013
FROM Aer_Lingus_data_Income
Where Name_Account= 'Ancillary revenue' and Level0_Account ='Revenue'
Group by Name_Account
UNION ALL
Select Name_Account , sum(Year_2006) as Y2006, sum (Year_2007) as Y2007, sum (Year_2008) as Y2008, sum (Year_2009) as Y2009, sum (Year_2010) as Y2010,
sum (Year_2011) as Y2011, sum (Year_2012) as Y2012, sum (Year_2013) as Y2013
FROM Aer_Lingus_data_Income
Where Name_Account= 'Other revenue' and Level0_Account ='Revenue'
Group by Name_Account
UNION ALL
Select Name_Account , sum(Year_2006) as Y2006, sum (Year_2007) as Y2007, sum (Year_2008) as Y2008, sum (Year_2009) as Y2009, sum (Year_2010) as Y2010,
sum (Year_2011) as Y2011, sum (Year_2012) as Y2012, sum (Year_2013) as Y2013
FROM Aer_Lingus_data_Income
Where Name_Account= 'Cargo revenue' and Level0_Account ='Revenue'
Group by Name_Account
UNION ALL
Select Level0_Account , sum(Year_2006) as Y2006, sum (Year_2007) as Y2007, sum (Year_2008) as Y2008, sum (Year_2009) as Y2009, sum (Year_2010) as Y2010,
sum (Year_2011) as Y2011, sum (Year_2012) as Y2012, sum (Year_2013) as Y2013
FROM Aer_Lingus_data_Income
Where Level0_Account ='Operating expenses'
Group by Level0_Account
UNION ALL
Select Level1_Account , sum(Year_2006) as Y2006, sum (Year_2007) as Y2007, sum (Year_2008) as Y2008, sum (Year_2009) as Y2009, sum (Year_2010) as Y2010,
sum (Year_2011) as Y2011, sum (Year_2012) as Y2012, sum (Year_2013) as Y2013
FROM Aer_Lingus_data_Income
Where Level1_Account ='Staff costs' and Level0_Account ='Operating expenses'
Group by Level1_Account
UNION ALL
Select Level1_Account , sum(Year_2006) as Y2006, sum (Year_2007) as Y2007, sum (Year_2008) as Y2008, sum (Year_2009) as Y2009, sum (Year_2010) as Y2010,
sum (Year_2011) as Y2011, sum (Year_2012) as Y2012, sum (Year_2013) as Y2013
FROM Aer_Lingus_data_Income
Where Level1_Account ='Depreciation, amortisation and impairment' and Level0_Account ='Operating expenses'
Group by Level1_Account
UNION ALL
Select Name_Account , sum(Year_2006) as Y2006, sum (Year_2007) as Y2007, sum (Year_2008) as Y2008, sum (Year_2009) as Y2009, sum (Year_2010) as Y2010,
sum (Year_2011) as Y2011, sum (Year_2012) as Y2012, sum (Year_2013) as Y2013
FROM Aer_Lingus_data_Income
Where Name_Account ='Aircraft operating lease costs' and Level0_Account ='Operating expenses'
Group by Name_Account
UNION ALL
Select Name_Account , sum(Year_2006) as Y2006, sum (Year_2007) as Y2007, sum (Year_2008) as Y2008, sum (Year_2009) as Y2009, sum (Year_2010) as Y2010,
sum (Year_2011) as Y2011, sum (Year_2012) as Y2012, sum (Year_2013) as Y2013
FROM Aer_Lingus_data_Income
Where Name_Account ='Fuel and oil costs' and Level0_Account ='Operating expenses'
Group by Name_Account
UNION ALL
Select Name_Account , sum(Year_2006) as Y2006, sum (Year_2007) as Y2007, sum (Year_2008) as Y2008, sum (Year_2009) as Y2009, sum (Year_2010) as Y2010,
sum (Year_2011) as Y2011, sum (Year_2012) as Y2012, sum (Year_2013) as Y2013
FROM Aer_Lingus_data_Income
Where Name_Account ='Maintenance expenses' and Level0_Account ='Operating expenses'
Group by Name_Account
UNION ALL
Select Name_Account , sum(Year_2006) as Y2006, sum (Year_2007) as Y2007, sum (Year_2008) as Y2008, sum (Year_2009) as Y2009, sum (Year_2010) as Y2010,
sum (Year_2011) as Y2011, sum (Year_2012) as Y2012, sum (Year_2013) as Y2013
FROM Aer_Lingus_data_Income
Where Name_Account ='Airport charges' and Level0_Account ='Operating expenses'
Group by Name_Account
UNION ALL
Select Name_Account , sum(Year_2006) as Y2006, sum (Year_2007) as Y2007, sum (Year_2008) as Y2008, sum (Year_2009) as Y2009, sum (Year_2010) as Y2010,
sum (Year_2011) as Y2011, sum (Year_2012) as Y2012, sum (Year_2013) as Y2013
FROM Aer_Lingus_data_Income
Where Name_Account ='En-route charges' and Level0_Account ='Operating expenses'
Group by Name_Account
UNION ALL
Select Name_Account , sum(Year_2006) as Y2006, sum (Year_2007) as Y2007, sum (Year_2008) as Y2008, sum (Year_2009) as Y2009, sum (Year_2010) as Y2010,
sum (Year_2011) as Y2011, sum (Year_2012) as Y2012, sum (Year_2013) as Y2013
FROM Aer_Lingus_data_Income
Where Name_Account ='Distribution costs' and Level0_Account ='Operating expenses'
Group by Name_Account
UNION ALL
Select Name_Account , sum(Year_2006) as Y2006, sum (Year_2007) as Y2007, sum (Year_2008) as Y2008, sum (Year_2009) as Y2009, sum (Year_2010) as Y2010,
sum (Year_2011) as Y2011, sum (Year_2012) as Y2012, sum (Year_2013) as Y2013
FROM Aer_Lingus_data_Income
Where Name_Account ='Ground operations, catering and other operating costs' and Level0_Account ='Operating expenses'
Group by Name_Account
UNION ALL
Select Level1_Account , sum(Year_2006) as Y2006, sum (Year_2007) as Y2007, sum (Year_2008) as Y2008, sum (Year_2009) as Y2009, sum (Year_2010) as Y2010,
sum (Year_2011) as Y2011, sum (Year_2012) as Y2012, sum (Year_2013) as Y2013
FROM Aer_Lingus_data_Income
Where Level1_Account ='Other (gains)/losses - net' and Level0_Account ='Operating expenses'
Group by Level1_Account
UNION ALL
Select Name_Account , sum(Year_2006) as Y2006, sum (Year_2007) as Y2007, sum (Year_2008) as Y2008, sum (Year_2009) as Y2009, sum (Year_2010) as Y2010,
sum (Year_2011) as Y2011, sum (Year_2012) as Y2012, sum (Year_2013) as Y2013
FROM Aer_Lingus_data_Income
Where Name_Account ='Employee profit share' and Level0_Account ='Operating expenses'
Group by Name_Account
GO
WITH sumasRevenue
AS (
SELECT Name_Account, ID
, sum(Year_2006) AS Y2006, sum (Year_2007) as Y2007, sum (Year_2008) as Y2008, sum (Year_2009) as Y2009, sum (Year_2010) as Y2010,
sum (Year_2011) as Y2011, sum (Year_2012) as Y2012, sum (Year_2013) as Y2013
FROM Aer_Lingus_data_Income
WHERE Level0_Account = 'Revenue'
GROUP BY Name_Account, ID
WITH ROLLUP
, total
AS (
SELECT Y2006,Y2007 ,Y2008,Y2009 ,Y2010 ,Y2011 ,Y2012 ,Y2013
FROM sumasRevenue
WHERE Name_Account IS NULL
sumasOperatingExpensive
AS (
SELECT Name_Account, ID
, sum(Year_2006) AS Y2006, sum (Year_2007) as Y2007, sum (Year_2008) as Y2008, sum (Year_2009) as Y2009, sum (Year_2010) as Y2010,
sum (Year_2011) as Y2011, sum (Year_2012) as Y2012, sum (Year_2013) as Y2013
FROM Aer_Lingus_data_Income
WHERE Level0_Account = 'Operating expenses'
GROUP BY Name_Account, ID
WITH ROLLUP
, total1
AS (
SELECT Y2006,Y2007 ,Y2008,Y2009 ,Y2010 ,Y2011 ,Y2012 ,Y2013
FROM sumasOperatingExpensive
WHERE Name_Account IS NULL
SELECT distinct ID , s.Name_Account,
(s.Y2006* 1.0 - t.Y2006) AS [V2006] ,(s.Y2007* 1.0 -T.Y2007 ) as [V2007] , (s.Y2008* 1.0 /T.Y2008 ) as [V2008],(s.Y2009* 1.0 /T.Y2009 ) as [V2009],
(s.Y2010* 1.0 /T.Y2010 ) as [V2010],(s.Y2011* 1.0 /T.Y2011 ) as [V2011],(s.Y2012* 1.0 /T.Y2012 ) as [V2012],(s.Y2013* 1.0 /T.Y2013 ) as [V2013]
FROM sumasRevenue AS s , sumasOperatingExpensive AS t
Where ID IS NOT NULL
UNION ALL
SELECT distinct ID,COALESCE(s.Name_Account,'NON CURRENT ASSETS') AS Name_Account ,
sum (s.Y2006* 1.0 / t.Y2006) as V2006,sum (s.Y2007* 1.0 / t.Y2007) as V2007,sum (s.Y2008* 1.0/ t.Y2008) as V2008,sum (s.Y2009* 1.0/ t.Y2009) as V2009,sum (s.Y2010* 1.0/ t.Y2010) as V2010,
sum (s.Y2011* 1.0 / t.Y2011) as V2011,sum (s.Y2012* 1.0/ t.Y2012) as V2012,sum (s.Y2013* 1.0/ t.Y2013) as V2013
FROM sumasRevenue as s , sumasOperatingExpensive as t
Where ID IS NULL and Name_Account IS NULL
GROUP BY Name_Account, ID
WITH ROLLUP
select *
from Aer_Lingus_Income_Statement_Historic
Thank you in advance -
Two triggers in the same table and event
If I created two triggers on the same table and event (before insert), which of them will be triggered first ?...
The problem from the beginning is that I created the second one as after insert and in the body of the trigger I wrote (:new.xxx:= value) ... then an error (that it should be before insert trigger or update trigger), so I created it as before update ,,, but I have already before update trigger (for primary key)..... and the problem -I think- which of them start first...
Can make the second one as after insert and make update statement instead of assigning (:new.xxx:= value).....
RegardsIf I created two triggers on the same table and event
(before insert), which of them will be triggered
first ?...As already mentioned, prior to 11g the order of firing is undetermined.
The problem from the beginning is that I created the
second one as after insert and in the body of the
trigger I wrote (:new.xxx:= value) ... then an error
(that it should be before insert trigger or update
trigger), so I created it as before update ,,, but I
have already before update trigger (for primary
key)..... and the problem -I think- which of them
start first...If there is a conflict of interest inside the code then you will have to alter your design principle around this to cater for it. Also consider combining the code into a single before insert trigger to prevent any confusion.
Can make the second one as after insert and make
update statement instead of assigning (:new.xxx:=
value).....Attempting to update or query the same table as is causing the trigger to fire will result in a mutating table error. You can't do this. -
Compare two results from the same table
i have two results from the same table that i would like to compare. below is my query and the results i want to compare
SELECT tblItemRoutingBOM.ItemRevID, tblItem.ItemID, tblItem.PartNum, tblItem.ItemName, tblItem.ManufacturerPartNum AS [Mfg Part#], tblItemRoutingBOM.Quantity
FROM tblItemRouting
INNER JOIN tblItemRoutingBOM ON tblItemRouting.ItemRoutingID = tblItemRoutingBOM.ItemRoutingID
INNER JOIN tblItem ON tblItemRoutingBOM.ItemID = tblItem.ItemID
WHERE tblItemRoutingBOM.ItemRevID in (61,70)
as you can see i am returning two records using the where clause
ItemRevID, ItemID, PartNum, ItemName, Manufacturer, Mfg Part#, Quantity
61,121,331503,.233 Aluminum Sheet,,1
70,121,331503,.233 Aluminum Sheet,,3
now what i am looking for is to combine these two together into one row with the following added. two columns for each QTY, QTY1 = 1 and QTY2 = 3 with a third column added that is the difference between the two QTY Diff = 2
Any thoughts?Here are the two statements that i want to combine, results for each are attached
SELECT tblItem.ItemID, Sum(tblItemRoutingBOM.Quantity) AS SumOfQuantity, tblItem.PartNum AS [Part #],
tblItem.ItemName, tblManufacturer.ManufacturerName AS Manufacturer, tblItem.ManufacturerPartNum AS [Mfg Part#]
FROM tblItemRouting
INNER JOIN tblItemRoutingBOM ON tblItemRouting.ItemRoutingID = tblItemRoutingBOM.ItemRoutingID
INNER JOIN tblItem ON tblItemRoutingBOM.ItemID = tblItem.ItemID
INNER JOIN tblUnits ON tblItem.UnitID = tblUnits.UnitID
LEFT JOIN tblManufacturer ON tblItem.ManufacturerID = tblManufacturer.ManufacturerID
WHERE tblItemRoutingBOM.ItemRevID=61
GROUP BY tblItem.ItemID,tblItem.PartNum,tblItem.ItemName,tblManufacturer.ManufacturerName,tblItem.ManufacturerPartNum
SELECT tblItem.ItemID, Sum(tblItemRoutingBOM.Quantity) AS Quantity, tblItem.PartNum AS [Part #],
tblItem.ItemName, tblManufacturer.ManufacturerName AS Manufacturer, tblItem.ManufacturerPartNum AS [Mfg Part#]
FROM tblItemRouting
INNER JOIN tblItemRoutingBOM ON tblItemRouting.ItemRoutingID = tblItemRoutingBOM.ItemRoutingID
INNER JOIN tblItem ON tblItemRoutingBOM.ItemID = tblItem.ItemID
INNER JOIN tblUnits ON tblItem.UnitID = tblUnits.UnitID
LEFT JOIN tblManufacturer ON tblItem.ManufacturerID = tblManufacturer.ManufacturerID
WHERE tblItemRoutingBOM.ItemRevID=70
GROUP BY tblItem.ItemID,tblItem.PartNum,tblItem.ItemName,tblManufacturer.ManufacturerName,tblItem.ManufacturerPartNum
114,11,55002,Pepsi Blue Cap,NULL,
117,5,331501,Marigold Yellow For ABS,NULL,
121,1,331503,.233 Aluminum Sheet,NULL,
125,2,331504,Velvet Vinyl .008,NULL,
114,33,55002,Pepsi Blue Cap,NULL,
117,15,331501,Marigold Yellow For ABS,NULL,
121,3,331503,.233 Aluminum Sheet,NULL,
125,6,331504,Velvet Vinyl .008,NULL,
my returned result should combine above with two extra columns (two extra columns because i have two results to combine)
114, 11, 33, 22, 55002, Pepsi Blue Cap, NULL,
117, 5, 15, 10, 331501, Marigold Yellow For ABS, NULL
121,1, 3, 2, 331503, .233 Aluminum Sheet, NULL
125, 2, 6, 4, 331504, Velvet Vinyl .008, NULL
Columns go as such, ID, QTY1 (for 61), QTY2 (for 70), Diff (QTY1-QTY2), PartNum, ItemName, Mfg, Mfg Part#
IF the results from one of those two are empty then i would see something like this
114, 11, 0, 11, 55002, Pepsi Blue Cap, NULL,
117, 5, 0, 5, 331501, Marigold Yellow For ABS, NULL
121,1, 0, 1, 331503, .233 Aluminum Sheet, NULL
125, 2, 0, 2, 331504, Velvet Vinyl .008, NULL -
How to biod Crystal Reports based on ABAP Tables/Views
Hi,
Can any one post me some document stuff on building Crystal reports based on ABAP Tables/Views please!
Thanks,
Madhu.Hi,
Check out the links below for Crystal Reports :
Re: Crystal report in SAP BW
http://support.businessobjects.com/documentation/product_guides/
http://help.sap.com/saphelp_nw04/helpdata/en/86/06a8d3be17fc47aa8d850e50cf5f24/frameset.htm
http://help.sap.com/saphelp_nw04/helpdata/en/46/dfd33b1ed4b47de10000000a114084/frameset.htm
http://help.sap.com/saphelp_nw04/helpdata/en/34/c0523e83464644e10000000a114084/frameset.htm
http://help.sap.com/saphelp_nw04/helpdata/en/0d/5f72b7c0e943d99f4f5cef2bfacfe1/frameset.htm
http://help.sap.com/saphelp_nw04/helpdata/en/06/00a63b60f26e3be10000000a114084/frameset.htm
Hope this helps.
Cheers,
Kedar -
Possible solution to avoid deadlock when two inserts happen on same table from two different machines.
Below are the details from deadlock trace.
Deadlock encountered .... Printing deadlock information
Wait-for graph
NULL
Node:1
KEY: 8:72057594811318272 (ffffffffffff) CleanCnt:3 Mode:RangeS-S Flags: 0x1
Grant List 2:
Owner:0x00000013F494A980 Mode: RangeS-S Flg:0x40 Ref:0 Life:02000000 SPID:376 ECID:0 XactLockInfo: 0x000000055014F400
SPID: 376 ECID: 0 Statement Type: INSERT Line #: 70
Input Buf: RPC Event: Proc [Database Id = 8 Object Id = 89923542]
Requested by:
ResType:LockOwner Stype:'OR'Xdes:0x0000002AA53383B0 Mode: RangeI-N SPID:238 BatchID:0 ECID:0 TaskProxy:(0x00000027669B4538) Value:0x10d8d500 Cost:(0/38828)
NULL
Node:2
KEY: 8:72057594811318272 (ffffffffffff) CleanCnt:3 Mode:RangeS-S Flags: 0x1
Grant List 2:
Owner:0x0000000B3486A780 Mode: RangeS-S Flg:0x40 Ref:0 Life:02000000 SPID:238 ECID:0 XactLockInfo: 0x0000002AA53383F0
SPID: 238 ECID: 0 Statement Type: INSERT Line #: 70
Input Buf: RPC Event: Proc [Database Id = 8 Object Id = 89923542]
Requested by:
ResType:LockOwner Stype:'OR'Xdes:0x000000055014F3C0 Mode: RangeI-N SPID:376 BatchID:0 ECID:0 TaskProxy:(0x000000080426E538) Value:0x30614e80 Cost:(0/41748)
NULL
Victim Resource Owner:
ResType:LockOwner Stype:'OR'Xdes:0x0000002AA53383B0 Mode: RangeI-N SPID:238 BatchID:0 ECID:0 TaskProxy:(0x00000027669B4538) Value:0x10d8d500 Cost:(0/38828)
deadlock-list
deadlock victim=process5daddc8
process-list
process id=process5daddc8 taskpriority=0 logused=38828 waitresource=KEY: 8:72057594811318272 (ffffffffffff) waittime=2444 ownerId=2994026815 transactionname=user_transaction lasttranstarted=2014-07-25T12:46:57.347 XDES=0x2aa53383b0 lockMode=RangeI-N schedulerid=43 kpid=14156 status=suspended spid=238 sbid=0 ecid=0 priority=0 trancount=2 lastbatchstarted=2014-07-25T12:46:57.463 lastbatchcompleted=2014-07-25T12:46:57.463 clientapp=pa hostname=pa02 hostpid=1596 loginname=myuser isolationlevel=serializable (4) xactid=2994026815 currentdb=8 lockTimeout=4294967295 clientoption1=671088672 clientoption2=128056
executionStack
frame procname=mydb.dbo.SaveBill line=70 stmtstart=6148 stmtend=8060 sqlhandle=0x03000800d61f5c056bd3860170a300000100000000000000
INSERT INTO [dbo].[Prod1] .....
inputbuf
Proc [Database Id = 8 Object Id = 89923542]
process id=process5d84988 taskpriority=0 logused=41748 waitresource=KEY: 8:72057594811318272 (ffffffffffff) waittime=2444 ownerId=2994024748 transactionname=user_transaction lasttranstarted=2014-07-25T12:46:57.320 XDES=0x55014f3c0 lockMode=RangeI-N schedulerid=39 kpid=14292 status=suspended spid=376 sbid=0 ecid=0 priority=0 trancount=2 lastbatchstarted=2014-07-25T12:46:57.440 lastbatchcompleted=2014-07-25T12:46:57.440 clientapp=pa hostname=pa01 hostpid=1548 loginname=myuser isolationlevel=serializable (4) xactid=2994024748 currentdb=8 lockTimeout=4294967295 clientoption1=671088672 clientoption2=128056
executionStack
frame procname=pa.dbo.SaveBill line=70 stmtstart=6148 stmtend=8060 sqlhandle=0x03000800d61f5c056bd3860170a300000100000000000000
INSERT INTO [dbo].[Prod1]....
inputbuf
Proc [Database Id = 8 Object Id = 89923542]
resource-list
keylock hobtid=72057594811318272 dbid=8 objectname=pa.dbo.prod1 indexname=PK_a id=lock1608ee1380 mode=RangeS-S associatedObjectId=72057594811318272
owner-list
owner id=process5d84988 mode=RangeS-S
waiter-list
waiter id=process5daddc8 mode=RangeI-N requestType=convert
keylock hobtid=72057594811318272 dbid=8 objectname=pa.dbo.prod1 indexname=PK_a id=lock1608ee1380 mode=RangeS-S associatedObjectId=72057594811318272
owner-list
owner id=process5daddc8 mode=RangeS-S
waiter-list
waiter id=process5d84988 mode=RangeI-N requestType=convertDon't know. Perhaps these can help. I scanned the second link but didn't see much about Ending Deadlocks. I'd say the Fourth link probably has better information than the first three links. But maybe read them all just in case the Fourth is missing something
one of the first three have.
Deadlocking
Detecting and Ending Deadlocks
Minimizing Deadlocks
Handling Deadlocks in SQL Server
Google search for "SQL Deadlock"
La vida loca -
OBIEE report based on same criteria but different view based on filter
Hi,
I am trying to create a report in OBIEE 11.1.1.5 where In the same report using the same criteria, I can have different views which applies different filter.
Suppose, I have a report criteria as
Dim1, Dim2, Measure1, Measure 2.
I want to create two pivot view based on the same data.
One view will be showing data Dim1="Value1". The other view is duplicate of this view but will show data Dim1="Value2".
Is it possible in OBIEE?
basically what I want is work on the same dataset but different representation and show them in the same report. Please share your opinion.
Regards,
Tanveer.Hi,
You create a new dim dummy column in criteria and in presentation level create new pivot table view use this dummy dimension column and filter with dim1=value2.
give updates on this.
Mark if Helpful/correct.
Thanks. -
Split records into two files based on lookup table
Hi,
I'm new to ODI and want to know on how I could split records into two files based on a value in one of the columns in the table.
Example:
Table:
my columns are
account name country
100 USA
200 USA
300 UK
200 AUS
So from the 4 records I maintain list of countries in a lookup file and split the records into 2 different files based on values in the file...
Say I have records AUS and UK in my lookup file...
So my ODI routine should send all records with country into file1 and rest to file2.
So from above records
File1:
300 UK
200 AUS
File2:
100 USA
200 USA
Can you help me how to achieve this?
Thanks,
Sam1. where and how do i create filter to restrict countries? In source or target? Should I include some kind of filter operator in interface.
You need to have the Filter on the Source side so that we can filter records accordingly the capture the same in the File. To have a Filter . In the source data store click and drag the column outside the data store and you will have Cone shaped icon and now you can click and type the Filter.
Please look into this link for ODI Documentation -http://www.oracle.com/technetwork/middleware/data-integrator/documentation/index.html
Also look into this Getting started guide - http://download.oracle.com/docs/cd/E15985_01/doc.10136/getstart/GSETL.pdf . You can find information as how to create Filter in this guide.
2. If I have include multipe countries like (USA,CANADA,UK) to go to one file and rest to another file; Can I use some kind of lookup file...? Instead of modifying filter inside interface...Can i Update entries in the file?
there are two ways of handling your situation.
Solution 1.
1. Create Variable Country_Variable
2. Create a Filter in the Source datastore in the First Interface ( SOURCE.COLUMN = #Country_Variable)
3. Create a new Package Country File Unload
4. Call the Variable in Country_Variable in Set Mode and provide the Country (USA )
5. Next call the First Interface
6. Next call the Second Interface where the Filter condition will be ( SOURCE.COLUMN ! = #Country_Variable )
7. Now run the package .
Solution 2.
If you need a solution to handle through Filer.
1. Use this Method (http://odiexperts.com/how-to-refresh-odi-variables-from-file-%E2%80%93-part-1-%E2%80%93-just-one-value ) to call the File where you wish to create store the country name into the variable Country_Variable
2. Pretty much the same Create a Filter in the Source datastore in the First Interface ( SOURCE.COLUMN = #Country_Variable)
3.Create a new Package Country File Unload
4.Next call the Second Interface where the Filter condition will be ( SOURCE.COLUMN ! = #Country_Variable )
5. Now run the package .
Now through this way using File you can control the File.
Please try and let us know , if you need any other help. -
Persistence two beans in the same table, Duplicate table name in different beans
Hi,
I need to persist two beans belonging to different classes in the same
table, but the following mistake happens:
[jdo-enhance] javax.jdo.JDOFatalUserException: Invalid jdbc-table-name:
Duplicate table name
There exists some way of persisting both objects in the same table?
thanks
jasabinoNo. It would be very confusing to do so. Can they not share an
inheritance hierarchy? You can use flat mapping to do so.
Jose wrote:
Hi,
I need to persist two beans belonging to different classes in the same
table, but the following mistake happens:
[jdo-enhance] javax.jdo.JDOFatalUserException: Invalid jdbc-table-name:
Duplicate table name
There exists some way of persisting both objects in the same table?
thanks
jasabino -
Report based on plsql table type
Is it possible crete a report (updatable) based on plsql table type?
thank in advance
Franco GalanteSorry for my cryptic question, i wanted to mean create a report based on a stored procedure
function which return a plsql table type variable.
This idea could give me the chance to work with variable (plsql table) instead of db table.
hope i'm enough clear
thank you again
Franco Galante -
How to add column to report from the same table? Gives error now
Steps to reproduce:
Build a report on a table with easy report, select all columns
Add column to the table
Edit report and add column (one has to click Show Related Tables Only: No to view the same table!)
Report will give error as it will be build as
SELECT ... FROM table1, table1AH HAAA!!!!
And I was afraid to convert from the "SQL (Structured Query)" to "SQL". Probably because I blew up my other reports...
Thanks! -
Two reports in the same section
Hi all
I would like two have 2 different reports in the same section one near to the other (not bellow).
The dashboard page should look like
Section1
prompt
report1|report2
is there a way to do that cause I only could add sections vertically and horizontally (not able to put a report next to the other in the same section)??
RegardsAdd both reports to the same section and click on 'Properties' button on section header. Check "Arrange Horizontally" and both the reports will be displayed side by side.
-
Calculating average time from two records from the same table.
Hi all
I need to calculate the average time between two events that are recorded in the same table.
The table is TMS_MESSAGE_AUDIT_LOG
MESSAGE_ID VARCHAR2(16 BYTE) NOT NULL,
MESSAGE_VERSION NUMBER(2) NOT NULL,
CREATE_TM VARCHAR2(18 BYTE) NOT NULL,
MESSAGE_STATUS VARCHAR2(30 BYTE),
TRANSACTION_TYPE_NM VARCHAR2(30 BYTE),
MESSAGE_TP VARCHAR2(3 BYTE),
WORKFLOW_OBJECT VARCHAR2(30 BYTE) NOT NULL,
WORKFLOW_REQUEST VARCHAR2(30 BYTE) NOT NULL,
WORKFLOW_RETURN_CD VARCHAR2(30 BYTE) NOT NULL,
AUDIT_ACTION VARCHAR2(255 BYTE),
LAST_UPDATE_USER_LOGON_ID VARCHAR2(12 BYTE),
LOCAL_TM VARCHAR2(18 BYTE) NOT NULL,
LOCAL_TIME_ZN_NM VARCHAR2(70 BYTE) NOT NULL,
LOCAL_DAYLIGHT_IN CHAR(1 BYTE) NOT NULL,
FPRINT VARCHAR2(30 BYTE)
What i now need is
When the MESSAGE_ID is the same i need have the average time between when the MESSAGE_STATUS is AA and BB ( I need the time out of the CREATE_TM field )
And this for every 15 minutes interval.
Because this table will become BIG millions and millions of records it needs to be fast.
Can anybody help me.
MarcelSomething like this?
CREATE TABLE wr_test
( message_id VARCHAR2(16 BYTE) NOT NULL
, message_version NUMBER(2) NOT NULL -- Assumption: Acknowledged ver > Received ver
, create_tm VARCHAR2(18 BYTE) NOT NULL
, message_status VARCHAR2(30 BYTE)
, transaction_type_nm VARCHAR2(30 BYTE)
, workflow_object VARCHAR2(30 BYTE) DEFAULT 'x' NOT NULL
, workflow_request VARCHAR2(30 BYTE) DEFAULT 'x' NOT NULL
, workflow_return_cd VARCHAR2(30 BYTE) DEFAULT 'x' NOT NULL
, audit_action VARCHAR2(255 BYTE)
, last_update_user_logon_id VARCHAR2(12 BYTE)
, local_tm VARCHAR2(18 BYTE) NOT NULL
, local_time_zn_nm VARCHAR2(70 BYTE) DEFAULT 'GMT' NOT NULL
, local_daylight_in CHAR(1 BYTE) DEFAULT 'x' NOT NULL );
INSERT ALL
INTO wr_test
( message_id
, message_version
, create_tm
, message_status
, local_tm )
VALUES ( message_id
, 1
, create_tm
, '(Receive)'
, TO_CHAR(local_tm,'YYYYMMDD HH24:MI:SS') )
INTO wr_test
( message_id
, message_version
, create_tm
, message_status
, local_tm )
VALUES ( message_id
, 2
, create_tm
, 'Wait CLSB Ack'
, TO_CHAR
( local_tm + NUMTODSINTERVAL(DBMS_RANDOM.VALUE(0,2e5),'SECOND')
, 'YYYYMMDD HH24:MI:SS' ) )
SELECT ROWNUM AS message_id
, TO_CHAR(SYSDATE,'YYYYMMDD HH24:MI:SS') AS create_tm
, DATE '2000-01-01' + DBMS_RANDOM.VALUE(0,3) AS local_tm
FROM dual CONNECT BY ROWNUM < 100000;
WITH src AS
( SELECT message_id
, message_status
, message_version
, TO_DATE(SUBSTR(local_tm,1,17),'YYYYMMDD HH24:MI:SS') AS dt
, TO_DATE(SUBSTR(local_tm,1,8),'YYYYMMDD') AS dt_day
, TO_CHAR(TO_DATE(SUBSTR(local_tm,10,8),'HH24:MI:SS'),'SSSSS') AS dt_sec
FROM wr_test
WHERE message_status IN ('(Receive)','Wait CLSB Ack') )
SELECT dt_day + NUMTODSINTERVAL(period,'SECOND') AS dt
, NUMTODSINTERVAL(AVG(elapsed),'DAY') AS avg_elapsed
, NUMTODSINTERVAL(MIN(elapsed),'DAY') AS min_elapsed
, NUMTODSINTERVAL(MAX(elapsed),'DAY') AS max_elapsed
, COUNT(*)
FROM ( SELECT message_id
, message_status
, dt_day
, TRUNC(dt_sec/300)*300 AS period
, LEAD(dt) OVER (PARTITION BY message_id ORDER BY message_version) AS ack_dt
, LEAD(dt) OVER (PARTITION BY message_id ORDER BY message_version) - dt AS elapsed
FROM src ) cal
WHERE cal.message_status = '(Receive)'
GROUP BY dt_day, period
ORDER BY 1;Replace "wr_test" with "tms_message_audit_log" in the WITH subquery to test on your data.
Maybe you are looking for
-
Hello, is it possible to execute a unix command on user login? I want that every time a user login on a mac at my company, a unix command be executed. Is this case, this is the command: defaults write com.apple.mail NSPreferredMailCharset "UTF-8" thk
-
XML validation in 11g using DTD
Hello I'm using a DTD, stored in a database table to validate client information XML files; the problem is that i have an element, lets say A, that has an atribuite Type, and this element have two sub-elements, B and C, so the XML is something like:
-
How do I record a voice mail message from our iphone onto my MacBook Pro?
My wife has a few voice mail messages on her iphone from her brother(who passed away). She would like to save these in a safe place where she can listen in the future. Recording these messages on an MP3 player as other have suggested, doesn't give us
-
Hi, can anyone help? I have just bought a Nikon D3x and find that Aperture 2 cannot open the files. Does anyone know if there is an update in the offing or if there is a work-a-round? I really don't want to get into using Nikon Capture. I also have C
-
Where did the Glide control go?
Just started using Garageband 10.0. A previous version included a "Glide" control (slide / glissando / portamento) on the Analog Mono synth generator. You could slide the pitch of a note, say, from middle C to an octave higher, by holding middle C