Help needed in mapping BI query output to use as input for BAPI
Hi,
After wrestling with it for quite some time I choose to ask yet another question here. I want to use the output of a BI query I use as input for a BAPI. I just can not get the mapping correctly:
The query delivers: 104908BA092F7501F5E1008000829000AC
I need: 104908BA092F7501F5E1008000829000AC
How can I lose the two first digits? Thanks in advance!
Best regards,
Jan
Nevermind. I found out myself. I am now using the statement MID(@GUID,2,32) in the connection.
Similar Messages
-
Help needed to optimize the query
Help needed to optimize the query:
The requirement is to select the record with max eff_date from HIST_TBL and that max eff_date should be > = '01-Jan-2007'.
This is having high cost and taking around 15mins to execute.
Can anyone help to fine-tune this??
SELECT c.H_SEC,
c.S_PAID,
c.H_PAID,
table_c.EFF_DATE
FROM MTCH_TBL c
LEFT OUTER JOIN
(SELECT b.SEC_ALIAS,
b.EFF_DATE,
b.INSTANCE
FROM HIST_TBL b
WHERE b.EFF_DATE =
(SELECT MAX (b2.EFF_DATE)
FROM HIST_TBL b2
WHERE b.SEC_ALIAS = b2.SEC_ALIAS
AND b.INSTANCE =
b2.INSTANCE
AND b2.EFF_DATE >= '01-Jan-2007')
OR b.EFF_DATE IS NULL) table_c
ON table_c.SEC_ALIAS=c.H_SEC
AND table_c.INSTANCE = 100;To start with, I would avoid scanning HIST_TBL twice.
Try this
select c.h_sec
, c.s_paid
, c.h_paid
, table_c.eff_date
from mtch_tbl c
left
join (
select sec_alias
, eff_date
, instance
from (
select sec_alias
, eff_date
, instance
, max(eff_date) over(partition by sec_alias, instance) max_eff_date
from hist_tbl b
where eff_date >= to_date('01-jan-2007', 'dd-mon-yyyy')
or eff_date is null
where eff_date = max_eff_date
or eff_date is null
) table_c
on table_c.sec_alias = c.h_sec
and table_c.instance = 100; -
What query can we use ...for over 30 days
select PROPERTY,RELAVANTDATE ,
sum(NOTICES) over (
partition by property
order by RELAVANTDATE
range between interval '30' day preceding and current row
) "SUM"
from Test_Data
what query can we use ...for over 30 days
can i use following or precedingSCOTT@soti_9> WITH Test_Data AS (
2 select 10100 as property, to_date('25-JAN-07') as RelavantDate, 20 as notices from dual union all
3 select 10100 as property, to_date('25-DEC-07') as RelavantDate, 5 as notices from dual union all
4 select 10100 as property, to_date('02-JAN-08') as RelavantDate, 10 as notices from dual union all
5 select 10100 as property, to_date('01-DEC-08') as RelavantDate, 10 as notices from dual union all
6 select 10100 as property, to_date('02-DEC-08') as RelavantDate, 20 as notices from dual union all
7 select 10100 as property, to_date('31-DEC-08') as RelavantDate, 20 as notices from dual union all
8 select 10100 as property, to_date('03-JAN-09') as RelavantDate, 30 as notices from dual union all
9 select 10100 as property, to_date('25-JAN-09') as RelavantDate, 20 as notices from dual
10 )
11 select PROPERTY,RELAVANTDATE ,
12 sum(NOTICES) over (
13 partition by property
14 order by RELAVANTDATE
15 range between current row and interval '30' day following
16 ) "SUM"
17 from Test_Data
18 ;
PROPERTY RELAVANTD SUM
10100 25-jan-07 20
10100 25-dec-07 15
10100 02-jan-08 10
10100 01-dec-08 50
10100 02-dec-08 40
10100 31-dec-08 70
10100 03-jan-09 50
10100 25-jan-09 20
8 rows selected.Regards,
Dima -
Help needed in writing a query
Hi all,
Following is the structure of my table.
Data
Key Number
Id Number
Value varchar2(100)
activity_name varchar2(100)
Creation_Date Date
Eval_Point varchar2(100)
In the above table Id is the primary key.
The column eval_point holds only two types of entries 'activation' or 'completion'
The activity_name column holds the name of the activity.
The sample entries in the table are as follows
Key Value activity_name Creation_Date Id Eval_Point
260002 XXX assign_1 2007-09-21 16:58:41.920000 951 activation
260002 XXX assign_1 2007-09-21 16:58:43.392000 953 completion
260002 XXX assign_2 2007-09-21 16:59:03.732000 956 activation
260002 XXX assign_2 2007-09-21 16:59:04.112000 954 completion
260002 XXX assign_3 2007-09-21 16:59:24.331000 958 activation
260002 XXX assign_3 2007-09-21 16:59:24.421000 957 completion
i need to write a query which gives me data in the following format
value id start_date end_date
XXX YYY 2007-09-21 16:58:41.920000 2007-09-21 16:58:43.392000
where start_date is the creation date of the 'activation' and end_date is the creation_date of 'completion'.
Can somebody help?
-thanks
lavanyahello all,
I would like to re frame my question.
this is the output of the base query
select id,instance_key,sensor_target,activity_sensor,creation_date,eval_point from bpel_variable_sensor_values where instance_key=260002;
953 260002 Assign_1 952 2007-09-21 16:58:43.392000 completion
951 260002 Assign_1 952 2007-09-21 16:58:41.920000 activation
956 260002 Assign_2 955 2007-09-21 16:59:03.732000 activation
954 260002 Assign_2 955 2007-09-21 16:59:04.112000 completion
958 260002 Assign_3 959 2007-09-21 16:59:24.331000 activation
957 260002 Assign_3 959 2007-09-21 16:59:24.421000 completion
962 260002 Assign_4 960 2007-09-21 16:59:44.741000 completion
961 260002 Assign_4 960 2007-09-21 16:59:44.640000 activation
964 260002 Assign_5 965 2007-09-21 17:00:05.290000 completion
963 260002 Assign_5 965 2007-09-21 17:00:04.950000 activation
I am trying out this query
select a.instance_key,a.creation_date,b.creation_date,a.id
from bpel_variable_sensor_values a, bpel_variable_sensor_values b
where a.instance_key=b.instance_key
and a.instance_key=260002
and a.eval_point='activation'
and b.eval_point='completion'
and i am getting 25 entries i.e a cartesian product of a.creation_date
260002 2007-09-21 16:58:41.920000 2007-09-21 16:58:43.392000 951
260002 2007-09-21 16:58:41.920000 2007-09-21 16:59:04.112000 951
260002 2007-09-21 16:58:41.920000 2007-09-21 16:59:24.421000 951
260002 2007-09-21 16:58:41.920000 2007-09-21 16:59:44.741000 951
260002 2007-09-21 16:58:41.920000 2007-09-21 17:00:05.290000 951
260002 2007-09-21 16:59:03.732000 2007-09-21 16:58:43.392000 956
260002 2007-09-21 16:59:03.732000 2007-09-21 16:59:04.112000 956
260002 2007-09-21 16:59:03.732000 2007-09-21 16:59:24.421000 956
260002 2007-09-21 16:59:03.732000 2007-09-21 16:59:44.741000 956
260002 2007-09-21 16:59:03.732000 2007-09-21 17:00:05.290000 956
260002 2007-09-21 16:59:24.331000 2007-09-21 16:58:43.392000 958
260002 2007-09-21 16:59:24.331000 2007-09-21 16:59:04.112000 958
260002 2007-09-21 16:59:24.331000 2007-09-21 16:59:24.421000 958
260002 2007-09-21 16:59:24.331000 2007-09-21 16:59:44.741000 958
260002 2007-09-21 16:59:24.331000 2007-09-21 17:00:05.290000 958
260002 2007-09-21 16:59:44.640000 2007-09-21 16:58:43.392000 961
260002 2007-09-21 16:59:44.640000 2007-09-21 16:59:04.112000 961
260002 2007-09-21 16:59:44.640000 2007-09-21 16:59:24.421000 961
260002 2007-09-21 16:59:44.640000 2007-09-21 16:59:44.741000 961
260002 2007-09-21 16:59:44.640000 2007-09-21 17:00:05.290000 961
260002 2007-09-21 17:00:04.950000 2007-09-21 16:58:43.392000 963
260002 2007-09-21 17:00:04.950000 2007-09-21 16:59:04.112000 963
260002 2007-09-21 17:00:04.950000 2007-09-21 16:59:24.421000 963
260002 2007-09-21 17:00:04.950000 2007-09-21 16:59:44.741000 963
260002 2007-09-21 17:00:04.950000 2007-09-21 17:00:05.290000 963
can soembody help me to reduce these to 5 rows. -
Help needed in writing a Query/Procedure
Hello All,
Need all ur help in writing a query or procedure
Lets say the Table name is DEMO
There i have one column like num it has values
1
2
3
4
5
8
9
10
my query output should be
1-5
8-10
i,e .. if the diff between two rows is greater than 1 then it result should be in a separate group
I need a query/Procedure for this. Kindly help
Regards,
ChandraTried obtaining the output using SQL and the result is as follows:
SQL> WITH T AS
2 (
3 SELECT 1 COL1 FROM DUAL
4 UNION
5 SELECT 2 COL1 FROM DUAL
6 UNION
7 SELECT 3 COL1 FROM DUAL
8 UNION
9 SELECT 4 COL1 FROM DUAL
10 UNION
11 SELECT 5 COL1 FROM DUAL
12 UNION
13 SELECT 8 COL1 FROM DUAL
14 UNION
15 SELECT 9 COL1 FROM DUAL
16 UNION
17 SELECT 10 COL1 FROM DUAL
18 UNION
19 SELECT 13 COL1 FROM DUAL
20 UNION
21 SELECT 14 COL1 FROM DUAL
22 UNION
23 SELECT 15 COL1 FROM DUAL
24 UNION
25 SELECT 16 COL1 FROM DUAL
26 UNION
27 SELECT 23 COL1 FROM DUAL
28 UNION
29 SELECT 24 COL1 FROM DUAL
30 )
31 SELECT OUTPUT FROM
32 (
33 SELECT DECODE(COL3,NULL,COL1, COL2) || '-' || LEAD(DECODE(COL3,NULL,COL3, COL1)) OVER (ORDER BY DECODE(COL3,NULL,COL1, COL2)) OUTPUT FROM
34 (
35 SELECT COL1, LEAD(COL1) OVER (ORDER BY COL1) COL2, LAG(COL1) OVER (ORDER BY COL1) COL3 FROM T
36 )
37 WHERE
38 (COL2 - COL1 > 1 OR COL2 IS NULL OR COL3 IS NULL)
39 )
40 WHERE OUTPUT != '-';
OUTPUT
1-5
8-10
13-16
23-24 -
Help needed in framing SQL query.
Hi,
I have table having following schema:
PRODUCT_ID INT
DATE DATETIME
ITEMS_SOLD INT
This table contains data for a week (sunday to saturday). I want to write an SQL query to get (filter out) PRODUCT_ID of products which has same no. of ITEMS_SOLD for all 7 days. Also for given PRODUCT_ID I need to find the longest period of successive days where the no. of ITEMS_SOLD is same for all days in this period. Eg.(PRODUCT_ID 23 was sold as following along the week in no. of units sold: 4,6,6,6,6,7,4 .So the longest period is *4 days* from Monday to Thursday.) The first condition is special case of second condition where no. of days is 7.
Any help to get the SQL query will be appreciated.
Thanks,
Akshay.PRODUCT_ID DATE ITEMS_SOLD
1 10/10/2011 3
1 11/10/2011 3
1 12/10/2011 3
1 13/10/2011 3
1 16/10/2011 5
2 10/10/2011 4
2 11/10/2011 4
2 12/10/2011 4
2 13/10/2011 4
2 14/10/2011 4
2 15/10/2011 4
2 16/10/2011 4
Output:
PRODUCT_ID ITEMS_SOLD NO_OF_DAYS
1 3 4
2 4 7
Explanation of results:
The table to be queried contains data for 1 week: from 10/10/2011(Sunday) to 16/10/2011(Saturday). Now, product with PRODUCT_ID '1' was sold on dates 10,11,12,13,16. Out of these 5 days 3 units were sold on 4 successive days (from 10-13). So output should be like :
PRODUCT_ID ITEMS_SOLD NO_OF_DAYS
1 3 4
as longest period of successive days is 4 where same no. of units were sold i.e 3 units (other period is of 1 day on 16th ).
For PRODUCT_ID 2 we have only one period of 7 days where 4 units were sold each day. So we output :
PRODUCT_ID ITEMS_SOLD NO_OF_DAYS
2 4 7
Other case where same PRODUCT_ID have different units sold on each day should be ignored.
I hope that clarifies the problem more. Let me know in case I have missed out anything which should have been mentioned.
-Akshay. -
I need to fetch records from a table. Please help me to create a query
The Tablename is Employee. It has the following records
Department Empname Gender
Finance Tom Male
Finance Rick Male
Finance Stacy Female
Corporate Tom Male
Corporate Rob Male
I want to select the value of the Gender field from the Employee table corresponding to a Department
If all the values in the Gender field are 'MALE' corresponding to 'finance' in the Department field, the value should be 'MALE'
If there is a value 'FEMALE', the gender corresponding to the Empname 'TOM' should be considered as the genderTables have rows - not records.
Your question is a basic SQL language question - which means you do not know the SQL language. This forum is not a classroom for teaching you the SQL language.
Use the following as the basic outline of how your SQL language statement need to look like for selecting the required from the table:
SELECT
<<sql projection goes here>>
FROM <<table name goes here>>
WHERE <<filter conditions go here>>
{code}
The SQL projection specifies the list of columns the SQL need to return to the caller.
The filter condition is basic predicates and AND and OR can be used for multiple predicates.
Go to http://tahiti.oracle.com and look for the +SQL Reference Guide+ for the Oracle version you are using. The +SELECT+ statement syntax is covered in detail and sample statements are provided.
And please do not expect this forum to be used as a classroom, or expect this forum to do your homework for a class. -
Help needed to tune the Query:Statistics added
Can someone DBA please help me to tune this query:
SELECT DISTINCT K.ATTRIBUTE_VALUE AGENCY_ID,B.PROFILE_NM ,NVL(G.OFFICE_DESC,'--') OFFICE_DESC,f.OFFICE_ID,B.PROFILE_ID,'%' ROLE,'%' LAYOUT,
CASE
WHEN 'flagB' = '%' THEN
NVL(J.ISS_GRP_DESC,'BILLING')
WHEN 'flagO' = '%' THEN
NVL(J.ISS_GRP_DESC,'ORDERING')
WHEN 'flag' = '%' THEN
NVL(J.ISS_GRP_DESC,'BILLING/ORDERING')
ELSE
NVL(J.ISS_GRP_DESC,' ')
END ISS_GRP_DESC,
DECODE(NVL(H.USERID,' ') ,' ','--','<a sbcuid_in=' || H.USERID || ' target=NEW >'||H.FIRSTNAME || ' ' || H.LASTNAME || '( ' || H.USERID || ' )</a>' ) USER_NAME
FROM
PROFILE_PORTAL B ,
TBL_BDA_AGENCY_RESP_REP C ,
TBL_BDA_AGENCY_OFFICE F,
TBL_BDA_OFFICE G,
USERS_PORTAL H,
TBL_BDA_USR_ISS_GRP I ,
TBL_BDA_ISS_GROUP J,
ATTRIBUTE_VALUES_PORTAL K,
PROFILE_TYPE_PORTAL L
WHERE
B.PROFILE_ID = F.AGENCY_ID (+)
AND B.PROFILE_ID = C.AGENCY_ID (+)
AND G.OFFICE_ID (+)= F.OFFICE_ID
AND H.USERID (+)= C.RESP_USR_ID
AND C.ISS_GRP_ID = I.ISS_GRP_ID (+)
AND I.ISS_GRP_ID = J.ISS_GRP_ID(+)
AND 'PROFILE.'||B.PROFILE_ID = K.ENTITY_ID(+)
AND K.ATTRIBUTE_VALUE IS NOT NULL
AND L.PROFILE_TYPE_ID = B.PROFILE_TYPE_ID
AND L.APPLICATION_CD='BDA'
AND NOT EXISTS (SELECT agency_id
FROM TBL_BDA_AGENCY_RESP_REP t
WHERE t.ISS_GRP_ID IN ('%')
AND t.AGENCY_ID = C.AGENCY_ID)
AND K.ATTRIBUTE_VALUE LIKE '%'
AND UPPER(B.PROFILE_NM) LIKE UPPER('%')
AND (to_char(NVL(B.PROFILE_ID,0)) LIKE '%' OR NVL(B.PROFILE_ID,0) IN ('a'))
AND NVL(G.OFFICE_ID,0) IN ('%')
AND (to_char(NVL(C.RESP_USR_ID,'0')) LIKE '%' OR NVL(C.RESP_USR_ID,'0') IN ('k'))
ORDER BY PROFILE_NM
The number of rows in these tables are as follows:
PROFILE_PORTAL -- 2392
TBL_BDA_AGENCY_RESP_REP 3508
TBL_BDA_AGENCY_OFFICE 2151
TBL_BDA_OFFICE 3
USERS_PORTAL 270500
TBL_BDA_USR_ISS_GRP 234
TBL_BDA_ISS_GROUP 2
ATTRIBUTE_VALUES_PORTAL 2790
PROFILE_TYPE_PORTAL 3
The Explain pal nhas given this o/p to me:
SQL> select * from table(dbms_xplan.display) dual;
PLAN_TABLE_OUTPUT
| Id | Operation | Name | Rows | Bytes |TempSpc| Cost |
| 0 | SELECT STATEMENT | | 807 | 102K| | 2533 |
| 1 | SORT UNIQUE | | 807 | 102K| 232K| 82 |
|* 2 | FILTER | | | | | |
|* 3 | HASH JOIN OUTER | | 807 | 102K| | 52 |
|* 4 | HASH JOIN OUTER | | 807 | 95226 | | 40 |
|* 5 | TABLE ACCESS BY INDEX ROWID | ATTRIBUTE_VALUES | 1 | 23 | | 2 |
| 6 | NESTED LOOPS | | 7 | 805 | | 37 |
| 7 | NESTED LOOPS OUTER | | 6 | 552 | | 25 |
|* 8 | FILTER | | | | | |
| 9 | NESTED LOOPS OUTER | | | | | |
|* 10 | FILTER | | | | | |
| 11 | NESTED LOOPS OUTER | | | | | |
| 12 | NESTED LOOPS OUTER | | 3 | 141 | | 10 |
|* 13 | HASH JOIN | | 3 | 120 | | 7 |
|* 14 | TABLE ACCESS FULL | PROFILE | 6 | 198 | | 4 |
|* 15 | TABLE ACCESS FULL | PROFILE_TYPE | 1 | 7 | | 2 |
|* 16 | INDEX RANGE SCAN | SYS_C0019777 | 1 | 7 | | 1 |
| 17 | TABLE ACCESS BY INDEX ROWID| TBL_BDA_OFFICE | 1 | 10 | | 1 |
|* 18 | INDEX UNIQUE SCAN | SYS_C0019800 | 1 | | | |
| 19 | TABLE ACCESS BY INDEX ROWID | TBL_BDA_AGENCY_RESP_REP | 2 | 26 | | 2 |
|* 20 | INDEX RANGE SCAN | IDX_AGECYRESP_AGNCYID | 2 | | | 1 |
| 21 | TABLE ACCESS BY INDEX ROWID | USER_ | 1 | 22 | | 1 |
|* 22 | INDEX UNIQUE SCAN | USER_PK | 1 | | | |
|* 23 | INDEX RANGE SCAN | IDX_ATTVAL_ENTATTID | 1 | | | 1 |
| 24 | TABLE ACCESS FULL | TBL_BDA_USR_ISS_GRP | 234 | 702 | | 2 |
| 25 | TABLE ACCESS FULL | TBL_BDA_ISS_GROUP | 2 | 24 | | 2 |
|* 26 | TABLE ACCESS BY INDEX ROWID | TBL_BDA_AGENCY_RESP_REP | 1 | 7 | | 3 |
|* 27 | INDEX RANGE SCAN | IDX_AGECYRESP_AGNCYID | 2 | | | 1 |
Predicate Information (identified by operation id):
2 - filter( NOT EXISTS (SELECT /*+ */ 0 FROM "TBL_BDA_AGENCY_RESP_REP" "T" WHERE "T"."AGENCY_ID"=:B1
AND "T"."ISS_GRP_ID"=TO_NUMBER('%')))
3 - access("I"."ISS_GRP_ID"="J"."ISS_GRP_ID"(+))
4 - access("SYS_ALIAS_1"."ISS_GRP_ID"="I"."ISS_GRP_ID"(+))
5 - filter("K"."ATTRIBUTE_VALUE" IS NOT NULL AND "K"."ATTRIBUTE_VALUE" LIKE '%')
8 - filter(NVL("SYS_ALIAS_1"."RESP_USR_ID",'0') LIKE '%' OR NVL("SYS_ALIAS_1"."RESP_USR_ID",'0')='k')
10 - filter(NVL("G"."OFFICE_ID",0)=TO_NUMBER('%'))
13 - access("L"."PROFILE_TYPE_ID"="B"."PROFILE_TYPE_ID")
14 - filter(UPPER("B"."PROFILE_NM") LIKE '%' AND (TO_CHAR(NVL("B"."PROFILE_ID",0)) LIKE '%' OR
NVL("B"."PROFILE_ID",0)=TO_NUMBER('a')))
15 - filter("L"."APPLICATION_CD"='BDA')
16 - access("B"."PROFILE_ID"="F"."AGENCY_ID"(+))
18 - access("G"."OFFICE_ID"(+)="F"."OFFICE_ID")
20 - access("B"."PROFILE_ID"="SYS_ALIAS_1"."AGENCY_ID"(+))
22 - access("H"."USERID"(+)="SYS_ALIAS_1"."RESP_USR_ID")
23 - access("K"."ENTITY_ID"='PROFILE.'||TO_CHAR("B"."PROFILE_ID"))
26 - filter("T"."ISS_GRP_ID"=TO_NUMBER('%'))
27 - access("T"."AGENCY_ID"=:B1)
Note: cpu costing is off
57 rows selected.
Elapsed: 00:00:01.08
Please help me.
Aashish S.Hello Eric,
Here is the code:
SELECT DISTINCT
K.ATTRIBUTE_VALUE AGENCY_ID,
B.PROFILE_NM ,
NVL(G.OFFICE_DESC,'--') OFFICE_DESC,
f.OFFICE_ID,
B.PROFILE_ID,
'%' ROLE,
'%' LAYOUT,
case
WHEN 'flagB' = '%' THEN
NVL(J.ISS_GRP_DESC,'BILLING')
WHEN 'flagO' = '%' THEN
NVL(J.ISS_GRP_DESC,'ORDERING')
WHEN 'flag' = '%' THEN
NVL(J.ISS_GRP_DESC,'BILLING/ORDERING')
else
NVL(J.ISS_GRP_DESC,' ')
END ISS_GRP_DESC,
DECODE(NVL(H.USERID,' ') ,' ','--','<a sbcuid_in=' || H.USERID || ' target=NEW >'||H.FIRSTNAME || ' ' || H.LASTNAME ||
'( ' || H.USERID || ' )</a>' ) USER_NAME
from
PROFILE_PORTAL B ,
TBL_BDA_AGENCY_RESP_REP C ,
TBL_BDA_AGENCY_OFFICE F,
TBL_BDA_OFFICE G,
USERS_PORTAL H,
TBL_BDA_USR_ISS_GRP I ,
TBL_BDA_ISS_GROUP J,
ATTRIBUTE_VALUES_PORTAL K,
PROFILE_TYPE_PORTAL L
WHERE
B.PROFILE_ID = F.AGENCY_ID (+)
AND B.PROFILE_ID = C.AGENCY_ID (+)
AND G.OFFICE_ID (+)= F.OFFICE_ID
AND H.USERID (+)= C.RESP_USR_ID
AND C.ISS_GRP_ID = I.ISS_GRP_ID (+)
AND I.ISS_GRP_ID = J.ISS_GRP_ID(+)
AND 'PROFILE.'||B.PROFILE_ID = K.ENTITY_ID(+)
AND K.ATTRIBUTE_VALUE IS NOT NULL
AND L.PROFILE_TYPE_ID = B.PROFILE_TYPE_ID
AND L.APPLICATION_CD='BDA'
AND NOT EXISTS
(SELECT agency_id
FROM TBL_BDA_AGENCY_RESP_REP t
WHERE t.ISS_GRP_ID IN (1)
AND t.AGENCY_ID = C.AGENCY_ID)
AND K.ATTRIBUTE_VALUE LIKE '%'
AND UPPER(B.PROFILE_NM) LIKE UPPER('%')
AND (to_char(NVL(B.PROFILE_ID,0))
LIKE '%'
OR NVL(B.PROFILE_ID,0) IN (1))
AND NVL(G.OFFICE_ID,0) IN (1)
AND (to_char(NVL(C.RESP_USR_ID,'0'))
LIKE '%'
OR NVL(C.RESP_USR_ID,'0') IN ('%'))
ORDER BY PROFILE_NM
This is the Query and the query takes some mins. to run in prod environment.
From the Query plan ,I am not able to get any idea for optimization.
Now,Can you tell me which steps I need to follow to run it faster and which all modifications should be made?
Thanks.
Aashish S. -
Help needed extracting information from command output using sed
I want to be able to pipe the output of:
playerctl metadata
into sed and extract only the relevant information. I have a working knowledge of regular expressions but I'm not how to get sed to only output the matched text. For reference, this is an example output of the playerctl command:
{'mpris:artUrl': <'http://open.spotify.com/thumb/ddf652a13affe3346b8f65b3a92bd3abfdbf7eca'>, 'mpris:length': <uint64 290000000>, 'mpris:trackid': <'spotify:track:0xqi1uFFyefvTWy0AEQDJ7'>, 'xesam:album': <"Smokey's Haunt">, 'xesam:artist': <['Urthboy']>, 'xesam:autoRating': <0.23000000000000001>, 'xesam:contentCreated': <'2012-01-01T00:00:00'>, 'xesam:discNumber': <1>, 'xesam:title': <'On Your Shoulders'>, 'xesam:trackNumber': <6>, 'xesam:url': <'spotify:track:0xqi1uFFyefvTWy0AEQDJ7'>}%
I'm trying to get the track name and artist name and combine them into one string. Perhaps sed isn't the tool for the job but I'm not really sure what else to try. Any help is very appreciated.If that was valid json, which it doesn't appear to be, you could use jshon to query it.
Are you sure that is the exact output of the command? It looks sort of off...
In the meatime, this is pretty hacky:
awk 'BEGIN { RS=","; FS="'\''" }; /artist/ { artist = $4 }; /title/ { title = $4 } END { print artist": "title }' file
Urthboy: On Your Shoulders -
Help Needed in mapping business scenario
Hi All,
I have a RM inter unit despatches for this we are using STO. While doing inter unit despatches we have to pay freight on per kg (Gross Weight) for a source and destination. This has already been mapped by creating a condition type and condition record.
But there is a scenario where in when inter unit despatches happens there is an agreement b/w transporter and company if the company does not load full truck then the company needs to pay a minimum amount which has been negotiated with the transporter in this case, the freight condition is not being payed only minimum gurantee amount is payed to the transporter.
Could any of us help me in mapping only the minimum gurantee scenario in R/3.
We are using STO to do inter unit despatches.
Regards,
Sreekanthhai
i think u can use condition type AMIW -
Urgent help needed....Query..
Hello Experts
Can someone help with writing a particular query. This is the test scenario
CREATE TABLE TEST (MONTH DATE,
AMOUNT NUMBER(17));
INSERT INTO TEST VALUES('01-FEB-06',100);
INSERT INTO TEST VALUES('01-MAR-06',100);
INSERT INTO TEST VALUES('01-APR-06',100);
INSERT INTO TEST VALUES('01-JUN-06',100);
INSERT INTO TEST VALUES('01-JUL-06',100);
INSERT INTO TEST VALUES('01-AUG-06',100);
INSERT INTO TEST VALUES('01-SEP-06',100);
INSERT INTO TEST VALUES('01-OCT-06',100);
INSERT INTO TEST VALUES('01-NOV-06',100);
INSERT INTO TEST VALUES('01-DEC-06',100);
INSERT INTO TEST VALUES('01-JAN-07',100);
INSERT INTO TEST VALUES('01-FEB-07',100);
INSERT INTO TEST VALUES('01-MAR-07',100);
INSERT INTO TEST VALUES('01-APR-07',100);
INSERT INTO TEST VALUES('01-MAY-07',100);
INSERT INTO TEST VALUES('01-JUN-07',100);
INSERT INTO TEST VALUES('01-JUL-07',100);
INSERT INTO TEST VALUES('01-AUG-07',100);
INSERT INTO TEST VALUES('01-SEP-07',100);
INSERT INTO TEST VALUES('01-OCT-07',100);
INSERT INTO TEST VALUES('01-NOV-07',100);
INSERT INTO TEST VALUES('01-DEC-07',100);
INSERT INTO TEST VALUES('01-JAN-08',100);
INSERT INTO TEST VALUES('01-FEB-08',100);
INSERT INTO TEST VALUES('01-MAR-08',100);
INSERT INTO TEST VALUES('01-APR-08',100);
INSERT INTO TEST VALUES('01-MAY-08',100);
INSERT INTO TEST VALUES('01-JUN-08',100);
Ok so thats my test table, I want a query which will give me the sum of the field Amount grouping by Year but it should give me the sum of the month from July 06 till July 07. For Example if i put the Date Range from 2003 to 2006 then it should give me out put by group the year from july till next year jun.
It should look something like this
Year Amount
07-2005/06-2006 5000
07-2006/06-2007 2000
07-2007/06-2008 1200
Can i get a query which will group in the above manner???
Thanks & Regards
vihangSQL> select '07'||extract(year from add_months(month,-7))||
2 '-07'||extract(year from add_months(month,5)) yr,
3 sum(amount) amt
4 from test
5 group by '07'||extract(year from add_months(month,-7))||
6 '-07'||extract(year from add_months(month,5));
YR AMT
072007-072008 1100
072006-072007 1200
072005-072006 500.
Message was edited by:
jeneesh -
Need to make collection Query statement by sccm 2012 sp1 for Count of Licenses by License Status
I want to make collection Query statement by sccm 2012 sp1 for all windows activated and all non-activated windows.
Ahmed SherifHave a look at the Software Licensing Product attribute classes when creating a Query - remember to choose
System Ressource when creating the Query. You would have to enable this class to be collected during Hardware Inventory. Go to
Client Settings -> Hardware Inventory ->
Set Classes -> Select Software Licensing Product.
This Class is part of the Asset Intelligence classes so you could enable it from there as well.
Another way to accomplish is to use Compliance Settings to get this information.
Create a Configuration item that query the Win32_WindowsProductActivation WMI Class, if you are using XP and the
SoftwareLicensingProduct class for later os´s
Add this Configuration Item to a Baseline ad deploy it to your Collections as needed.
When the Baseline has been evaluated you can use this information to create query
Machines reported as compliant is actived and machines reported as Non-Compliant is not activated.
You can read about the Win32_WindowsProductActivation WMI Class here:
http://msdn.microsoft.com/en-us/library/aa394520(v=vs.85).aspx
and the SoftwareLicensingProduct here:
http://msdn.microsoft.com/en-us/library/cc534596(v=vs.85).aspx -
Help needed... Iphone 3gs is using up all my phone credits
I bought the 3gs recently. I have a prepaid account with my cellular/mobile carrier. FOr some reason the the phone is eating up all my credits. I am going thru USD 20/hour.. How do i stop it? I have already made the following changes to my settings :
Fetch new data is off
Enable 3g roaming is off
Data roaming is off
What else do i need to do? why is it happening?
thanks for your helpYou are probably using applications that fetch data over the network.
Google maps, the camera application, safari, app store, itunes app, and several other 3rd party applications do that.
The only way I can think of getting rid of that is by putting false information on
settings->general->network->cellular data network.
That way you won't be able to use the carriers 3g and edge network. -
Help Needed !! Urgent. Read .txt using j2me.
Hi,
I need to read this field;
Server IP Address = 192.122.139.16*
BT Addr & Port No. = 000B0D182EDA:1*
Help IP Address = 192.168.0.100:3334*
is there any easy coding which can help me to read all the fields above using j2me?
I am using BufferedReader and i am having abit of a problem..here's my coding.
import java.io.*;
import javax.microedition.lcdui.CommandListener;
import javax.microedition.midlet.MIDlet;
public class Settings {
public Settings()
BufferedReader br = new BufferedReader(new FileReader("Settings.txt"));
int a = 2000;
String [] sets = new String [a];
for (int i = 0; i < 2; i ++)
sets[i] = br.readLine();
System.out.println ("" +sets);
the errors come from the BufferedReader. " BufferedReader cannot be resolved to a type".
Do help me out with this.. thanks!
Edited by: remi17 on Feb 18, 2008 8:02 PM -
Help needed on listing out all tag names using XML Rules in ExtendScript(InDesign)
Given a document with elements already in place, I am looking for a snippet of code to walk down the XML tree only two levels
deep to printout the names of each of the tags (not attributes). I am just using javascript in extendscipt to accomplish this. Ultimately,
I want to provide this list in a checkbox dialog and use those checked items to develop a TOC. This latter part, I have in place.
It is just the pushing of the tag element names into an array that seems to be cumbersome for me at this point.
Any shortcut snippets out there that someone can provide?
A shorter version of this request....Is there anyway to just list out all element.markupTag.name of an XML tree, not knowing the xpath naming?
Using "//*" obviously is not working....well..
Document.xmlTags.everyItem().name will get you a array of all the xml tags in the document. Maby that will help you?
another way, and you can use it recursively:
myObject.xmlElements.everyItem().markupTag.name
will get you an array of tag names. use something like: http://stackoverflow.com/a/15806501 to remove duplicates.. and.. enjoy
Maybe you are looking for
-
Taking infinte time to log-in to launch Adobe XI Pro Trial. Credentials, Adobe ID and password are coreect. Requested new password via log-in trouble shooting and got new password, still no success. Just get rotating icon and no response when I logi-
-
My 160gb classic Keeps freezing every so often on some songs
Could any one help me out some times when i hit play on a song(all songs are cd rips that it does it on), the song willeither take a good 30 seconds to one minute to work or my i pod will freeze, have tried restoring but still happens after restorati
-
My photosmart 7520 printer was installed, connected, and working fine for a couple of weeks to my computer by wireless, peer to peer (no network, just computer and printer). The computer is connected to internet via wired ethernet dsl router. Then a
-
I have Photo Shop Elements 7 - using with Windows XP. In the Organizer section, main menu, I cannot get the File, Edit, Find, View to show up without having to click on the double arrows first. I would like them to appear as they do in Editor secti
-
Installing Oracle 10g and error with DISPLAY value
Hello, I am instaling Oracle 10g and when I run: . /runInstaller this error apear: Can't connect to X11 window server using :0.0 as the value of DISPLAY variable. how must I set de DISPLAY variable if I have instaling in a local system? Thanks