partial output displays only SQL query.
HelloWhen I tried to view a display of the query source code, I am able to see the partial only as output below.
SQL > select text from user_views where view_name = "ABC";
TEXT
--------------------------------------------------------------------------------
SELECT the region
product_director,
plan_year,
where the text should be about 200 lines. Is this a problem of settings... ? . Waiting for your response.
Kind regards
Bharath
Published by: user12026039 on July 6, 2011 12:17 AM
Maybe this would help
Sqlplus and column display long data type
Tags: Database
Similar Questions
-
I'm seeing the log file to manage the sql query sessions in the responses. I see that if we run the same report multiple times, the sql query is displayed only the first time. Second time if I run it is not displayed. If I make a new report with diff columns selected, it gives me the sql code then. Where can I put this option to display the sql query whenever I run a report, even if it's the same report executed several times. Is this caching problem?
It should not... You have disabled the "Cache" on the physical layer for this table? If you go to the Advanced tab, is the option "ignore the cache Oracle BI" checked?
-
Hello
Here's my data in the table for itm_id = 1000
ITM_ID ADD_ATR DEL_ATR 1000 a: b:c:d 1000 d 1000 d 1000 e:f:g 1000 e:f:g My required return is (a: b:c:d) d = a: b: c + d = a: = a +(e:f:g) b:c:d: b:c:d:e:f:g-(e:f:g) = a: b: c; d
Output ITM_ID
1000A: b:c:d
can we get the output using the sql query above?
I had tried with union but could not able to get the required result.
Please let me know if there is no possible solution
Thank you
David
I have the impression that you are looking to treat each character in 'RTA' as an individual item and then add or delete depending on whether they are an ADD_ATR or DEL_ATR.
So something like...
SQL > ed
A written file afiedt.buf1 with t as (select 1000 as itm_id, ' a: b/c: some like add_atr, null as del_atr of all the double union)
2 select 1000, null, would be "union double all the"
3 select 1000, 'd', null of union double all the
4 select 1000, 'e:f:g', null of union double all the
5 select 1000, null, "e:f:g" of all the double union
6 select 1234, null, "x: y: z" of all the double union
7 select 1234, 'u: v: w', null of union double all the
8 select 1234, null, 'u' of all the double union
9 select 1234, "x: y", null of union double all the
10. Select 1234, "x: z", null of union double all the
11. Select 1234, 'p', the double null
12 )
13-
14. end of test data
15-
16. Select itm_id
17, cast (listagg(atr,':') within the Group (order by atr) as varchar2 (40)) output
18 of)
19 select itm_id
20, atr
21, sum (add_del)
22 of)
23 select itm_id
24, coalesce(add_atr,del_atr) as full_atr
25, decode (add_atr, null,-1, 1) as add_del
26, regexp_substr (coalesce(add_atr,del_atr),'[^:] +', 1, level) RTA
27, flat surface that l
28 t
29 to connect by level<= (length(coalesce(add_atr,del_atr)="">=>
30 and itm_id = prior itm_id
31 and coalesce(add_atr,del_atr) = prior coalesce(add_atr,del_atr)
sys_guid() 32 and prior is not null
33 )
34 group by itm_id, atr
35 having sum (add_del) > 0
36 )
37 * group by itm_id
SQL > /.ITM_ID OUTPUT
---------- ----------------------------------------
1000A: b:c:d
1234 p:v:w:xthat just shows how stupidly data is as it should be divided every thing in the different elements so that you can then group to determine how many of each, you have (and whether to add or subtract) and then re - combine results again in a combined string.
-
How do I get the data of "Regulatory BOM" Formulation with SQL query output
Hello
We would like to implement a State of BiPublisher that displays "Regulation BOM" (wording-> click on TAB Formulation on exit Popup-> TAB Composition) information table.
How could get us this information with an SQL query?
Thank you
Annarosa
Hi, given 'Regulatory BOM' output of the Formulation are more complicated than expected. Attached is an example. You can test and make the appropriate changes to your report.
-
How to select only the part by using the sql query
Hello
I have the task to retrieve only the integral of the input text by using the sql query.
The entry is as follows
Entry for the price setting
$12.5 (FYI without space)
$ 12.5 (FYI single space)
$ 12.5 (double space FYI)
$12.5 (FYI multiple space)
$12.5 (FYI multiple space)
Output expected of 12.5
The price is the type varchar2 column in the store_price table.
Please let me know how to achieve this.
Thanks in advance.
If this is always the case that you get a $ followed by a number of places, you can use something like:
Select to_number (ltrim ('$ 12.5',' $')) DOUBLE
or
SELECT ltrim ('$ 12.5',' $') OF double
but take care of your nls_numeric_character settings if they are defined so that, for example, a comma is the decimal separator, you will have a problem.
HTH
-
IF NEW VARIABLE in SQL QUERY, DISPLAYS as the LAST COLUMN + rpad does not
Hello all and thanks in advance.
(1) if I add a new variable to my sql query to select a column, which was already on the table, it shows it in the report of the table as the last column on the right. In other words, if I add "the street" to
something like city, postal code, street, store, Manager, etc., instead of placing the Street between CP and the Bank, the place like I said as the last column on the right.
(2) when the values entered in the cells of the tables, Yes, they extend to their length, but, only if it is a Word. If it is two, as when I enter the value of 'very good '.
then two lines as well as by a newline within the cell, for example, which in fact too high the rank. I tried sdap spaces with rpad but this did not work. something like rpad (stock, 20,' ')
I have to say that the table is in the same page where there is a form, as the table grows in length it's actually squeezing the form on the left.
(3) rpad did not work with the simpler syntax, but less would be with what I need, because it turns out that I am using DECODE to perform a conversion between the displayed value and
value returned in my select list of values, something like: DECODE (TO_CHAR (stock), '1', 'Black', '2', 'Average', '3', 'good', '4', 'Very good', null) AS stock
so, I tried to put the rpad there in several places, but either he gave the parse error or it has left empty do not pick up all the values in the column.
Thank you very much
AlvaroAlvaro
(1) this is the standard behavior of the constructor of the apex. You can change the order of display with arrows in the report column attributes.
(2) you have to play with the style of the column attributes to accomplice this. For the style of the instance = "" white-space: pre; ' in the attributes of the element column attributes. " White-space: normal would be put on several space (' ') 1. So no matter how you add with rpad, they will display as 1.
Set a width or as attribute in a class style for this column.Nicolette
-
date picker default value appears only not in the sql query
Hello
I have a page as a table with a query similar to the following:
Select emp_name, salary of emp_table where (hire_date) trunc = trunc (to_date (:P42_START_DATE))
where P42_START_DATE is the name of a date picker.
I put the date picker, "only when the current value in session state is null" and the value of being "select trunc (next_day(sysdate,'MON')-7) from dual;"-essentially the Monday of the current week, the type of source. I updated the date to 5 selector and the sequence of the region 10. Now, when I opened this page, no data gets pulled. I checked the source of the page and the value of the entry date picker is used to "November 17, 2008", but is not somehow reflected in the sql query.
Data get retrieved if I put manually the date in the date picker, but I would like that it by default on Monday of this week. What I am doing wrong?
Thank youHello
>
"Article 1 of the Expression value is NULL" where is expression 1
P42_START_DATE
>Yes, that's correct - No. colon is required here as we don't not using the item as a variable binding, just name for the condition. In my tests, I put the calculation for:
Name of article: P31_HIREDATE (put your P42_START_DATE here instead)
Type: SQL query
Point calculation: before header
Calculation: SELECT TO_CHAR (TRUNC (SYSDATE, 'DAY'), 'DD-MON-RR') FROM DUALMy report SQL statement is:
SELECT EMPNO, ENAME, HIREDATE FROM EMP WHERE NVL(HIREDATE, TRUNC(SYSDATE)) < TO_DATE(:P31_HIREDATE,'DD-MON-RR')
My datepicker object has no special parameters - so:
Name: P31_HIREDATE
Display: Date Picker (DD-MON-RR)
Source: Only when...
Source type: static...
The source value or expression: (empty)
Default: (empty)And that's what I did to get: http://htmldb.oracle.com/pls/otn/f?p=55041:31
Change the date that you like or click Reset to clear the cache (the calculation will be then reset the date to the current date and refiltrer the report)
Andy
-
SQL query to retrieve only numbers to a string variable
Dear all Experts,
I have a requirement in one of my projects where I need to extract only the numbers present in the variable.
for example:
BANK_ACCOUNT_NUMBER = 12345-67890';
BANK_ACCOUNT_NUMBER = 12345 67890';
BANK_ACCOUNT_NUMBER = "123.456.7890";
BANK_ACCOUNT_NUMBER = 123-A456BC7890D';
In all these cases, I need to retrieve only numbers such as BANK_ACCOUNT_NUMBER = 1234567890 and I am looking for SQL query only.
Please suggest me the query how to extract numeric values from varchar variable.
Thank you
Knockaert
select regexp_replace('123-A456BC7890D','[^0-9]') from dual;
See you soon,.
Manik.
-
SQL query to display the sum of the values of each June and December
Hello having problems of construction of a query to the list SQL query to display the sum of the values of each June and December each year.
My Table;
TABLE name: MONTH_TERM
Fields with values:
TERM_KEY MONTH_ACTUAL MONTH_DATE 82 500 01/11/2015 0:00 82 450 01/12/2015 0:00 82 405 01/01/2016 0:00 82 400 01/02/2016 0:00 82 450 01/03/2016 0:00 82 425 01/04/2016 0:00 82 435 01/05/2016 0:00 82 410 06/01/2016 0:00 82 409 01/07/2016 0:00 82 415 01/08/2016 0:00 82 420 09/01/2016 0:00 82 422 10/01/2016 0:00 82 436 11/01/2016 0:00 82 556 01/12/2016 0:00 82 568 01/01/2017 0:00 82 624 02/01/2017 0:00 What I would like to see in a query result:
TERM_KEY MONTH_ACTUAL MONTH_DATE Total of 6 months 82 500 01/11/2015 0:00 82 450 01/12/2015 0:00 950 82 405 01/01/2016 0:00 82 400 01/02/2016 0:00 82 450 01/03/2016 0:00 82 425 01/04/2016 0:00 82 435 01/05/2016 0:00 82 410 06/01/2016 0:00 2525 82 409 01/07/2016 0:00 82 415 01/08/2016 0:00 82 420 09/01/2016 0:00 82 422 10/01/2016 0:00 82 436 11/01/2016 0:00 82 556 01/12/2016 0:00 2658 82 568 01/01/2017 0:00 82 624 02/01/2017 0:00 ---
Here's my query:
Select
"TERM_KEY,"
"MONTH_ACTUAL,"
to_char(MONTH_DATE,'MM/YYYY') MONTH_DATE,
DEAL to_char (MONTH_DATE, 'MM')
WHEN '06' THEN (SELECT SUM (MONTH_ACTUAL)
OF MONTH_TERM
WHERE the to_char (MONTH_DATE, 'MM') between 1 and 6
AND term_key = 82)
WHEN '12' THEN (SELECT SUM (MONTH_ACTUAL)
OF MONTH_TERM
WHERE the to_char (MONTH_DATE, 'MM') between 7 and 12
AND term_key = 82)
ELSE null
END as SIX_MO_CUMM,
of MONTH_TERM
where term_key = 82
It's my results:
TERM_KEY MONTH_ACTUAL MONTH_DATE Total of 6 months 82 500 01/11/15 0:00 82 450 01/12/15 0:00 3608 82 405 01/01/16 0:00 82 400 01/02/16 0:00 82 450 01/03/16 0:00 82 425 01/04/16 0:00 82 435 01/05/16 0:00 82 410 01/06/16 0:00 3717 82 409 01/07/16 0:00 82 415 01/08/16 0:00 82 420 01/09/16 0:00 82 422 10/01/16 0:00 82 436 01/11/16 0:00 82 556 01/12/16 0:00 3608 82 568 01/01/17 0:00 82 624 01/02/17 0:00 Any ideas on how to fix would be great
Select term_key,
month_actual,
month_date,
case mod (to_char (month_date, 'mm'), 6)
When 0 then sum (month_actual)
During)
term_key partition
order of month_date
between the previous month '5' interval and the current line
)
end '6 MONTHS in TOTAL'
from tbl
order of term_key,
month_date
/
TERM_KEY MONTH_ACTUAL MONTH_DAT 6 MONTHS TOTAL
---------- ------------ --------- --------------
82 500 NOVEMBER 1ST, 15TH
82 450 1 DECEMBER 15 950
82 405 1 JANUARY 16
82 400 1 FEBRUARY 16
82 450 1ST MARCH 16
82 425 1ST APRIL 16
82 435 1 MAY 16
82 410 2525 1 JUNE 16
82 409 1 JULY 16
82 415 1ST AUGUST 16
82 420 16 - SEP - 01TERM_KEY MONTH_ACTUAL MONTH_DAT 6 MONTHS TOTAL
---------- ------------ --------- --------------
82 422 1 OCTOBER 16
82-436 NOVEMBER 1, 16
82 556 2658 1 DECEMBER 16
82 568 1 JANUARY 17
82 624 1 FEBRUARY 1716 selected lines.
SQL >
SY.
-
How to display time in 010403 format if the entry is transmitted as ' 1 hour, 4 minutes, 3 seconds"sql query @.
Hello
You can try:
Select lpad (regexp_substr ('1 hour, 4 minutes, 3 seconds ',' [[: digit:]] + ""), 2, '0')
|| LPAD (regexp_substr ('1 hour, 4 minutes, 3 seconds ',' [[: digit:]] +', 1, 2), 2, '0')
|| LPAD (regexp_substr ('1 hour, 4 minutes, 3 seconds ',' [[: digit:]] +' 1, 3), 2, '0')
Double;
but this requires maximum 99 hours/minutes/seconds ago in your entry.
-
Refine a query to display only the entries for the current week
Hello.
Anyone know how to change a query to display only those records that have dates of the current week? Records have a start date and an end date, so the query should recognize that the entry may be valid for more than one week?
Kind regards
swelchHi Steve,.
I just created a dataset that contained the periods before, during and after the current week - on the assumption that if any day of a range (start/end) falls within the current week so it is included.
In my example this is 'today', June 25, 2011, and a week is defined as Sun - Sat. So my week of 'course' is u 19 June 2011 / I June 25, 2011.
A line any with a start date before or during my 'current' week and an end date that is after or during my "current" week, i.e. no matter what date in its range included in the 'in progress' week will appear.
See you soon,.
Rob -
Displays the output of PL/SQL
The PL/SQL output below would not be dilsplay. Can anyone in this Council through my code and tell me what I am doing wrong that I can't see the result of the code.
I only get 'anonymous block' as the view-only. I want to see
Set serveroutput on
declare
cursor obj_cursor is
Select
object_name,
object_type,
owner
Of
DBA_OBJECTS
where
owner = 'ITA '.
and object_type in ('TABLE', 'SEE')
and object_name like 'JOB_;
wk_job VARCHAR2 (500);
WK_SQL VARCHAR2 (500);
WK_JOBSTR VARCHAR2 (500);
out_f utl_file.file_type;
BEGIN
wk_jobstr: = 'JOB_ | LTRIM (to_char (wk_job)). '%';
for wk_rec loop obj_cursor
If wk_rec.object_type = 'TABLE' then
wk_sql: = 'drop table ' | wk_rec.object_name;
dbms_output.put_line (wk_sql);
end if;
end loop;
end;
/
And if the rans above successfully, how I put the following code in the code above?
Select ownerid, starttime, endtime in ita.tpis32_job_status jobid where starttime < sysdate - 60 and num_lines > 1000000;
The idea is to use the jobid five-digit and add it to the job_ variable.Hello
first of all, I'll try to run only SQL, so the selection from your cursor in SQLPLUS. If it returns no rows, your problem is in the SQL code.
I think the problem is because of your where clause:
and object_name like 'JOB_';
It will be all the lines where there are 4 characters, nothing more. I think you need to replace the '_' % or add the tot % string. This will also give you the results of more than 4 characters.
So:and object_name like 'JOB_%';
BTW: The underscore is a wild-card character to like. It replaces a single character. The % stands for 0 or more characters.
Herald tiomela
Superconsult.nl -
SQL query: only the numbers in the line of the somme - need help
Pls see data below. I want to display only 8 lines and lines of BRH NCC should be merged and displayed as - BRH 98 2 instead of 2 rows. The rest of the lines must remain as it is. Help, please.
NCC SERVICES MANUFACTURING
ASL 138 NA
BRH 98 NA
BRH NA 2
C10000 NA 0
C40000 NA 0
DAO NA 10
E10000 NA 0
I10000 NA 0
M10000 NA 0
Published by: auxilia on November 7th, 2009 06:25with t as ( select 'ASL' ccn,'138' services,'NA' manufacturing from dual union all select 'BRH','98','NA' from dual union all select 'BRH','NA','2' from dual union all select 'C10000','NA','0' from dual union all select 'C40000','NA','0' from dual union all select 'DAO','NA','10' from dual union all select 'E10000','NA','0' from dual union all select 'I10000','NA','0' from dual union all select 'M10000','NA','0' from dual ) select ccn, nvl(max(case services when 'NA' then null else services end),'NA') services, nvl(max(case manufacturing when 'NA' then null else manufacturing end),'NA') manufacturing from t group by ccn / CCN SERVICES MANUFACTURING ------ -------------------- -------------------- E10000 NA 0 C10000 NA 0 BRH 98 2 M10000 NA 0 C40000 NA 0 ASL 138 NA I10000 NA 0 DAO NA 10 8 rows selected. SQL>
SY.
Published by: Solomon Yakobson on November 7th, 2009 06:46
-
Help setting up a SQL query with poor performance
Hi all
Database version: 10.2.0.5
I'm working on a new report to view the top users by the number of calls. The table is truncated and filled again every month with records for the previous month; It contains approximately 400 000 records.
I created a view with the columns needed for the report; also, the two functions of view calls to determine if a phone number is assigned to multiple staffs or several departments.
It's full again table every month:
CREATE TABLE "VOIP"."MONTHLY_BILLING_DETAILS" ( "ID" NUMBER NOT NULL ENABLE, "CDRRECORDTYPE" NUMBER, "G_CALLMANAGERID" NUMBER, "G_CALLID" NUMBER, "O_LEGCALLIDENTIFIER" NUMBER, "DATETIMEORIGINATION" NUMBER, "O_NODEID" NUMBER, "O_SPAN" NUMBER, "O_IPADDR" NUMBER, "CALLINGPARTYNUMBER" VARCHAR2(50 BYTE) NOT NULL ENABLE, "CALLINGPARTY_USERID" VARCHAR2(128 BYTE), "O_CAUSE_LOCATION" NUMBER, "O_CAUSE_VALUE" NUMBER, "O_PRECEDENCELEVEL" NUMBER, "O_MEDIATRANSPORTADDR_IP" NUMBER, "O_MEDIATRANSPORTADDR_PORT" NUMBER, "O_MCAP_PAYLOADCAPABILITY" NUMBER, "O_MCAP_MAXFRAMESPERPACKET" NUMBER, "O_MCAP_G723BITRATE" NUMBER, "O_VCAP_CODEC" NUMBER, "O_VCAP_BANDWIDTH" NUMBER, "O_VCAP_RESOLUTION" NUMBER, "O_VIDEOTRANSPORTADDR_IP" NUMBER, "O_VIDEOTRANSPORTADDR_PORT" NUMBER, "O_RSVPAUDIOSTAT" VARCHAR2(64 BYTE), "O_RSVPVIDEOSTAT" VARCHAR2(64 BYTE), "DESTLEGIDENTIFIER" NUMBER, "DESTNODEID" NUMBER, "DESTSPAN" NUMBER, "DESTIPADDR" NUMBER, "ORIGINALCALLEDPARTYNUMBER" VARCHAR2(50 BYTE), "FINALC_PARTYNUMBER" VARCHAR2(50 BYTE), "FINALC_PARTY_USERID" VARCHAR2(128 BYTE), "DESTCAUSE_LOCATION" NUMBER, "DESTCAUSE_VALUE" NUMBER, "DESTPRECEDENCELEVEL" NUMBER, "DESTMEDIATRANSPORTADDR_IP" NUMBER, "DESTMEDIATRANSPORTADDR_PORT" NUMBER, "DESTMCAP_PAYLOADCAPABILITY" NUMBER, "DESTMCAP_MAXFRAMESPERPACKET" NUMBER, "DESTMCAP_G723BITRATE" NUMBER, "DV_CAP_CODEC" NUMBER, "DV_CAP_BANDWIDTH" NUMBER, "DV_CAP_RESOLUTION" NUMBER, "DV_TRANSPORTADDR_IP" NUMBER, "DV_TRANSPORTADDR_PORT" NUMBER, "DESTRSVPAUDIOSTAT" VARCHAR2(64 BYTE), "DESTRSVPVIDEOSTAT" VARCHAR2(64 BYTE), "DATETIMECONNECT" NUMBER, "DATETIMEDISCONNECT" NUMBER, "LASTREDIRECTDN" VARCHAR2(50 BYTE), "PKID" VARCHAR2(4000 BYTE), "O_INALCALLEDPARTYNUM_PARTITION" VARCHAR2(50 BYTE), "CALLINGPARTYNUM_PARTITION" VARCHAR2(50 BYTE), "FINALC_PARTYNUM_PARTITION" VARCHAR2(50 BYTE), "LASTREDIRECTDNPARTITION" VARCHAR2(50 BYTE), "DURATION" NUMBER, "O_DEVICENAME" VARCHAR2(129 BYTE), "DESTDEVICENAME" VARCHAR2(129 BYTE), "O_CALLTERMINATION_BEHALF" NUMBER, "DESTCALLTERMINATION_BEHALF" NUMBER, "O_CALLEDPARTYREDIRECT_BEHALF" NUMBER, "LASTREDIRECTREDIRECT_BEHALF" NUMBER, "O_CALLEDPARTYREDIRECTREASON" NUMBER, "LASTREDIRECTREDIRECTREASON" NUMBER, "DESTCONVERSATIONID" NUMBER, "G_CALLID_CLUSTERID" VARCHAR2(50 BYTE), "JOIN_BEHALF" NUMBER, "COMMENTS" VARCHAR2(2048 BYTE), "AUTHCODEDESCRIPTION" VARCHAR2(50 BYTE), "AUTHORIZATIONLEVEL" NUMBER, "CLIENTMATTERCODE" VARCHAR2(32 BYTE), "O_DTMFMETHOD" NUMBER, "DESTDTMFMETHOD" NUMBER, "CALLSECUREDSTATUS" NUMBER, "O_CONVERSATIONID" NUMBER, "O_MCAP_BANDWIDTH" NUMBER, "DESTMCAP_BANDWIDTH" NUMBER, "AUTHORIZATIONCODEVALUE" VARCHAR2(32 BYTE), "OUTPULSEDCALLINGPARTYNUMBER" VARCHAR2(50 BYTE), "OUTPULSEDCALLEDPARTYNUMBER" VARCHAR2(50 BYTE), "O_IPV4V6ADDR" VARCHAR2(64 BYTE), "DESTIPV4V6ADDR" VARCHAR2(64 BYTE), "O_VCAP_CODEC_CHAN2" NUMBER, "O_VCAP_BANDWIDTH_CHAN2" NUMBER, "O_VCAP_RESOLUTION_CHAN2" NUMBER, "O_V_TRANSPORTADDR_IP_CHAN2" NUMBER, "O_V_TRANSPORTADDR_PORT_CHAN2" NUMBER, "O_V_OCHANNEL_ROLE_CHAN2" NUMBER, "DV_CAP_CODEC_CHAN2" NUMBER, "DV_CAP_BANDWIDTH_CHAN2" NUMBER, "DV_CAP_RESOLUTION_CHAN2" NUMBER, "DV_TRANSPORTADDR_IP_CHAN2" NUMBER, "DV_TRANSPORTADDR_PORT_CHAN2" NUMBER, "DV_CHANNEL_ROLE_CHAN2" NUMBER, "DATE_CREATED" DATE, "DATETIME_CONNECT" DATE, "DATETIME_DISCONNECT" DATE, "USERID_EMAIL_ADDRESS" VARCHAR2(100 BYTE), "FROM_FULL_TELEPHONE" VARCHAR2(20 BYTE), "TO_FULL_TELEPHONE" VARCHAR2(20 BYTE), "FROM_EXCHANGE" VARCHAR2(7 BYTE), "TO_EXCHANGE" VARCHAR2(20 BYTE), "FROM_CITY" VARCHAR2(200 BYTE), "FROM_STATE" VARCHAR2(2 BYTE), "TO_CITY" VARCHAR2(200 BYTE), "TO_STATE" VARCHAR2(2 BYTE), "CALL_TYPE" VARCHAR2(10 BYTE), CONSTRAINT "MONTHLY_BILLING_PK" PRIMARY KEY ("ID") USING INDEX PCTFREE 10 INITRANS 2 MAXTRANS 255 COMPUTE STATISTICS STORAGE(INITIAL 3145728 NEXT 1048576 MINEXTENTS 1 MAXEXTENTS 2147483645 PCTINCREASE 0 FREELISTS 1 FREELIST GROUPS 1 BUFFER_POOL DEFAULT) TABLESPACE "VOIPDATA" ENABLE ) PCTFREE 10 PCTUSED 40 INITRANS 1 MAXTRANS 255 NOCOMPRESS LOGGING STORAGE(INITIAL 75497472 NEXT 1048576 MINEXTENTS 1 MAXEXTENTS 2147483645 PCTINCREASE 0 FREELISTS 1 FREELIST GROUPS 1 BUFFER_POOL DEFAULT) TABLESPACE "VOIPDATA" ; CREATE INDEX "VOIP"."MONTHLY_BILL_INDEX1" ON "VOIP"."MONTHLY_BILLING_DETAILS" (TRUNC("DATETIME_CONNECT")) PCTFREE 10 INITRANS 2 MAXTRANS 255 COMPUTE STATISTICS STORAGE(INITIAL 4194304 NEXT 1048576 MINEXTENTS 1 MAXEXTENTS 2147483645 PCTINCREASE 0 FREELISTS 1 FREELIST GROUPS 1 BUFFER_POOL DEFAULT) TABLESPACE "VOIPDATA" ; CREATE INDEX "VOIP"."MONTHLY_BILL_INDEX10" ON "VOIP"."MONTHLY_BILLING_DETAILS" ("CALL_TYPE") PCTFREE 10 INITRANS 2 MAXTRANS 255 COMPUTE STATISTICS STORAGE(INITIAL 4194304 NEXT 1048576 MINEXTENTS 1 MAXEXTENTS 2147483645 PCTINCREASE 0 FREELISTS 1 FREELIST GROUPS 1 BUFFER_POOL DEFAULT) TABLESPACE "VOIPDATA" ; CREATE INDEX "VOIP"."MONTHLY_BILL_INDEX2" ON "VOIP"."MONTHLY_BILLING_DETAILS" ("FROM_EXCHANGE") PCTFREE 10 INITRANS 2 MAXTRANS 255 COMPUTE STATISTICS STORAGE(INITIAL 3145728 NEXT 1048576 MINEXTENTS 1 MAXEXTENTS 2147483645 PCTINCREASE 0 FREELISTS 1 FREELIST GROUPS 1 BUFFER_POOL DEFAULT) TABLESPACE "VOIPDATA" ; CREATE INDEX "VOIP"."MONTHLY_BILL_INDEX3" ON "VOIP"."MONTHLY_BILLING_DETAILS" ("FROM_FULL_TELEPHONE", TRUNC("DATETIME_CONNECT")) PCTFREE 10 INITRANS 2 MAXTRANS 255 COMPUTE STATISTICS STORAGE(INITIAL 65536 NEXT 1048576 MINEXTENTS 1 MAXEXTENTS 2147483645 PCTINCREASE 0 FREELISTS 1 FREELIST GROUPS 1 BUFFER_POOL DEFAULT) TABLESPACE "VOIPDATA" ; CREATE INDEX "VOIP"."MONTHLY_BILL_INDEX4" ON "VOIP"."MONTHLY_BILLING_DETAILS" ("DATETIME_CONNECT", NVL("FROM_FULL_TELEPHONE","CALLINGPARTYNUMBER")) PCTFREE 10 INITRANS 2 MAXTRANS 255 COMPUTE STATISTICS STORAGE(INITIAL 5242880 NEXT 1048576 MINEXTENTS 1 MAXEXTENTS 2147483645 PCTINCREASE 0 FREELISTS 1 FREELIST GROUPS 1 BUFFER_POOL DEFAULT) TABLESPACE "VOIPDATA" ; CREATE INDEX "VOIP"."MONTHLY_BILL_INDEX5" ON "VOIP"."MONTHLY_BILLING_DETAILS" ("DATETIME_CONNECT", NVL("TO_FULL_TELEPHONE","ORIGINALCALLEDPARTYNUMBER")) PCTFREE 10 INITRANS 2 MAXTRANS 255 COMPUTE STATISTICS STORAGE(INITIAL 5242880 NEXT 1048576 MINEXTENTS 1 MAXEXTENTS 2147483645 PCTINCREASE 0 FREELISTS 1 FREELIST GROUPS 1 BUFFER_POOL DEFAULT) TABLESPACE "VOIPDATA" ; CREATE INDEX "VOIP"."MONTHLY_BILL_INDEX6" ON "VOIP"."MONTHLY_BILLING_DETAILS" (TO_CHAR("DATETIME_CONNECT",'fmMONTH YYYY')) PCTFREE 10 INITRANS 2 MAXTRANS 255 COMPUTE STATISTICS STORAGE(INITIAL 4194304 NEXT 1048576 MINEXTENTS 1 MAXEXTENTS 2147483645 PCTINCREASE 0 FREELISTS 1 FREELIST GROUPS 1 BUFFER_POOL DEFAULT) TABLESPACE "VOIPDATA" ; CREATE INDEX "VOIP"."MONTHLY_BILL_INDEX7" ON "VOIP"."MONTHLY_BILLING_DETAILS" ("TO_EXCHANGE") PCTFREE 10 INITRANS 2 MAXTRANS 255 COMPUTE STATISTICS STORAGE(INITIAL 3145728 NEXT 1048576 MINEXTENTS 1 MAXEXTENTS 2147483645 PCTINCREASE 0 FREELISTS 1 FREELIST GROUPS 1 BUFFER_POOL DEFAULT) TABLESPACE "VOIPDATA" ; CREATE INDEX "VOIP"."MONTHLY_BILL_INDEX8" ON "VOIP"."MONTHLY_BILLING_DETAILS" (NVL("FROM_FULL_TELEPHONE","CALLINGPARTYNUMBER")) PCTFREE 10 INITRANS 2 MAXTRANS 255 COMPUTE STATISTICS STORAGE(INITIAL 4194304 NEXT 1048576 MINEXTENTS 1 MAXEXTENTS 2147483645 PCTINCREASE 0 FREELISTS 1 FREELIST GROUPS 1 BUFFER_POOL DEFAULT) TABLESPACE "VOIPDATA" ; CREATE INDEX "VOIP"."MONTHLY_BILL_INDEX9" ON "VOIP"."MONTHLY_BILLING_DETAILS" ("DATETIME_CONNECT") PCTFREE 10 INITRANS 2 MAXTRANS 255 COMPUTE STATISTICS STORAGE(INITIAL 3145728 NEXT 1048576 MINEXTENTS 1 MAXEXTENTS 2147483645 PCTINCREASE 0 FREELISTS 1 FREELIST GROUPS 1 BUFFER_POOL DEFAULT) TABLESPACE "VOIPDATA" ;
These are the functions to determine if a phone number is assigned to multiple staffs or departments:
FUNCTION GET_EMPLOYEE_NAME (P_FROM_FULL_TELEPHONE IN VARCHAR2) RETURN VARCHAR2 AS L_NAME EMPLOYEES.NAME%TYPE; BEGIN SELECT NAME INTO L_NAME FROM EMPLOYEES WHERE WORK_PHONE_1_FORMAT = P_FROM_FULL_TELEPHONE; RETURN L_NAME; EXCEPTION WHEN TOO_MANY_ROWS THEN L_NAME := 'Multiple Employees'; RETURN L_NAME; WHEN NO_DATA_FOUND THEN L_NAME := 'No Employee Assigned'; RETURN L_NAME; WHEN OTHERS THEN NULL; END;
FUNCTION GET_DEPARTMENT_NAME (P_FROM_FULL_TELEPHONE IN VARCHAR2) RETURN VARCHAR2 AS L_DEPT_DESCR EMPLOYEES.DEPT_DESCR%TYPE; BEGIN SELECT DEPT_DESCR INTO L_DEPT_DESCR FROM EMPLOYEES WHERE WORK_PHONE_1_FORMAT = P_FROM_FULL_TELEPHONE; RETURN L_DEPT_DESCR; EXCEPTION WHEN TOO_MANY_ROWS THEN L_DEPT_DESCR := 'Multiple Departments'; RETURN L_DEPT_DESCR; WHEN NO_DATA_FOUND THEN L_DEPT_DESCR := 'No Department Assigned'; RETURN L_DEPT_DESCR; WHEN OTHERS THEN NULL; END;
This is the point of view that I'll use in the report:
CREATE OR REPLACE FORCE VIEW "VOIP"."TOP_USERS_BY_CALLS_V" ("TOP_NO", "EMPLOYEE_NAME", "EMPLOYEE_DEPARTMENT", "PHONE_NUMBER", "QUANTITY_CALLS") AS SELECT ROWNUM, VOIP_PKG.GET_EMPLOYEE_NAME(FROM_FULL_TELEPHONE), VOIP_PKG.GET_DEPARTMENT_NAME(FROM_FULL_TELEPHONE), FROM_FULL_TELEPHONE, QUANTITY_CALLS FROM ( SELECT MBD.FROM_FULL_TELEPHONE, COUNT(1) QUANTITY_CALLS FROM MONTHLY_BILLING_DETAILS MBD WHERE MBD.FROM_FULL_TELEPHONE IS NOT NULL AND MBD.FROM_FULL_TELEPHONE <> '000-000-0000' AND LENGTH(MBD.FROM_FULL_TELEPHONE) = 12 AND LENGTH(MBD.TO_FULL_TELEPHONE) = 12 AND SUBSTR(MBD.TO_FULL_TELEPHONE,1,3) NOT IN (SELECT AREA_CODE FROM NYNJ_METRO_AREA_CODES) AND SUBSTR(MBD.TO_FULL_TELEPHONE,1,3) NOT IN ('800','822','833','844', '855','866','877','888') GROUP BY MBD.FROM_FULL_TELEPHONE ORDER BY QUANTITY_CALLS DESC ) WHERE ROWNUM <= 100;
Explain Plan output and Extended SQL Trace:
SQL> SQL> show parameter user_dump_dest NAME TYPE VALUE ------------------------------------ ----------- ------------------------------ user_dump_dest string D:\ORACLEHOMES\ADMIN\RTS9\UDUM P SQL> SQL> show parameter optimizer NAME TYPE VALUE ------------------------------------ ----------- ------------------------------ optimizer_dynamic_sampling integer 2 optimizer_features_enable string 10.2.0.5 optimizer_index_caching integer 0 optimizer_index_cost_adj integer 100 optimizer_mode string ALL_ROWS optimizer_secure_view_merging boolean TRUE SQL> SQL> show parameter db_file_multi NAME TYPE VALUE ------------------------------------ ----------- ------------------------------ db_file_multiblock_read_count integer 16 SQL> SQL> show parameter db_block_size NAME TYPE VALUE ------------------------------------ ----------- ------------------------------ db_block_size integer 8192 SQL> SQL> show parameter cursor_sharing NAME TYPE VALUE ------------------------------------ ----------- ------------------------------ cursor_sharing string EXACT SQL> SQL> column sname format a20 SQL> column pname format a20 SQL> column pval2 format a20 SQL> SQL> select 2 sname 3 , pname 4 , pval1 5 , pval2 6 from 7 sys.aux_stats$; SNAME PNAME PVAL1 PVAL2 -------------------- -------------------- ---------- -------------------- SYSSTATS_INFO STATUS COMPLETED SYSSTATS_INFO DSTART 02-09-2009 15:46 SYSSTATS_INFO DSTOP 02-09-2009 15:46 SYSSTATS_INFO FLAGS 1 SYSSTATS_MAIN CPUSPEEDNW 1259.6206 SYSSTATS_MAIN IOSEEKTIM 10 SYSSTATS_MAIN IOTFRSPEED 4096 SYSSTATS_MAIN SREADTIM SYSSTATS_MAIN MREADTIM SYSSTATS_MAIN CPUSPEED SYSSTATS_MAIN MBRC SYSSTATS_MAIN MAXTHR SYSSTATS_MAIN SLAVETHR 13 rows selected. Elapsed: 00:00:00.03 SQL> SQL> explain plan for 2 SELECT 3 TOP_NO, 4 EMPLOYEE_NAME, 5 EMPLOYEE_DEPARTMENT, 6 PHONE_NUMBER, 7 QUANTITY_CALLS 8 FROM 9 TOP_USERS_BY_CALLS_V 10 ORDER BY 11 QUANTITY_CALLS DESC; Explained. Elapsed: 00:00:00.18 SQL> SQL> select * from table(dbms_xplan.display); PLAN_TABLE_OUTPUT ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- Plan hash value: 826236322 ---------------------------------------------------------------------------------------------------------------- | Id | Operation | Name | Rows | Bytes | Cost (%CPU)| Time | ---------------------------------------------------------------------------------------------------------------- | 0 | SELECT STATEMENT | | 1 | 4042 | 1313 (1)| 00:00:16 | | 1 | SORT ORDER BY | | 1 | 4042 | 1313 (1)| 00:00:16 | | 2 | VIEW | TOP_USERS_BY_CALLS_V | 1 | 4042 | 1312 (1)| 00:00:16 | |* 3 | COUNT STOPKEY | | | | | | | 4 | VIEW | | 1 | 25 | 1312 (1)| 00:00:16 | |* 5 | SORT ORDER BY STOPKEY | | 1 | 26 | 1312 (1)| 00:00:16 | | 6 | HASH GROUP BY | | 1 | 26 | 1312 (1)| 00:00:16 | |* 7 | FILTER | | | | | | |* 8 | TABLE ACCESS BY INDEX ROWID| MONTHLY_BILLING_DETAILS | 1 | 26 | 1310 (1)| 00:00:16 | |* 9 | INDEX FULL SCAN | MONTHLY_BILL_INDEX3 | 934 | | 449 (1)| 00:00:06 | |* 10 | INDEX FULL SCAN | NYNJ_METRO_AREA_CODES_UK1 | 1 | 4 | 1 (0)| 00:00:01 | ---------------------------------------------------------------------------------------------------------------- Predicate Information (identified by operation id): --------------------------------------------------- 3 - filter(ROWNUM<=100) 5 - filter(ROWNUM<=100) 7 - filter( NOT EXISTS (SELECT 0 FROM VOIP."NYNJ_METRO_AREA_CODES" "NYNJ_METRO_AREA_CODES" WHERE LNNVL("AREA_CODE"<>SUBSTR(:B1,1,3)))) 8 - filter(LENGTH("MBD"."TO_FULL_TELEPHONE")=12 AND SUBSTR("MBD"."TO_FULL_TELEPHONE",1,3)<>'800' AND SUBSTR("MBD"."TO_FULL_TELEPHONE",1,3)<>'822' AND SUBSTR("MBD"."TO_FULL_TELEPHONE",1,3)<>'833' AND SUBSTR("MBD"."TO_FULL_TELEPHONE",1,3)<>'844' AND SUBSTR("MBD"."TO_FULL_TELEPHONE",1,3)<>'855' AND SUBSTR("MBD"."TO_FULL_TELEPHONE",1,3)<>'866' AND SUBSTR("MBD"."TO_FULL_TELEPHONE",1,3)<>'877' AND SUBSTR("MBD"."TO_FULL_TELEPHONE",1,3)<>'888') 9 - filter(LENGTH("MBD"."FROM_FULL_TELEPHONE")=12 AND "MBD"."FROM_FULL_TELEPHONE"<>'000-000-0000' AND "MBD"."FROM_FULL_TELEPHONE" IS NOT NULL) 10 - filter(LNNVL("AREA_CODE"<>SUBSTR(:B1,1,3))) 33 rows selected. Elapsed: 00:00:00.82 SQL> SQL> rollback; Rollback complete. Elapsed: 00:00:00.00 SQL> SQL> set autotrace traceonly arraysize 100 SQL> SQL> alter session set tracefile_identifier = 'mytrace1'; Session altered. Elapsed: 00:00:00.01 SQL> SQL> alter session set events '10046 trace name context forever, level 8'; Session altered. Elapsed: 00:00:00.15 SQL> SQL> SELECT 2 TOP_NO, 3 EMPLOYEE_NAME, 4 EMPLOYEE_DEPARTMENT, 5 PHONE_NUMBER, 6 QUANTITY_CALLS 7 FROM 8 TOP_USERS_BY_CALLS_V 9 ORDER BY 10 QUANTITY_CALLS DESC; 100 rows selected. Elapsed: 00:10:37.68 Execution Plan ---------------------------------------------------------- Plan hash value: 826236322 ---------------------------------------------------------------------------------------------------------------- | Id | Operation | Name | Rows | Bytes | Cost (%CPU)| Time | ---------------------------------------------------------------------------------------------------------------- | 0 | SELECT STATEMENT | | 1 | 4042 | 1313 (1)| 00:00:16 | | 1 | SORT ORDER BY | | 1 | 4042 | 1313 (1)| 00:00:16 | | 2 | VIEW | TOP_USERS_BY_CALLS_V | 1 | 4042 | 1312 (1)| 00:00:16 | |* 3 | COUNT STOPKEY | | | | | | | 4 | VIEW | | 1 | 25 | 1312 (1)| 00:00:16 | |* 5 | SORT ORDER BY STOPKEY | | 1 | 26 | 1312 (1)| 00:00:16 | | 6 | HASH GROUP BY | | 1 | 26 | 1312 (1)| 00:00:16 | |* 7 | FILTER | | | | | | |* 8 | TABLE ACCESS BY INDEX ROWID| MONTHLY_BILLING_DETAILS | 1 | 26 | 1310 (1)| 00:00:16 | |* 9 | INDEX FULL SCAN | MONTHLY_BILL_INDEX3 | 934 | | 449 (1)| 00:00:06 | |* 10 | INDEX FULL SCAN | NYNJ_METRO_AREA_CODES_UK1 | 1 | 4 | 1 (0)| 00:00:01 | ---------------------------------------------------------------------------------------------------------------- Predicate Information (identified by operation id): --------------------------------------------------- 3 - filter(ROWNUM<=100) 5 - filter(ROWNUM<=100) 7 - filter( NOT EXISTS (SELECT 0 FROM VOIP."NYNJ_METRO_AREA_CODES" "NYNJ_METRO_AREA_CODES" WHERE LNNVL("AREA_CODE"<>SUBSTR(:B1,1,3)))) 8 - filter(LENGTH("MBD"."TO_FULL_TELEPHONE")=12 AND SUBSTR("MBD"."TO_FULL_TELEPHONE",1,3)<>'800' AND SUBSTR("MBD"."TO_FULL_TELEPHONE",1,3)<>'822' AND SUBSTR("MBD"."TO_FULL_TELEPHONE",1,3)<>'833' AND SUBSTR("MBD"."TO_FULL_TELEPHONE",1,3)<>'844' AND SUBSTR("MBD"."TO_FULL_TELEPHONE",1,3)<>'855' AND SUBSTR("MBD"."TO_FULL_TELEPHONE",1,3)<>'866' AND SUBSTR("MBD"."TO_FULL_TELEPHONE",1,3)<>'877' AND SUBSTR("MBD"."TO_FULL_TELEPHONE",1,3)<>'888') 9 - filter(LENGTH("MBD"."FROM_FULL_TELEPHONE")=12 AND "MBD"."FROM_FULL_TELEPHONE"<>'000-000-0000' AND "MBD"."FROM_FULL_TELEPHONE" IS NOT NULL) 10 - filter(LNNVL("AREA_CODE"<>SUBSTR(:B1,1,3))) Statistics ---------------------------------------------------------- 365 recursive calls 0 db block gets 689543 consistent gets 212906 physical reads 0 redo size 5984 bytes sent via SQL*Net to client 400 bytes received via SQL*Net from client 2 SQL*Net roundtrips to/from client 2 sorts (memory) 0 sorts (disk) 100 rows processed SQL> SQL> disconnect
Part of the automatic trace output:
SELECT TOP_NO, EMPLOYEE_NAME, EMPLOYEE_DEPARTMENT, PHONE_NUMBER, QUANTITY_CALLS FROM TOP_USERS_BY_CALLS_V ORDER BY QUANTITY_CALLS DESC call count cpu elapsed disk query current rows ------- ------ -------- ---------- ---------- ---------- ---------- ---------- Parse 1 0.00 0.43 0 0 0 0 Execute 1 0.00 0.00 0 0 0 0 Fetch 2 24.70 635.81 212587 631823 0 100 ------- ------ -------- ---------- ---------- ---------- ---------- ---------- total 4 24.70 636.25 212587 631823 0 100 Misses in library cache during parse: 1 Optimizer mode: ALL_ROWS Parsing user id: 148 Rows Row Source Operation ------- --------------------------------------------------- 100 SORT ORDER BY (cr=689531 pr=212900 pw=0 time=636823070 us) 100 VIEW TOP_USERS_BY_CALLS_V (cr=689531 pr=212900 pw=0 time=642681672 us) 100 COUNT STOPKEY (cr=631823 pr=212587 pw=0 time=635667026 us) 100 VIEW (cr=631823 pr=212587 pw=0 time=635666810 us) 100 SORT ORDER BY STOPKEY (cr=631823 pr=212587 pw=0 time=635666493 us) 2512 HASH GROUP BY (cr=631823 pr=212587 pw=0 time=635666125 us) 27112 FILTER (cr=631823 pr=212587 pw=0 time=519230237 us) 315563 TABLE ACCESS BY INDEX ROWID MONTHLY_BILLING_DETAILS (cr=381523 pr=212587 pw=0 time=580209555 us) 394473 INDEX FULL SCAN MONTHLY_BILL_INDEX3 (cr=2679 pr=2679 pw=0 time=26793918 us)(object id 206675) 226627 INDEX FULL SCAN NYNJ_METRO_AREA_CODES_UK1 (cr=250300 pr=0 pw=0 time=3575488 us)(object id 206605) Elapsed times include waiting on following events: Event waited on Times Max. Wait Total Waited ---------------------------------------- Waited ---------- ------------ SQL*Net message to client 2 0.00 0.00 db file sequential read 212587 0.20 611.67 SQL*Net message from client 2 0.00 0.00 SQL*Net more data to client 2 0.00 0.00 ********************************************************************************
DBMS_XPLAN. Output DISPLAY_CURSOR:
SQL> SQL> select * from table(dbms_xplan.display_cursor(null, null, 'ALLSTATS LAST')); PLAN_TABLE_OUTPUT ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- SQL_ID 1ut636vt58jdw, child number 0 ------------------------------------- SELECT /*+ gather_plan_statistics */ TOP_NO, EMPLOYEE_NAME, EMPLOYEE_DEPARTMENT, PHONE_NUMBER, QUANTITY_CALLS FROM TOP_USERS_BY_CALLS_V ORDER BY QUANTITY_CALLS DESC Plan hash value: 826236322 -------------------------------------------------------------------------------------------------------------------------------------------------------------- | Id | Operation | Name | Starts | E-Rows | A-Rows | A-Time | Buffers | Reads | OMem | 1Mem | Used-Mem | -------------------------------------------------------------------------------------------------------------------------------------------------------------- | 0 | SELECT STATEMENT | | 1 | | 100 |00:09:56.06 | 689K| 210K| | | | | 1 | SORT ORDER BY | | 1 | 1 | 100 |00:09:56.06 | 689K| 210K| 13312 | 13312 |12288 (0)| | 2 | VIEW | TOP_USERS_BY_CALLS_V | 1 | 1 | 100 |00:10:04.98 | 689K| 210K| | | | |* 3 | COUNT STOPKEY | | 1 | | 100 |00:09:54.89 | 631K| 210K| | | | | 4 | VIEW | | 1 | 1 | 100 |00:09:54.89 | 631K| 210K| | | | |* 5 | SORT ORDER BY STOPKEY | | 1 | 1 | 100 |00:09:54.88 | 631K| 210K| 6144 | 6144 | 6144 (0)| | 6 | HASH GROUP BY | | 1 | 1 | 2512 |00:09:54.88 | 631K| 210K| 821K| 821K| 1153K (0)| |* 7 | FILTER | | 1 | | 27112 |00:08:58.57 | 631K| 210K| | | | |* 8 | TABLE ACCESS BY INDEX ROWID| MONTHLY_BILLING_DETAILS | 1 | 1 | 315K|00:08:57.07 | 381K| 210K| | | | |* 9 | INDEX FULL SCAN | MONTHLY_BILL_INDEX3 | 1 | 934 | 394K|00:00:23.02 | 2679 | 2679 | | | | |* 10 | INDEX FULL SCAN | NYNJ_METRO_AREA_CODES_UK1 | 250K| 1 | 226K|00:00:03.47 | 250K| 0 | | | | -------------------------------------------------------------------------------------------------------------------------------------------------------------- Predicate Information (identified by operation id): --------------------------------------------------- 3 - filter(ROWNUM<=100) 5 - filter(ROWNUM<=100) 7 - filter( IS NULL) 8 - filter((LENGTH("MBD"."TO_FULL_TELEPHONE")=12 AND SUBSTR("MBD"."TO_FULL_TELEPHONE",1,3)<>'800' AND SUBSTR("MBD"."TO_FULL_TELEPHONE",1,3)<>'822' AND SUBSTR("MBD"."TO_FULL_TELEPHONE",1,3)<>'833' AND SUBSTR("MBD"."TO_FULL_TELEPHONE",1,3)<>'844' AND SUBSTR("MBD"."TO_FULL_TELEPHONE",1,3)<>'855' AND SUBSTR("MBD"."TO_FULL_TELEPHONE",1,3)<>'866' AND SUBSTR("MBD"."TO_FULL_TELEPHONE",1,3)<>'877' AND SUBSTR("MBD"."TO_FULL_TELEPHONE",1,3)<>'888')) 9 - filter((LENGTH("MBD"."FROM_FULL_TELEPHONE")=12 AND "MBD"."FROM_FULL_TELEPHONE"<>'000-000-0000' AND "MBD"."FROM_FULL_TELEPHONE" IS NOT NULL)) 10 - filter(LNNVL("AREA_CODE"<>SUBSTR(:B1,1,3))) 35 rows selected. Elapsed: 00:00:00.50 SQL> SQL> spool off
Any help will be greatly appreciated. Please let me know if you need additional information.
Thank you
Erick
ediazjorge wrote:
Please let me know if you need additional information or do additional tests.
Thanks again!
Erick
It's to you if you are satisfied or interested in improvements (if possible).
If so the first thing I would like if you had your refreshed perspective as advised. According to expected area_code table cardinalities I doubt.
So, if not cool off with dbms_stats.gather_table_stats on two tables, area_codes and MONTHLY_BILLING_DETAILS.
Bottlenecks are now obviously the full table of MONTHLY_BILLING_DETAILS as well as the ANTI of LOOPS IMBRIQUEES scan.
At the moment I don't think that an index of MONTHLY_BILLING_DETAILS will help a lot, because most of the lines will pass filter predicates, and because we need some columns in it, I have now I there will be gain a full index scan.
I was surprissed that the optimizer pushes the substr <> predicates to both tables.
So depending on your data, you might try
1 make a factory of subquery select the two MONTHLY_BILLING_DETAILS columns that all directly apply predicates of membership and use it directly in the join instead of the table.
or
2. If all subtr to so are part of the table area_code choose in it using a subquery (or inline view) plant excluding these values.
Both are attempts to get rid of the substr excluding as filters of join predicates.
In fact, I was expecting a hash join anti as shown in the plan to explain instead of the nested loops anti, I expect to be more effective in this case.
Perhaps with correct cardinalities the optimizier would understand himself.
Just to test it, you can try the use_hash hint in the join:
Select / * + USE_HASH (MBD, one) * /.
..
OF MONTHLY_BILLING_DETAILS MBD,.
NYNJ_METRO_AREA_CODES one
(It's a good habit anyway usually use aliases and precede the names of columns. In the, it is easier to read queries are only trivial).
-
DA on updatable report items Sql query using the class
Request Express 4.2.5.00.08
10-11 g Oracle
I have a page, so it has a link/button when he clicks then modal region will appear. Modal region has a as a table (Type SQL Query (updateable report)). All work very well so far.
However, I've now added some complex things.
for example. My region is based on the query of SQL Type (editable report).
SELECT id, name of family, Traghetti, area, d_date, start_time, End_time, displacement, role of table where id =: P10_ID;
I can also add a new line of course.
My problem is, (point) Shift display based on the value of Start_Time point) and so I made sure the class for two items.
for example, Start_Time (' class = "st_tm" ') and Maj ('class to = "Shift_time" '). Start_Time is based on (LOV) and shift is off the point in the sql query, but change the Start_Time.
And now, I created the DA.
1. event: change
Selection type: jQuery Selector
jQuery Selector: .st_tm
Condition: No.
1. action: set value
Set type: Expression Javascript
The JavaScript Expression: $(this.triggeringElement) .val ();
The element affected: P10_X1 (it is a hidden item)
2. action: Plsql Code
Code: start to null; end;
Page items to submit: P10_X1
3. action: Plsql Code
Code: start
If: P10_X1 between '03' AND '11' then
: P10_X1: = 'EARLIES ';
elsif: P10_X1 then '12' and '18'
: P10_X1: = 'LATES ';
on the other
: P10_X1: = 'NIGHTS';
end if;
end;
Page items to submit: P10_X1
NOW another DA
Event: change
Article (s) P10_X1
Condition (in list)
value (HASTY, LATES, NIGHTS)
Action:
Set type: Expression Javascript
The JavaScript Expression: $(this.triggeringElement) .val ();
Affected item:
Selection type: jQuery Selector
jQuery Selector:. Shift_time
Well, I look forward all the above work well, but I'm having a problem.
If I have more than 1 lines on a modal region and if I change the Start_Time value for a row then MAJ (point) is changing but he effect on all lines.
I want, if I make the changes on the line line # 2 while only 2 # MAJ (point) must be not performed any other lines?
Help, please!
Kind regards
RI
I found the solution me thank you.
I removed all the DA mentioned above and created a new.
1. event: change
Selection type: jQuery Selector
jQuery Selector: .st_tm
Condition: No.
Scope of the event: dynamic and light on page load.
Action (Javascript code)
ROW_ID = $(this.triggeringElement).attr('id').substr (4);
If ($(this.triggeringElement). val() > = 03 &. val() $(this.triggeringElement))<= 11)="">=>
.Val ('EARLIES') $(«#f11_» + row_id);
}
ElseIf ($(this.triggeringElement). > 11 val() & $(this.triggeringElement). val())<= 18)="">=>
.Val ('LATES') $(«#f11_» + row_id);
}
ElseIf (. val() > $19 (this.triggeringElement)) {}
.Val ('NIGHTS') $(«#f11_» + row_id);
}
also created another DA because I have a disabled report items.
Event: before the page is sent.
$('_:_disabled').removeAttr ("disabled");
and finally created manual process of DML for tabular and everything works fine. (Insert, Update, and delete).
Kind regards.
Maybe you are looking for
-
Using annotate preview - delete + insert?
Hello I just started to use the feature to annotate previews for annotate PDFs on a MacBook Pro, after you use the GoodReader app on an iPad. In GR, there is a way to expunge erroneous text and insert the correct text in a single action that perfectl
-
Satellite Pro P100: I need to remove some software before installing Vista
My Satellite Pro P100 needs the following software uninstalled before installing Vista: -.Norton Internet SecurityBluetooth Stack for Windows by ToshibaConfigFree Toshiba has plans to release a version of Vista the last two?
-
Error 1335: Data1.cab corrupt or the source file is damaged and can not download
Recently I formatted my hard drive and installed windows xp professional 64-bit and had no problem installing updates automatic and all my drivers but then a few reboots later, after installation I started to receive an error message saying "the sour
-
Microsoft can't! for Windows XP onWindows installed XP Media Center Edition?
I own more Microsoft for Windows XP and used on my previous pc. My current computer is Windows XP Media Center Edition installed. System requirements for Windows XP Home and professional list. It will work on Media Center? Is there an advantage t
-
Eclipse Blackberry plug-in: "run as" problem with build.xml
Hello I use windows 7 (32 bit), Eclipse 3.5 with the blackberry plugin. I created a very simple "helloworld" "TestBuild" blackberry project that uses build.xml to build. Here's buildRIM desciption I used in build.xml jdkhome = "C:\Program Files\Ja