help on SQL JOIN Conversion of ANSI STANDARD
SELECT Q.FLDQUESTION, Q.FLDCMNTPRMT, Q.FLDISHEAD, Q.FLDCODE, M.FLDDATA, A.FLDYESNO, C.FLDDATAOF CANQSTN Q,.
LOGCAANS, A.
CANQSTN_MEMO M.
C LOGCAANS_MEMO
WHERE A.FLDCASE =? AND
Q.FLDCODE = A.FLDQUESTION AND
Q.FLDPOSSCACT * = M.FLDREC_NUM (+) AND
A.FLDCOMMENT * = C.FLDREC_NUM (+)
ORDER BY A.FLDSEQUENCE
This request must be converted to ANSI Standard SQL JOIN.
SELECT Q.FLDQUESTION, Q.FLDCMNTPRMT, Q.FLDISHEAD, Q.FLDCODE, M.FLDDATA, A.FLDYESNO, C.FLDDATA
OF (inner CANQSTN Q join A LOGCAANS on Q.FLDCODE = A.FLDQUESTION)
LEFT OUTER JOIN CANQSTN_MEMO M ON Q.FLDPOSSCACT = M.FLDREC_NUM
Here, I stuck with join remaining 2 tables A.FLDCOMMENT * = C.FLDREC_NUM (+)
could you any body please help me on this query.
JOURNAL OF LOGCAANS, CANQSTN TABLES REFERENCES.
Hello, here is the equivalent ANSI JOIN:
SELECT Q.FLDQUESTION, Q.FLDCMNTPRMT, Q.FLDISHEAD, Q.FLDCODE,
M.FLDDATA, A.FLDYESNO, C.FLDDATA
FROM CANQSTN Q
JOIN LOGCAANS ON (Q.FLDCODE = A.FLDQUESTION)
LEFT JOIN CANQSTN_MEMO M ON (Q.FLDPOSSCACT = M.FLDREC_NUM)
LEFT JOIN LOGCAANS_MEMO C ON (A.FLDCOMMENT = C.FLDREC_NUM)
WHERE A.FLDCASE = ?
ORDER BY A.FLDSEQUENCE;
Tags: Database
Similar Questions
-
What is the new method of SQL joins
Dear all,
What is the new method of SQL joins
1
SELECT <fields> FROM TableA a INNER JOIN TableB b ON a.key = b.key
2
SELECT <fields> FROM TableA a, TableB b WHERE a.key = b.key
Above the two queries work very well in PL/SQL, but request that no 1 does not work in Oracle Forms 10 g
Kind regards
Zafar Iqbal
Hello
Zafar Iqbal wrote:
Dear all,
What is the new method of SQL joins
1
- SELECT
- TableA, TableB INNER JOIN a and b WE a.key, b.key =
2
- SELECT
- FROM TableA, TableB b
- WHERE a.key, b.key =
Above the two queries work very well in PL/SQL, but request that no 1 does not work in Oracle Forms 10 g
Kind regards
Zafar Iqbal
What, exactly, is your question?
Literally ask you which of these 2 methods is new? As mentioned above, none is really new. Both participated in Oracle at least 13 years.
Query 1, above, ANSI join syntax uses, which is more recent. As mentioned above, Oracle has started to support that the syntax in version 9.1 (2001) previous versions only supported syntax used in query 2.
Did you mean to ask something else? Maybe "How can I use a query as a query 1 forms?" or "are there other places where a method works, but the other is not?
- SELECT
-
JOIN the traditional ANSI JOIN VS.
I am running Oracle 11 g R2 on my Win7 home x 64 Enterprise for a relational data base class.
An exercise said to display the id of shopping cart, product id, product name and description of the product for all items ordered using a traditional join and an ANSI join.
Traditional join:
SELECT p.productname, p.description, bi.idproduct and bi.idbasket
of BB_BASKETITEM bi, BB_PRODUCT p
where bi.idproduct = p.idproduct;
Join ANSI:
SELECT productname, description, idproduct and idbasket
of BB_BASKETITEM
JOIN INTERNAL BB_PRODUCT
using (idProduct);
Both produce the same results.
The next exercise said to add the name of the customer for both queries. I got the traditional join to work:
SELECT s.lastname as "Customer Name", bi.idbasket, bi.idproduct, p.productname, p.description
BI BB_BASKETITEM, BB_PRODUCT p, BB_SHOPPER s, BB_BASKET b
where bi.idproduct = p.idproduct
and bi.idbasket = b.idbasket
and b.idshopper = s.idshopper;
but I can't understand how to convert the traditional join in ANSI format.
I checked the docs of the Oracle, but I can't find an example that uses more than two tables. I searched in the OTN forums, without a moment of ' AHA! '. One manual sorta, kinda discusses vs ANSI joins traditional.
I have tried to provide the sample results, but all turned to mush in the preview. My apologies.
Thanks for your help.
Provisions of tables are:
CREATE TABLE BB_Product)
idProduct number (2),
ProductName varchar2 (25).
Description varchar2 (100),
ProductImage varchar2 (25).
Price number (6.2),
SaleStart date,
Date of SaleEnd,
SalePrice number (6.2),
Number (1) active,.
Number (1) recommended.
Date of FeatureStart,
Date of FeatureEnd,
Type char(1),
idDepartment number (2),
Prod_id_pk KEY (idProduct) PRIMARY, the CONSTRAINT
CONSTRAINT prod_idDept_fk FOREIGN KEY (idDepartment)
REFERENCES BB_Department (idDepartment));
CREATE TABLE BB_Shopper)
idShopper number 4,
First name varchar2 (15).
LastName varchar2 (20).
Address varchar2 (40),
City varchar2 (20).
(2) tank, the State
Code postal varchar2 (15).
Phone varchar2 (10),
Fax varchar2 (10),
E-mail varchar2 (25).
Username varchar2 (8).
Varchar2 (8) password,.
Number 4 of cookie by DEFAULT 0,
date of dtEntered by DEFAULT SYSDATE,
Varchar2 (15) of the province.
Country varchar2 (15).
CONSTRAINT shopper_id_pk KEY (idShopper) primary SCHOOL);
CREATE TABLE bb_Basket)
idBasket number (5),
Quantity number (2),
idShopper number 4,
OrderPlaced number (1).
Total part number (7.2).
The number total (7.2).
Number (5.2) of the expedition.
Number (5.2) tax.
date of dtCreated by DEFAULT SYSDATE,
Promo number (2),
ShipFirstName varchar2 (10),
ShipLastName varchar2 (20).
ShipAddress varchar2 (40),
ShipCity varchar2 (20).
ShipState varchar2 (2),
ShipZipCode varchar2 (15).
ShipPhone varchar2 (10),
ShipFax varchar2 (10),
ShipEmail varchar2 (25).
BillFirstName varchar2 (10),
BillLastName varchar2 (20).
BillAddress varchar2 (40),
BillCity varchar2 (20).
BillState varchar2 (2),
BillZipCode varchar2 (15).
BillPhone varchar2 (10),
BillFax varchar2 (10),
BillEmail varchar2 (25).
date of dtOrdered by DEFAULT SYSDATE,
ShipProvince varchar2 (20).
ShipCountry varchar2 (20).
BillProvince varchar2 (20).
BillCountry varchar2 (20).
CardType char(1),
CardNumber varchar2 (20).
ExpMonth tank (2),
ExpYear char (4),
CardName varchar2 (25).
char (1) default 'n' shipbill,
Default char (1) ShipFlag 'n',
Bskt_id_pk KEY (idBasket) PRIMARY, the CONSTRAINT
CONSTRAINT bskt_idshopper_fk FOREIGN KEY (idShopper)
REFERENCES bb_Shopper (idShopper));
CREATE TABLE bb_basketItem)
idBasketItem number (2),
idProduct number (2),
Price number (6.2),
Quantity number (2),
idBasket number (5),
option 1 number (2),
option2 number (2),
CONSTRAINT bsktitem_id_pk PRIMARY KEY (idBasketItem).
CONSTRAINT bsktitem_bsktid_fk FOREIGN KEY (idBasket)
REFERENCES bb_Basket (idBasket),
CONSTRAINT bsktitem_idprod_fk FOREIGN KEY (idproduct)
REFERENCES bb_Product (idproduct));I just want to say that I appreciate your question well formatted and fully formed :-) Thanks for providing descriptions of table and oracle version number.
Try this:
SELECT s.lastname as "Customer Name", bi.idbasket, bi.idproduct, p.productname, p.description from BB_BASKETITEM bi join BB_PRODUCT p on (p.idproduct = bi.idproduct) join BB_BASKET b on (b.idbasket = bi.idbasket) join BB_SHOPPER s on (s.idshopper = b.idshopper);
-
Under Update taking 2 h complete 3000 sets.
UPDATE ARR_TRANSACTIONS ARR
SET = NUMBER99
(SELECT ARR_1.NUMBER99
OF ARR_TRANSACTIONS ARR_1, ARR_HEADER BH
WHERE ARR_1.ARR_ID = BH. ARR_ID
AND BH. FLAG = "Y".
AND ARR_1.LINE_ID = ARR. ORIG_INV_LINE_ID
AND ARR_1.NUMBER9 IS NOT NULL
AND ROWNUM = 1)
WHERE ARR BATCH_ID = 26219
AND ARR. NUMBER99 IS NULL
I added more some condition where to reduce cost and its working fine. But I need to rise more than performance on SQL.
Please help with SQL.
I do not see the number of 3000 lines in the plan - so I guess that the optimizer does not compute with the correct numbers. Could generate the plan with dbms_xplan.display_cursor? This could tell us something about filter predicates and access.
In the given situation, I would check:
- is the access to the index in step 1 (filtered by the relevant conditions: this could be BATCH_ID = 26219) return actually 248 entries (or something similar)?
- Access table in step 2 returning 204 lines (or something similar) after applying the filters given? If the number of lines is much bigger then a Nested Loops is perhaps not a good idea.
To make this much simpler check, you could create a plan with statistics of content (RowSource) given that the plan containing the real and the number of estimated rows.
If the estimated cardinalities are not plausible the next question would be if the statistics are strong and up to date.
-
Need help to download Adobe Creative suite 6 standard in on a mac
Need help download Adobe Creative suite 6 standard in a Mac Need help to download Adobe Creative suite 6 standard in on a mac
Hi, Norma.
To find your serial number, sign in to your Adobe account Adobe: creative, marketing, and document management solutions .
On the page for managing accounts that appears, all of your registered products and their serial numbers are listed in the section Plans & products.
Let me know if it helps.
Concerning
Megha Rawat
-
need help on the conversion of ANSI sql
Existing query:
Select (list of the columns in the list of tables) SPANS A, EMPANS_MEMO M, QSTLINK L, QSTN Q
WHERE A.FLDCOMMENT = M.FLDREC_NUM (+) AND L.FLDFORM =? AND L.FLDQUESTION = A.FLDQUESTION AND L.FLDROLLOVER = 'y' AND Q.FLDCODE = L.FLDQUESTION AND
(Q.FLDINACTIVE IS NULL OR Q.FLDINACTIVE <>'y')
Converted ANSI:
Select (list columns from the list of tables) SPANS A LEFT JOIN OUTER EMPANS_MEMO M on (A.FLDCOMMENT = M.FLDREC_NUM)
INNER JOIN QSTLINK ON (A.FLDQUESTION = L.FLDQUESTION) L
INNER JOIN QSTN Q ON (L.FLDQUESTION = Q.FLDCODE)
WHERE L.FLDFORM =? AND L.FLDROLLOVER = 'y' AND
(Q.FLDINACTIVE IS NULL OR Q.FLDINACTIVE <>'y')
could you any body let me know, - is this correct.
Thank you for your support.The order of the joins is not important, as long as the columns referred to in the JOIN conditions have been mentioned previously.
JOIN is the abbreviation of INNER JOINand LEFT JOIN is short for LEFT OUTER JOIN.
-
Hi all
I need assistance with SQL FULL OUTER JOIN.
How to write with FULL OUTER JOIN, the query.
I tried like
I have 3 different queries.
Query q: SELECT emp_id LN.emp_id.
Sum (LN_amount) loan_amt
MY_LON_TAB LN
WHERE LN_amount > 20000
LN.emp_id GROUP;
Query b: SELECT PLN. EMP_ID emp_id,
Sum (PLAN_AMOUNT) plan_amt
FROM PLN MY_PLAN_TAB
where PLAN_AMOUNT <>0
GROUP BY PLN. EMP_ID;
Query C:
SELECT FLX. EMP_ID emp_id,
SUM (PRORATE_AMOUNT) PRORATE_AMT
OF MY_FLX_TAB FLX
WHERE PRORATE_AMOUNT <>0
FLX GROUP. EMP_ID;
Suppose that the different subquery above 3 a, b, c respectively. each subquery with emp_id and respective amount.
like a.emp_id, a.loan_amt
b.emp_id, b.plan_amt
c.emp_id, c.prorate_amt
I show all the empid with their amount respective.
schenario: If an account made, but not vice-versa b
and B have record, but not vice versa c
and a credit record but not vice versa c
first: I have external is associated with the A and B
Second: join external then complete the total outcome of (a & b) with c
but empid c just as empty.
My output is:
emp_id a.loan_amt, b.plan_amt c.prorate_amt
101 5000 null null
102 4500 null 2000
103 6700 null null
How to solve the foregoing to the ANSI (FULL OUTER JOIN) method.
Please suggest me.
Thanks in advance...
PKMHello
It is very difficult for anyone to say what you're doing wrong if they do not know what you are doing. Post your code FULL OUTER JOIN.
My best guess is:WITH a AS ( SELECT ... -- What you posted as query a ) , b AS ( SELECT ... -- What you posted as query b ) , c AS ( SELECT ... -- What you posted as query c ) SELECT COALESCE ( a.emp_id , b.emp_id , c.emp_id ) AS emp_id , ... -- whatever other columns you want FROM a FULL OUTER JOIN b ON b.emp_id = a.emp_id FULL OUTER JOIN c ON c.emp_id = COALESCE (a.emp_id, b.emp_id) ;
I hope that answers your question.
If not, post a small example (CREATE TABLE and INSERT statements) data for all tables and the results expected from these data (if not what you have already posted). -
Hello friends,
.
I am trying to query a record of two Emp and Dept tables, I would like to know where employee works (location is stored in)
the Dept table) and would like to employee knowledge belongs to what manager Id stored in the Emp table.
The query below don't give me the desired output. Please suggest me something.
SELECT
E1. EMPNO,
E1. ENAME,
E1. EMPLOYMENT,
E1. SAL,
E1. DEPTNO,
TO_CHAR (E1. HIREDATE, 'DD-MM-YYYY') HIRE_DATE,.
D.LOC,
E1. ENAME Manager
EMP E1, E2 EMP, DEPT. D
WHERE E1. DEPTNO = D.DEPTNO
AND E2. MGR = E1. EMPNO;
HadNext time ask similar questions in the sql forum
SQL and PL/SQLAnswer to your question is
(based on the assumption MGR_NO column exists and is Manager empno)
SELECT E1. EMPNO,
E1. ENAME,
E1. EMPLOYMENT,
E1. SAL,
E1. DEPTNO,
TO_CHAR (E1. HIREDATE, 'DD-MM-YYYY') HIRE_DATE,.
D.LOC,
E2. ENAME Manager
EMP E1, E2 EMP, DEPT. D
WHERE E1. DEPTNO = D.DEPTNO AND E2. EMPNO = E1. MGR_NO; -
Hi guys,.
IM pretty new to this, it would be really grateful for the help if possible.
currently I have 3 tables, a customer table (contains information about the client, such as name, address, etc.), a table reservation (contains the booking reference, meeting_date and time, etc.) and a table of customer_booking (contains the client and the booking id). I want to be able to do is write a select statement that retrieves the details of the customer as well as their last meeting date (column meeting_date in table of booking). -What someone would be kind enough to help me, I guess I'd have to make use of max() etc or so?
This is what I have so far (I don't know much):
SELECT cust.forename, cust.surname, cust.address
CUSTOMER cust, bkg, customer_booking cust_bkg booking
Here I'll also the max (bkg.last_meeting) I guess? so I have the last meeting, the client had?
I forgot to add, the table of cusotmer_booking uses the booking.id and customer.id columns to link to each of the tables.
Hope you understand my question and thank you in advance for any help I can get.
Published by: user13390506 on January 12, 2011 03:30I guess some like this is
SELECT cust.forename, cust.surname, cust.address, max(bkg.last_meeting) FROM customer cust, booking bkg, customer_booking cust_bkg where cust.customer_id=cust_bkg.customer_id and cust_bkg.booking_id =bkg.booking_id group by cust.forename, cust.surname, cust.address
-
SQL JOIN. We'RE after or before the keyword JOIN later
Hi guys,.
I spotted a very unusual behavior that I can't explain.
I've isolated the problem to the following joints.
Why the second join returns no less line? Why the first JOIN causes more lines?
LEFT OUTER JOIN DWH.SA_BEZ_SAS_GRUPPE_V stellwerkg
INNER JOIN DWH.SA_STELL_V stellwerk
WE (stellwerkg.owner_fid = stellwerk.fid)
WE (stellwerkg.member_fid = vorsignal.fid)
-5413 linesLEFT OUTER JOIN DWH.SA_BEZ_SAS_GRUPPE_V stellwerkg
WE (stellwerkg.member_fid = vorsignal.fid)
INNER JOIN DWH.SA_STELL_V stellwerk
WE (stellwerkg.owner_fid = stellwerk.fid)-5411 lines
Thanks for any clarification.
very strange indeed - so we have:
SQL > select / * normal ANSI syntax * /.
2 count (*)
3 from t1
left outer join 4 t3
5 we (t3.id = t1.id)
inner join 6 t2
7 on (t3.id = t2.id);
COUNT (*)
----------
10
SQL > select / * strange ANSI syntax: predicate of order 1, 2 * /.
2 count (*)
3 from t1
left outer join 4 t3
inner join t2 5
6 we (t3.id = t1.id)
7 on (t3.id = t2.id);
on (t3.id = t1.id)
*
FEHLER in line 6:
ORA-00904: "T1". "" Id ": ungultiger Bezeichner
SQL > select / * strange ANSI syntax: predicate of order 2, 1 * /.
2 count (*)
3 from t1
left outer join 4 t3
inner join t2 5
6 we (t3.id = t2.id)
7 on (t3.id = t1.id);
COUNT (*)
----------
15
We get:
- a result of 10 lines with the 'normal' ANSI syntax
- an error with the predicates separate from the FROM clause and predicate order t3 - t1, t3 - t2
- a result of 15 lines with separated from the FROM clause predicates and predicate t3 - t2, t1 - t3 reverse order
A look at the CBO (event 10053) trace we see for queries returning a result the following 'final request after transformations"(reformatted):
/ * the normal ANSI syntax * /.
SELECT COUNT (*) 'COUNT (*).
OF "C ##TEST". " T1""T1 ".
"C ##TEST". " T3""T3 ".
"C ##TEST". " T2""T2 ".
WHERE "T3". ' ' ID ' = 'T2 '. "" IDENTITY CARD ".
(AND "T3". ' ' ID ' = 'T1 '. "" IDENTITY CARD ".
/ * the strange ANSI syntax: predicate of order 2, 1 * /.
SELECT COUNT (*) 'COUNT (*).
OF "C ##TEST". " T1""T1 ".
(SELECT "T3". ' ' 'ID' ID. '
OF "C ##TEST". " T3""T3 ".
"C ##TEST". " T2""T2 ".
WHERE "T3". ' ' ID ' = 'T2 '. (' ' ID ') "from $_subquery$ _004.
WHERE "from $_subquery$ _004. "ID"(+) = "T1". "" IDENTITY CARD ".
So we see that the 'normal' ANSI version indeed remove the outer join, while the version of working with separate predicates is still an outer join - and I think that explains the different results of your initial query. Track also shows some 'ANSI architecture' (with a small I) information (since the ANSI syntax is internally converted into traditional Oracle join syntax) and the (Ouattara) on the elimination of the outer join (for the 'normal' ANSI query: "Ouattara: outer join of T3 and T1 to join inner conversion.") considered Ouattara: given the predicate "T3". ' ID '= 'T1'. » ID » »). The result of the architecture 'ANSI' is different in the two cases is not a surprise that the heuristic transformations finally also return different results.
Basically, I think that the question is indeed the order of operations:
- If inner join t2 t3 and then the outer join T1 with the resulting 10 lines of the first step we get 15 ranks accordingly (since t1 contains 15 lines)
- If we join outer t1 to t3 (15 lines) and then do the inner join T2 on t3.id (i.e. NON NULL only for 10 T3 lines) we get only 10 lines in the final result
Personally, I would try to separate these operations in subqueries (as in the final transformation for the query "strange ANSI syntax: predicate of order 2, 1") to make sure that I still understand the logic of my combinations.
-
Need to fix SQL Join so that charges null return 0
I'm a newbie and have created a large query that grouped returns counts of maintenance records grouped by each paragraph order special maintnance counties apply to. The great qoeks of motion, but the only problem is when maintenance is done for a particular paragraph, paragraph appears at all in the query results. I need to get him back all the paragraph numbers and a zero next to the paragraphs which had no record of maintenance associated with them.
Here's my query SQL with SQL to create all the tables and fill the sample data so you can see the application in action.
You'll see when you run the query that paragraphs 161, 161D, 161I and 161J do not appear in the query results, there is no record of maintenance for them, but they are listed in the
pm_requirements_table. All paragraphs should appear in the results, if they have maintenance records, and if no records, they must have a zero next to them.
As always, any help is appreciated.
-- Query SELECT lpm_paragraph_mapping_table.publication_paragraph, pm_requirements_table.description, pm_requirements_table.frequency, lpm.equipment_ident, count(lpm_paragraph_mapping_table.publication_paragraph) AS activities_performed FROM lpm JOIN fsep ON fsep.fac_id = lpm.fac_ident AND fsep.facility = lpm.fac_type JOIN lpm_paragraph_mapping_table ON trim(lpm.publication_paragraph) = lpm_paragraph_mapping_table.paragraph_alias_mapping JOIN pm_requirements_table ON pm_requirements_table.publication_order = lpm_paragraph_mapping_table.publication_order AND pm_requirements_table.publication_paragraph_number = lpm_paragraph_mapping_table.publication_paragraph WHERE trim(lpm.publication_order) = '6310.19A' AND TRUNC(lpm.start_date,'YEAR') = TO_DATE('01/01/2010','MM/DD/YYYY') AND fac_ident = 'EWR' GROUP BY lpm_paragraph_mapping_table.publication_paragraph, pm_requirements_table.description, pm_requirements_table.frequency, lpm.equipment_ident ORDER BY lpm_paragraph_mapping_table.publication_paragraph ASC;
Published by: George Heller on July 13, 2011 10:34CREATE TABLE "LPM" ( "LOG_ID" NUMBER(22,0) NOT NULL ENABLE, "FAC_IDENT" VARCHAR2(5 BYTE), "FAC_TYPE" VARCHAR2(5 BYTE), "CODE_CATEGORY" NUMBER(22,0) NOT NULL ENABLE, "SUPPLEMENTAL_CODE" VARCHAR2(1 BYTE), "MAINT_ACTION_CODE" VARCHAR2(1 BYTE), "INTERRUPT_CONDITION" VARCHAR2(22 BYTE), "ATOW_CODE" VARCHAR2(22 BYTE), "SECTOR_CODE" VARCHAR2(5 BYTE), "LOG_STATUS" VARCHAR2(3 BYTE) NOT NULL ENABLE, "START_DATE" DATE, "START_DATETIME" VARCHAR2(22 BYTE), "END_DATE" DATE, "END_DATETIME" VARCHAR2(22 BYTE), "MODIFIED_DATETIME" VARCHAR2(22 BYTE), "WR_AREA" VARCHAR2(6 BYTE), "SHORT_NAME" VARCHAR2(15 BYTE), "EQUIPMENT_IDENT" VARCHAR2(15 BYTE), "INTERVAL_CODE" VARCHAR2(255 BYTE), "EARLIEST_DATE" VARCHAR2(4000 BYTE), "EARLIEST_DATETIME" VARCHAR2(255 BYTE), "SCHEDULED_DATE" DATE, "SCHEDULED_DATETIME" VARCHAR2(22 BYTE), "LATEST_DATE" DATE, "LATEST_DATETIME" VARCHAR2(22 BYTE), "WR_CREW_UNIT" VARCHAR2(10 BYTE), "WR_WATCH" VARCHAR2(1 BYTE), "PUBLICATION_ORDER" VARCHAR2(30 BYTE), "PUBLICATION_ORDER_ORIGINAL" VARCHAR2(30 BYTE), "PUBLICATION_PARAGRAPH" VARCHAR2(30 BYTE), "PUBLICATION_PARAGRAPH_ORIGINAL" VARCHAR2(30 BYTE), "NUMBER_OF_TASKS" VARCHAR2(25 BYTE), "LOG_SUMMARY" VARCHAR2(255 BYTE), "COMMENTS" CLOB, "RELATED_LOGS" CLOB, "LPMANTAC_ID" NUMBER ); CREATE TABLE "FSEP" ( "FAC_ID" VARCHAR2(10 BYTE), "FACILITY" VARCHAR2(5 BYTE), "FAC_LOCATION" VARCHAR2(13 BYTE), "FAC_STATE" VARCHAR2(2 BYTE), "REGION" VARCHAR2(2 BYTE), "COST_CENTER" VARCHAR2(8 BYTE) NOT NULL ENABLE, "ATOW_ORG" VARCHAR2(150 BYTE), "ATOW_ORG_DESCRIPTION" VARCHAR2(150 BYTE), "SVC_AREA" VARCHAR2(5 BYTE), "SECTOR_CODE" VARCHAR2(5 BYTE), "FAC_CODE" VARCHAR2(20 BYTE), "FAC_STATUS" CHAR(1 BYTE) NOT NULL ENABLE, "RESTORATION_CODE" VARCHAR2(2 BYTE), "RESPONSIBILITY_CODE" CHAR(1 BYTE), "POWER_CODE" CHAR(1 BYTE), "FAC_STATUS_DATE" DATE, "FAC_SWAP_DATE" DATE, "CHANGE_DATE" VARCHAR2(22 BYTE), "GSA_ADDRESS" VARCHAR2(15 BYTE), "INV" VARCHAR2(2 BYTE), "SDP_TYPE" VARCHAR2(5 BYTE), "SDP_IDENT" VARCHAR2(4 BYTE), "CONTROL_IDENT" VARCHAR2(10 BYTE), "REMOTE_IDENT" VARCHAR2(10 BYTE), "MONITOR_IDENT" VARCHAR2(4 BYTE), "RUNWAY" VARCHAR2(3 BYTE), "ASSOC_AIRPORT" VARCHAR2(4 BYTE), "FAC_MPS_SITE" CHAR(4 BYTE), "FREQS_IN_PLACE" NUMBER(22,0), "CONGRESSIONAL_DIS" VARCHAR2(2 BYTE), "CONTRACT_MAINT_PER" NUMBER(22,0), "AIR_COND" CHAR(1 BYTE), "FAC_UNITS" NUMBER(22,0), "ET_PRIMARY_IDENT" VARCHAR2(4 BYTE), "ET_PRIMARY_TYPE" VARCHAR2(5 BYTE), "ENV_PRIMARY_IDENT" VARCHAR2(4 BYTE), "ENV_PRIMARY_TYPE" VARCHAR2(5 BYTE), "FAC_CODE_DESC" VARCHAR2(100 BYTE), "STATUS_DESC" VARCHAR2(50 BYTE), "RESTORATION_DESC" VARCHAR2(32 BYTE), "POWER_DESC" VARCHAR2(500 BYTE), "LATITUDE" VARCHAR2(150 BYTE), "LONGITUDE" VARCHAR2(150 BYTE), "ELEVATION" VARCHAR2(22 BYTE), "MOD_COUNT" VARCHAR2(22 BYTE), "HYPERLINK" VARCHAR2(255 BYTE), "FSEPANTAC_ID" NUMBER ); CREATE TABLE "LPM_PARAGRAPH_MAPPING_TABLE" ( "PUBLICATION_ORDER" VARCHAR2(30 BYTE), "PUBLICATION_PARAGRAPH" VARCHAR2(30 BYTE), "PARAGRAPH_ALIAS_MAPPING" VARCHAR2(30 BYTE), "LPMTANTAC_ID" NUMBER ); CREATE TABLE "PM_REQUIREMENTS_TABLE" ( "PUBLICATION_ORDER" VARCHAR2(30 BYTE), "PUBLICATION_PARAGRAPH_NUMBER" VARCHAR2(30 BYTE), "DESCRIPTION" VARCHAR2(4000 BYTE), "FREQUENCY" VARCHAR2(30 BYTE), "CHECK_OR_MAINTENANCE" VARCHAR2(22 BYTE), "PRTANTAC_ID" NUMBER ); Insert into LPM (LOG_ID,FAC_IDENT,FAC_TYPE,CODE_CATEGORY,SUPPLEMENTAL_CODE,MAINT_ACTION_CODE,INTERRUPT_CONDITION,ATOW_CODE,SECTOR_CODE,LOG_STATUS,START_DATE,START_DATETIME,END_DATE,END_DATETIME,MODIFIED_DATETIME,WR_AREA,SHORT_NAME,EQUIPMENT_IDENT,INTERVAL_CODE,EARLIEST_DATE,EARLIEST_DATETIME,SCHEDULED_DATE,SCHEDULED_DATETIME,LATEST_DATE,LATEST_DATETIME,WR_CREW_UNIT,WR_WATCH,PUBLICATION_ORDER,PUBLICATION_ORDER_ORIGINAL,PUBLICATION_PARAGRAPH,PUBLICATION_PARAGRAPH_ORIGINAL,NUMBER_OF_TASKS,LOG_SUMMARY,COMMENTS,RELATED_LOGS,LPMANTAC_ID) values (127227902,'EWR','ASR',50,'0','P',null,'WEW1D','EA1FH','C',to_date('07-JUN-10','DD-MON-RR'),'06/07/2010 1:41',to_date('07-JUN-10','DD-MON-RR'),'06/07/2010 2:57','06/07/2010 5:51','RADAR','SYS','IEWR','W','06/07/2010','06/07/2010 0:00',to_date('13-JUN-10','DD-MON-RR'),'6/13/2010 0:00',to_date('13-JUN-10','DD-MON-RR'),'6/13/2010 0:00',null,null,'6310.19A','6310.19A','161K','161K','1',null, EMPTY_CLOB(), EMPTY_CLOB(),26648); Insert into LPM (LOG_ID,FAC_IDENT,FAC_TYPE,CODE_CATEGORY,SUPPLEMENTAL_CODE,MAINT_ACTION_CODE,INTERRUPT_CONDITION,ATOW_CODE,SECTOR_CODE,LOG_STATUS,START_DATE,START_DATETIME,END_DATE,END_DATETIME,MODIFIED_DATETIME,WR_AREA,SHORT_NAME,EQUIPMENT_IDENT,INTERVAL_CODE,EARLIEST_DATE,EARLIEST_DATETIME,SCHEDULED_DATE,SCHEDULED_DATETIME,LATEST_DATE,LATEST_DATETIME,WR_CREW_UNIT,WR_WATCH,PUBLICATION_ORDER,PUBLICATION_ORDER_ORIGINAL,PUBLICATION_PARAGRAPH,PUBLICATION_PARAGRAPH_ORIGINAL,NUMBER_OF_TASKS,LOG_SUMMARY,COMMENTS,RELATED_LOGS,LPMANTAC_ID) values (127228002,'EWR','ASR',50,'0','P',null,'WEW1D','EA1FH','C',to_date('07-JUN-10','DD-MON-RR'),'06/07/2010 1:41',to_date('07-JUN-10','DD-MON-RR'),'06/07/2010 2:57','06/07/2010 5:51','RADAR','SYS','IEWR','W','06/07/2010','06/07/2010 0:00',to_date('10-JUN-10','DD-MON-RR'),'06/10/2010 0:00',to_date('13-JUN-10','DD-MON-RR'),'6/13/2010 0:00',null,null,'6310.19A','6310.19A','161F-J','161F-J','8',null, EMPTY_CLOB(), EMPTY_CLOB(),26649); Insert into LPM (LOG_ID,FAC_IDENT,FAC_TYPE,CODE_CATEGORY,SUPPLEMENTAL_CODE,MAINT_ACTION_CODE,INTERRUPT_CONDITION,ATOW_CODE,SECTOR_CODE,LOG_STATUS,START_DATE,START_DATETIME,END_DATE,END_DATETIME,MODIFIED_DATETIME,WR_AREA,SHORT_NAME,EQUIPMENT_IDENT,INTERVAL_CODE,EARLIEST_DATE,EARLIEST_DATETIME,SCHEDULED_DATE,SCHEDULED_DATETIME,LATEST_DATE,LATEST_DATETIME,WR_CREW_UNIT,WR_WATCH,PUBLICATION_ORDER,PUBLICATION_ORDER_ORIGINAL,PUBLICATION_PARAGRAPH,PUBLICATION_PARAGRAPH_ORIGINAL,NUMBER_OF_TASKS,LOG_SUMMARY,COMMENTS,RELATED_LOGS,LPMANTAC_ID) values (127228102,'EWR','ASR',50,'0','P',null,'WEW1D','EA1FH','C',to_date('07-JUN-10','DD-MON-RR'),'06/07/2010 1:41',to_date('07-JUN-10','DD-MON-RR'),'06/07/2010 2:57','06/07/2010 5:51','RADAR','SYS','IEWR','W','06/07/2010','06/07/2010 0:00',to_date('10-JUN-10','DD-MON-RR'),'06/10/2010 0:00',to_date('13-JUN-10','DD-MON-RR'),'6/13/2010 0:00',null,null,'6310.19A','6310.19A','161E/H','161E/H','5',null, EMPTY_CLOB(), EMPTY_CLOB(),26650); Insert into LPM (LOG_ID,FAC_IDENT,FAC_TYPE,CODE_CATEGORY,SUPPLEMENTAL_CODE,MAINT_ACTION_CODE,INTERRUPT_CONDITION,ATOW_CODE,SECTOR_CODE,LOG_STATUS,START_DATE,START_DATETIME,END_DATE,END_DATETIME,MODIFIED_DATETIME,WR_AREA,SHORT_NAME,EQUIPMENT_IDENT,INTERVAL_CODE,EARLIEST_DATE,EARLIEST_DATETIME,SCHEDULED_DATE,SCHEDULED_DATETIME,LATEST_DATE,LATEST_DATETIME,WR_CREW_UNIT,WR_WATCH,PUBLICATION_ORDER,PUBLICATION_ORDER_ORIGINAL,PUBLICATION_PARAGRAPH,PUBLICATION_PARAGRAPH_ORIGINAL,NUMBER_OF_TASKS,LOG_SUMMARY,COMMENTS,RELATED_LOGS,LPMANTAC_ID) values (127228202,'EWR','ASR',50,'0','P',null,'WEW1D','EA1FH','C',to_date('07-JUN-10','DD-MON-RR'),'06/07/2010 1:41',to_date('07-JUN-10','DD-MON-RR'),'06/07/2010 2:57','06/07/2010 5:51','RADAR','SYS','IEWR','W','06/07/2010','06/07/2010 0:00',to_date('10-JUN-10','DD-MON-RR'),'06/10/2010 0:00',to_date('13-JUN-10','DD-MON-RR'),'6/13/2010 0:00',null,null,'6310.25','6310.25','161CD','161CD','14',null, EMPTY_CLOB(), EMPTY_CLOB(),26651); Insert into LPM (LOG_ID,FAC_IDENT,FAC_TYPE,CODE_CATEGORY,SUPPLEMENTAL_CODE,MAINT_ACTION_CODE,INTERRUPT_CONDITION,ATOW_CODE,SECTOR_CODE,LOG_STATUS,START_DATE,START_DATETIME,END_DATE,END_DATETIME,MODIFIED_DATETIME,WR_AREA,SHORT_NAME,EQUIPMENT_IDENT,INTERVAL_CODE,EARLIEST_DATE,EARLIEST_DATETIME,SCHEDULED_DATE,SCHEDULED_DATETIME,LATEST_DATE,LATEST_DATETIME,WR_CREW_UNIT,WR_WATCH,PUBLICATION_ORDER,PUBLICATION_ORDER_ORIGINAL,PUBLICATION_PARAGRAPH,PUBLICATION_PARAGRAPH_ORIGINAL,NUMBER_OF_TASKS,LOG_SUMMARY,COMMENTS,RELATED_LOGS,LPMANTAC_ID) values (127228302,'EWR','ASR',50,'0','P',null,'WEW1D','EA1FH','C',to_date('07-JUN-10','DD-MON-RR'),'06/07/2010 1:41',to_date('07-JUN-10','DD-MON-RR'),'06/07/2010 2:57','06/07/2010 5:51','RADAR','SYS','IEWR','W','06/07/2010','06/07/2010 0:00',to_date('10-JUN-10','DD-MON-RR'),'06/10/2010 0:00',to_date('13-JUN-10','DD-MON-RR'),'6/13/2010 0:00',null,null,'6310.19A','6310.19A','161AB','161AB','4',null, EMPTY_CLOB(), EMPTY_CLOB(),26652); Insert into LPM (LOG_ID,FAC_IDENT,FAC_TYPE,CODE_CATEGORY,SUPPLEMENTAL_CODE,MAINT_ACTION_CODE,INTERRUPT_CONDITION,ATOW_CODE,SECTOR_CODE,LOG_STATUS,START_DATE,START_DATETIME,END_DATE,END_DATETIME,MODIFIED_DATETIME,WR_AREA,SHORT_NAME,EQUIPMENT_IDENT,INTERVAL_CODE,EARLIEST_DATE,EARLIEST_DATETIME,SCHEDULED_DATE,SCHEDULED_DATETIME,LATEST_DATE,LATEST_DATETIME,WR_CREW_UNIT,WR_WATCH,PUBLICATION_ORDER,PUBLICATION_ORDER_ORIGINAL,PUBLICATION_PARAGRAPH,PUBLICATION_PARAGRAPH_ORIGINAL,NUMBER_OF_TASKS,LOG_SUMMARY,COMMENTS,RELATED_LOGS,LPMANTAC_ID) values (123480402,'EWR','ASR',50,'0','P',null,'WEW1D','EA1FH','C',to_date('02-JUN-10','DD-MON-RR'),'06/02/2010 3:00',to_date('02-JUN-10','DD-MON-RR'),'06/02/2010 3:55','06/02/2010 4:41','RADAR','SYS','IEWR','W','5/31/2010','5/31/2010 0:00',to_date('06-JUN-10','DD-MON-RR'),'06/06/2010 0:00',to_date('06-JUN-10','DD-MON-RR'),'06/06/2010 0:00',null,null,'6310.19A','6310.19A','161K','161K','1',null, EMPTY_CLOB(), EMPTY_CLOB(),26657); Insert into LPM (LOG_ID,FAC_IDENT,FAC_TYPE,CODE_CATEGORY,SUPPLEMENTAL_CODE,MAINT_ACTION_CODE,INTERRUPT_CONDITION,ATOW_CODE,SECTOR_CODE,LOG_STATUS,START_DATE,START_DATETIME,END_DATE,END_DATETIME,MODIFIED_DATETIME,WR_AREA,SHORT_NAME,EQUIPMENT_IDENT,INTERVAL_CODE,EARLIEST_DATE,EARLIEST_DATETIME,SCHEDULED_DATE,SCHEDULED_DATETIME,LATEST_DATE,LATEST_DATETIME,WR_CREW_UNIT,WR_WATCH,PUBLICATION_ORDER,PUBLICATION_ORDER_ORIGINAL,PUBLICATION_PARAGRAPH,PUBLICATION_PARAGRAPH_ORIGINAL,NUMBER_OF_TASKS,LOG_SUMMARY,COMMENTS,RELATED_LOGS,LPMANTAC_ID) values (123480502,'EWR','ASR',50,'0','P',null,'WEW1D','EA1FH','C',to_date('02-JUN-10','DD-MON-RR'),'06/02/2010 3:00',to_date('02-JUN-10','DD-MON-RR'),'06/02/2010 3:55','06/02/2010 4:41','RADAR','SYS','IEWR','W','5/31/2010','5/31/2010 0:00',to_date('03-JUN-10','DD-MON-RR'),'06/03/2010 0:00',to_date('06-JUN-10','DD-MON-RR'),'06/06/2010 0:00',null,null,'6310.19A','6310.19A','161F-J','161F-J','8',null, EMPTY_CLOB(), EMPTY_CLOB(),26658); Insert into LPM (LOG_ID,FAC_IDENT,FAC_TYPE,CODE_CATEGORY,SUPPLEMENTAL_CODE,MAINT_ACTION_CODE,INTERRUPT_CONDITION,ATOW_CODE,SECTOR_CODE,LOG_STATUS,START_DATE,START_DATETIME,END_DATE,END_DATETIME,MODIFIED_DATETIME,WR_AREA,SHORT_NAME,EQUIPMENT_IDENT,INTERVAL_CODE,EARLIEST_DATE,EARLIEST_DATETIME,SCHEDULED_DATE,SCHEDULED_DATETIME,LATEST_DATE,LATEST_DATETIME,WR_CREW_UNIT,WR_WATCH,PUBLICATION_ORDER,PUBLICATION_ORDER_ORIGINAL,PUBLICATION_PARAGRAPH,PUBLICATION_PARAGRAPH_ORIGINAL,NUMBER_OF_TASKS,LOG_SUMMARY,COMMENTS,RELATED_LOGS,LPMANTAC_ID) values (123480602,'EWR','ASR',50,'0','P',null,'WEW1D','EA1FH','C',to_date('02-JUN-10','DD-MON-RR'),'06/02/2010 3:00',to_date('02-JUN-10','DD-MON-RR'),'06/02/2010 3:55','06/02/2010 4:41','RADAR','SYS','IEWR','W','5/31/2010','5/31/2010 0:00',to_date('03-JUN-10','DD-MON-RR'),'06/03/2010 0:00',to_date('06-JUN-10','DD-MON-RR'),'06/06/2010 0:00',null,null,'6310.19A','6310.19A','161E/H','161E/H','5',null, EMPTY_CLOB(), EMPTY_CLOB(),26659); Insert into LPM (LOG_ID,FAC_IDENT,FAC_TYPE,CODE_CATEGORY,SUPPLEMENTAL_CODE,MAINT_ACTION_CODE,INTERRUPT_CONDITION,ATOW_CODE,SECTOR_CODE,LOG_STATUS,START_DATE,START_DATETIME,END_DATE,END_DATETIME,MODIFIED_DATETIME,WR_AREA,SHORT_NAME,EQUIPMENT_IDENT,INTERVAL_CODE,EARLIEST_DATE,EARLIEST_DATETIME,SCHEDULED_DATE,SCHEDULED_DATETIME,LATEST_DATE,LATEST_DATETIME,WR_CREW_UNIT,WR_WATCH,PUBLICATION_ORDER,PUBLICATION_ORDER_ORIGINAL,PUBLICATION_PARAGRAPH,PUBLICATION_PARAGRAPH_ORIGINAL,NUMBER_OF_TASKS,LOG_SUMMARY,COMMENTS,RELATED_LOGS,LPMANTAC_ID) values (123480702,'EWR','ASR',50,'0','P',null,'WEW1D','EA1FH','C',to_date('02-JUN-10','DD-MON-RR'),'06/02/2010 3:00',to_date('02-JUN-10','DD-MON-RR'),'06/02/2010 3:55','06/02/2010 4:41','RADAR','SYS','IEWR','W','5/31/2010','5/31/2010 0:00',to_date('03-JUN-10','DD-MON-RR'),'06/03/2010 0:00',to_date('06-JUN-10','DD-MON-RR'),'06/06/2010 0:00',null,null,'6310.25','6310.25','161CD','161CD','14',null, EMPTY_CLOB(), EMPTY_CLOB(),26660); Insert into LPM (LOG_ID,FAC_IDENT,FAC_TYPE,CODE_CATEGORY,SUPPLEMENTAL_CODE,MAINT_ACTION_CODE,INTERRUPT_CONDITION,ATOW_CODE,SECTOR_CODE,LOG_STATUS,START_DATE,START_DATETIME,END_DATE,END_DATETIME,MODIFIED_DATETIME,WR_AREA,SHORT_NAME,EQUIPMENT_IDENT,INTERVAL_CODE,EARLIEST_DATE,EARLIEST_DATETIME,SCHEDULED_DATE,SCHEDULED_DATETIME,LATEST_DATE,LATEST_DATETIME,WR_CREW_UNIT,WR_WATCH,PUBLICATION_ORDER,PUBLICATION_ORDER_ORIGINAL,PUBLICATION_PARAGRAPH,PUBLICATION_PARAGRAPH_ORIGINAL,NUMBER_OF_TASKS,LOG_SUMMARY,COMMENTS,RELATED_LOGS,LPMANTAC_ID) values (123480802,'EWR','ASR',50,'0','P',null,'WEW1D','EA1FH','C',to_date('02-JUN-10','DD-MON-RR'),'06/02/2010 3:00',to_date('02-JUN-10','DD-MON-RR'),'06/02/2010 3:55','06/02/2010 4:41','RADAR','SYS','IEWR','W','5/31/2010','5/31/2010 0:00',to_date('03-JUN-10','DD-MON-RR'),'06/03/2010 0:00',to_date('06-JUN-10','DD-MON-RR'),'06/06/2010 0:00',null,null,'6310.19A','6310.19A','161AB','161AB','4',null, EMPTY_CLOB(), EMPTY_CLOB(),26661); Insert into LPM (LOG_ID,FAC_IDENT,FAC_TYPE,CODE_CATEGORY,SUPPLEMENTAL_CODE,MAINT_ACTION_CODE,INTERRUPT_CONDITION,ATOW_CODE,SECTOR_CODE,LOG_STATUS,START_DATE,START_DATETIME,END_DATE,END_DATETIME,MODIFIED_DATETIME,WR_AREA,SHORT_NAME,EQUIPMENT_IDENT,INTERVAL_CODE,EARLIEST_DATE,EARLIEST_DATETIME,SCHEDULED_DATE,SCHEDULED_DATETIME,LATEST_DATE,LATEST_DATETIME,WR_CREW_UNIT,WR_WATCH,PUBLICATION_ORDER,PUBLICATION_ORDER_ORIGINAL,PUBLICATION_PARAGRAPH,PUBLICATION_PARAGRAPH_ORIGINAL,NUMBER_OF_TASKS,LOG_SUMMARY,COMMENTS,RELATED_LOGS,LPMANTAC_ID) values (120312402,'EWR','ASR',50,'0','P',null,'WEW1D','EA1FH','C',to_date('27-MAY-10','DD-MON-RR'),'5/27/2010 1:15',to_date('27-MAY-10','DD-MON-RR'),'5/27/2010 2:15','5/27/2010 3:40','RADAR','SYS','IEWR','W','5/24/2010','5/24/2010 0:00',to_date('30-MAY-10','DD-MON-RR'),'5/30/2010 0:00',to_date('30-MAY-10','DD-MON-RR'),'5/30/2010 0:00',null,null,'6310.19A','6310.19A','161K','161K','1',null, EMPTY_CLOB(), EMPTY_CLOB(),26669); Insert into LPM (LOG_ID,FAC_IDENT,FAC_TYPE,CODE_CATEGORY,SUPPLEMENTAL_CODE,MAINT_ACTION_CODE,INTERRUPT_CONDITION,ATOW_CODE,SECTOR_CODE,LOG_STATUS,START_DATE,START_DATETIME,END_DATE,END_DATETIME,MODIFIED_DATETIME,WR_AREA,SHORT_NAME,EQUIPMENT_IDENT,INTERVAL_CODE,EARLIEST_DATE,EARLIEST_DATETIME,SCHEDULED_DATE,SCHEDULED_DATETIME,LATEST_DATE,LATEST_DATETIME,WR_CREW_UNIT,WR_WATCH,PUBLICATION_ORDER,PUBLICATION_ORDER_ORIGINAL,PUBLICATION_PARAGRAPH,PUBLICATION_PARAGRAPH_ORIGINAL,NUMBER_OF_TASKS,LOG_SUMMARY,COMMENTS,RELATED_LOGS,LPMANTAC_ID) values (120312502,'EWR','ASR',50,'0','P',null,'WEW1D','EA1FH','C',to_date('27-MAY-10','DD-MON-RR'),'5/27/2010 1:15',to_date('27-MAY-10','DD-MON-RR'),'5/27/2010 2:15','5/27/2010 3:40','RADAR','SYS','IEWR','W','5/24/2010','5/24/2010 0:00',to_date('27-MAY-10','DD-MON-RR'),'5/27/2010 0:00',to_date('30-MAY-10','DD-MON-RR'),'5/30/2010 0:00',null,null,'6310.19A','6310.19A','161F-J','161F-J','8',null, EMPTY_CLOB(), EMPTY_CLOB(),26670); Insert into FSEP (FAC_ID,FACILITY,FAC_LOCATION,FAC_STATE,REGION,COST_CENTER,ATOW_ORG,ATOW_ORG_DESCRIPTION,SVC_AREA,SECTOR_CODE,FAC_CODE,FAC_STATUS,RESTORATION_CODE,RESPONSIBILITY_CODE,POWER_CODE,FAC_STATUS_DATE,FAC_SWAP_DATE,CHANGE_DATE,GSA_ADDRESS,INV,SDP_TYPE,SDP_IDENT,CONTROL_IDENT,REMOTE_IDENT,MONITOR_IDENT,RUNWAY,ASSOC_AIRPORT,FAC_MPS_SITE,FREQS_IN_PLACE,CONGRESSIONAL_DIS,CONTRACT_MAINT_PER,AIR_COND,FAC_UNITS,ET_PRIMARY_IDENT,ET_PRIMARY_TYPE,ENV_PRIMARY_IDENT,ENV_PRIMARY_TYPE,FAC_CODE_DESC,STATUS_DESC,RESTORATION_DESC,POWER_DESC,LATITUDE,LONGITUDE,ELEVATION,MOD_COUNT,HYPERLINK,FSEPANTAC_ID) values ('EWR','ASR','NEWARK','NJ','EA','081FH','WEW1D','Newark Radar/Env SSC','ESA','EA1FH','453ACA','D','4','A','A',to_date('01-AUG-53','DD-MON-RR'),to_date('01-APR-98','DD-MON-RR'),'10/13/2010 9:22','2K50','R1','TRACO','N90','QHM','EWR','QHM',null,'EWR','ZNY ',0,'10',0,'A',1,null,null,null,null,'ASR-9 STANDARD FACILITY','Commissioned/Full Service','Up to 4 Hours','Denotes a commercial power source a standby engine generator and an Uninterruptible Power Supply (UPS). This configuration shall provide uninterruptible conditioned power with AC voltage in and AC voltage out.','40.69033','-74.16278','5','2','http://technet.faa.gov/fsep/fsepDetail.asp?recordno=ASREWR',38191); Insert into FSEP (FAC_ID,FACILITY,FAC_LOCATION,FAC_STATE,REGION,COST_CENTER,ATOW_ORG,ATOW_ORG_DESCRIPTION,SVC_AREA,SECTOR_CODE,FAC_CODE,FAC_STATUS,RESTORATION_CODE,RESPONSIBILITY_CODE,POWER_CODE,FAC_STATUS_DATE,FAC_SWAP_DATE,CHANGE_DATE,GSA_ADDRESS,INV,SDP_TYPE,SDP_IDENT,CONTROL_IDENT,REMOTE_IDENT,MONITOR_IDENT,RUNWAY,ASSOC_AIRPORT,FAC_MPS_SITE,FREQS_IN_PLACE,CONGRESSIONAL_DIS,CONTRACT_MAINT_PER,AIR_COND,FAC_UNITS,ET_PRIMARY_IDENT,ET_PRIMARY_TYPE,ENV_PRIMARY_IDENT,ENV_PRIMARY_TYPE,FAC_CODE_DESC,STATUS_DESC,RESTORATION_DESC,POWER_DESC,LATITUDE,LONGITUDE,ELEVATION,MOD_COUNT,HYPERLINK,FSEPANTAC_ID) values ('EWR','GS','NEWARK','NJ','EA','081FJ','WEW1C','Newark Nav/Comm SSC','ESA','EA1FJ','314AWA','D','24','A','D',to_date('01-DEC-52','DD-MON-RR'),to_date('01-APR-94','DD-MON-RR'),'9/24/2009 9:51','2K51','6','ATCT','EWR','EWR',null,'QHM','04L','EWR','ZNY ',0,'10',0,'A',1,null,null,null,null,'MARK 1F (SIDEBAND REFERENCE) SINGLE EQUIPMENT CAT I FAC','Commissioned/Full Service','Up to 24 Hours','Denotes a commercial power source and a battery standby power system. A UPS is not included in this category.','40.68395','-74.17291','11','2','http://technet.faa.gov/fsep/fsepDetail.asp?recordno=GSEWR',38212); Insert into LPM_PARAGRAPH_MAPPING_TABLE (PUBLICATION_ORDER,PUBLICATION_PARAGRAPH,PARAGRAPH_ALIAS_MAPPING,LPMTANTAC_ID) values ('6310.19A','161A','161',1708); Insert into LPM_PARAGRAPH_MAPPING_TABLE (PUBLICATION_ORDER,PUBLICATION_PARAGRAPH,PARAGRAPH_ALIAS_MAPPING,LPMTANTAC_ID) values ('6310.19A','161A','161AB',1709); Insert into LPM_PARAGRAPH_MAPPING_TABLE (PUBLICATION_ORDER,PUBLICATION_PARAGRAPH,PARAGRAPH_ALIAS_MAPPING,LPMTANTAC_ID) values ('6310.19A','161B','161',1736); Insert into LPM_PARAGRAPH_MAPPING_TABLE (PUBLICATION_ORDER,PUBLICATION_PARAGRAPH,PARAGRAPH_ALIAS_MAPPING,LPMTANTAC_ID) values ('6310.19A','161B','161AB',1737); Insert into LPM_PARAGRAPH_MAPPING_TABLE (PUBLICATION_ORDER,PUBLICATION_PARAGRAPH,PARAGRAPH_ALIAS_MAPPING,LPMTANTAC_ID) values ('6310.19A','161C','161',1765); Insert into LPM_PARAGRAPH_MAPPING_TABLE (PUBLICATION_ORDER,PUBLICATION_PARAGRAPH,PARAGRAPH_ALIAS_MAPPING,LPMTANTAC_ID) values ('6310.19A','161C','161(A-->J)',1766); Insert into LPM_PARAGRAPH_MAPPING_TABLE (PUBLICATION_ORDER,PUBLICATION_PARAGRAPH,PARAGRAPH_ALIAS_MAPPING,LPMTANTAC_ID) values ('6310.19A','161C','161(A-->K)',1769); Insert into LPM_PARAGRAPH_MAPPING_TABLE (PUBLICATION_ORDER,PUBLICATION_PARAGRAPH,PARAGRAPH_ALIAS_MAPPING,LPMTANTAC_ID) values ('6310.19A','161C','161(A-D)',1770); Insert into LPM_PARAGRAPH_MAPPING_TABLE (PUBLICATION_ORDER,PUBLICATION_PARAGRAPH,PARAGRAPH_ALIAS_MAPPING,LPMTANTAC_ID) values ('6310.19A','161C','161(A-G)',1771); Insert into LPM_PARAGRAPH_MAPPING_TABLE (PUBLICATION_ORDER,PUBLICATION_PARAGRAPH,PARAGRAPH_ALIAS_MAPPING,LPMTANTAC_ID) values ('6310.19A','161C','161(A-J)',1772); Insert into LPM_PARAGRAPH_MAPPING_TABLE (PUBLICATION_ORDER,PUBLICATION_PARAGRAPH,PARAGRAPH_ALIAS_MAPPING,LPMTANTAC_ID) values ('6310.19A','161C','161(A--J)',1773); Insert into LPM_PARAGRAPH_MAPPING_TABLE (PUBLICATION_ORDER,PUBLICATION_PARAGRAPH,PARAGRAPH_ALIAS_MAPPING,LPMTANTAC_ID) values ('6310.19A','161C','161(A-K)',1774); Insert into LPM_PARAGRAPH_MAPPING_TABLE (PUBLICATION_ORDER,PUBLICATION_PARAGRAPH,PARAGRAPH_ALIAS_MAPPING,LPMTANTAC_ID) values ('6310.19A','161C','161.(A-C).',1775); Insert into LPM_PARAGRAPH_MAPPING_TABLE (PUBLICATION_ORDER,PUBLICATION_PARAGRAPH,PARAGRAPH_ALIAS_MAPPING,LPMTANTAC_ID) values ('6310.19A','161D(1)','161',1793); Insert into LPM_PARAGRAPH_MAPPING_TABLE (PUBLICATION_ORDER,PUBLICATION_PARAGRAPH,PARAGRAPH_ALIAS_MAPPING,LPMTANTAC_ID) values ('6310.19A','161D(1)','161(A-->J)',1794); Insert into LPM_PARAGRAPH_MAPPING_TABLE (PUBLICATION_ORDER,PUBLICATION_PARAGRAPH,PARAGRAPH_ALIAS_MAPPING,LPMTANTAC_ID) values ('6310.19A','161D(1)','161(A-->K)',1797); Insert into LPM_PARAGRAPH_MAPPING_TABLE (PUBLICATION_ORDER,PUBLICATION_PARAGRAPH,PARAGRAPH_ALIAS_MAPPING,LPMTANTAC_ID) values ('6310.19A','161D(1)','161(A-D)',1798); Insert into LPM_PARAGRAPH_MAPPING_TABLE (PUBLICATION_ORDER,PUBLICATION_PARAGRAPH,PARAGRAPH_ALIAS_MAPPING,LPMTANTAC_ID) values ('6310.19A','161D(2)','161',1821); Insert into LPM_PARAGRAPH_MAPPING_TABLE (PUBLICATION_ORDER,PUBLICATION_PARAGRAPH,PARAGRAPH_ALIAS_MAPPING,LPMTANTAC_ID) values ('6310.19A','161D(2)','161(A-->J)',1822); Insert into LPM_PARAGRAPH_MAPPING_TABLE (PUBLICATION_ORDER,PUBLICATION_PARAGRAPH,PARAGRAPH_ALIAS_MAPPING,LPMTANTAC_ID) values ('6310.19A','161D(2)','161(A-->K)',1825); Insert into LPM_PARAGRAPH_MAPPING_TABLE (PUBLICATION_ORDER,PUBLICATION_PARAGRAPH,PARAGRAPH_ALIAS_MAPPING,LPMTANTAC_ID) values ('6310.19A','161E','161E/H',1826); Insert into LPM_PARAGRAPH_MAPPING_TABLE (PUBLICATION_ORDER,PUBLICATION_PARAGRAPH,PARAGRAPH_ALIAS_MAPPING,LPMTANTAC_ID) values ('6310.19A','161F','161E/H',1827); Insert into LPM_PARAGRAPH_MAPPING_TABLE (PUBLICATION_ORDER,PUBLICATION_PARAGRAPH,PARAGRAPH_ALIAS_MAPPING,LPMTANTAC_ID) values ('6310.19A','161G','161E/H',1828); Insert into LPM_PARAGRAPH_MAPPING_TABLE (PUBLICATION_ORDER,PUBLICATION_PARAGRAPH,PARAGRAPH_ALIAS_MAPPING,LPMTANTAC_ID) values ('6310.19A','161H','161E/H',1829); Insert into LPM_PARAGRAPH_MAPPING_TABLE (PUBLICATION_ORDER,PUBLICATION_PARAGRAPH,PARAGRAPH_ALIAS_MAPPING,LPMTANTAC_ID) values ('6310.19A','161K','161K',1830); Insert into PM_REQUIREMENTS_TABLE (PUBLICATION_ORDER,PUBLICATION_PARAGRAPH_NUMBER,DESCRIPTION,FREQUENCY,CHECK_OR_MAINTENANCE,PRTANTAC_ID) values ('6310.19A','161A','Check transmitter average rf power output','WEEKLY',null,3); Insert into PM_REQUIREMENTS_TABLE (PUBLICATION_ORDER,PUBLICATION_PARAGRAPH_NUMBER,DESCRIPTION,FREQUENCY,CHECK_OR_MAINTENANCE,PRTANTAC_ID) values ('6310.19A','161B','Check transmitter VSWR','WEEKLY',null,4); Insert into PM_REQUIREMENTS_TABLE (PUBLICATION_ORDER,PUBLICATION_PARAGRAPH_NUMBER,DESCRIPTION,FREQUENCY,CHECK_OR_MAINTENANCE,PRTANTAC_ID) values ('6310.19A','161C','Check RMS transmitter pulse width','WEEKLY',null,5); Insert into PM_REQUIREMENTS_TABLE (PUBLICATION_ORDER,PUBLICATION_PARAGRAPH_NUMBER,DESCRIPTION,FREQUENCY,CHECK_OR_MAINTENANCE,PRTANTAC_ID) values ('6310.19A','161D(1)','Check filament current','WEEKLY',null,6); Insert into PM_REQUIREMENTS_TABLE (PUBLICATION_ORDER,PUBLICATION_PARAGRAPH_NUMBER,DESCRIPTION,FREQUENCY,CHECK_OR_MAINTENANCE,PRTANTAC_ID) values ('6310.19A','161D(2)','Check focus coil current','WEEKLY',null,7); Insert into PM_REQUIREMENTS_TABLE (PUBLICATION_ORDER,PUBLICATION_PARAGRAPH_NUMBER,DESCRIPTION,FREQUENCY,CHECK_OR_MAINTENANCE,PRTANTAC_ID) values ('6310.19A','161D(3)','Check Klystron voltage','WEEKLY',null,8); Insert into PM_REQUIREMENTS_TABLE (PUBLICATION_ORDER,PUBLICATION_PARAGRAPH_NUMBER,DESCRIPTION,FREQUENCY,CHECK_OR_MAINTENANCE,PRTANTAC_ID) values ('6310.19A','161D(4)','Check Klystron current','WEEKLY',null,9); Insert into PM_REQUIREMENTS_TABLE (PUBLICATION_ORDER,PUBLICATION_PARAGRAPH_NUMBER,DESCRIPTION,FREQUENCY,CHECK_OR_MAINTENANCE,PRTANTAC_ID) values ('6310.19A','161D(5)','Check PFN voltage','WEEKLY',null,10); Insert into PM_REQUIREMENTS_TABLE (PUBLICATION_ORDER,PUBLICATION_PARAGRAPH_NUMBER,DESCRIPTION,FREQUENCY,CHECK_OR_MAINTENANCE,PRTANTAC_ID) values ('6310.19A','161D(6)','Check vacuum pump current','WEEKLY',null,11); Insert into PM_REQUIREMENTS_TABLE (PUBLICATION_ORDER,PUBLICATION_PARAGRAPH_NUMBER,DESCRIPTION,FREQUENCY,CHECK_OR_MAINTENANCE,PRTANTAC_ID) values ('6310.19A','161E','Check target receiver MDS','WEEKLY',null,12); Insert into PM_REQUIREMENTS_TABLE (PUBLICATION_ORDER,PUBLICATION_PARAGRAPH_NUMBER,DESCRIPTION,FREQUENCY,CHECK_OR_MAINTENANCE,PRTANTAC_ID) values ('6310.19A','161F','Check target receiver NF','WEEKLY',null,13); Insert into PM_REQUIREMENTS_TABLE (PUBLICATION_ORDER,PUBLICATION_PARAGRAPH_NUMBER,DESCRIPTION,FREQUENCY,CHECK_OR_MAINTENANCE,PRTANTAC_ID) values ('6310.19A','161G','Check target receiver recovery','WEEKLY',null,14); Insert into PM_REQUIREMENTS_TABLE (PUBLICATION_ORDER,PUBLICATION_PARAGRAPH_NUMBER,DESCRIPTION,FREQUENCY,CHECK_OR_MAINTENANCE,PRTANTAC_ID) values ('6310.19A','161H','Check weather receiver MDS','WEEKLY',null,15); Insert into PM_REQUIREMENTS_TABLE (PUBLICATION_ORDER,PUBLICATION_PARAGRAPH_NUMBER,DESCRIPTION,FREQUENCY,CHECK_OR_MAINTENANCE,PRTANTAC_ID) values ('6310.19A','161I','Check weather receiver NF','WEEKLY',null,16); Insert into PM_REQUIREMENTS_TABLE (PUBLICATION_ORDER,PUBLICATION_PARAGRAPH_NUMBER,DESCRIPTION,FREQUENCY,CHECK_OR_MAINTENANCE,PRTANTAC_ID) values ('6310.19A','161J','Check weather receiver recovery','WEEKLY',null,17); Insert into PM_REQUIREMENTS_TABLE (PUBLICATION_ORDER,PUBLICATION_PARAGRAPH_NUMBER,DESCRIPTION,FREQUENCY,CHECK_OR_MAINTENANCE,PRTANTAC_ID) values ('6310.19A','161K','Check spare modem operation','WEEKLY',null,18);
Hello
George Heller wrote:
... The exact results I wanted to obtain data on the forum is below...'PUBLICATION_PARAGRAPH', 'DESCRIPTION', 'FREQUENCY', 'EQUIPMENT_IDENT', 'ACTIVITIES_PERFORMED '.
161 'a', "Transmitter Check average rf power output", "WEEKLY", "IEWR", 2
'161 b', "Transmitter Check ROS", "WEEKLY", "IEWR", 2
"161", "check RMS transmitter pulse width", "WEEKLY", "IEWR", 2
"" 161 D (1) ","Check filament current","WEEKLY"," ' ", 0
"" 161 D (2) ","Check focus coil current","WEEKLY"," ' ", 0
"" 161 D (3) ","Klystron check tension","WEEKLY"," ' ", 0
"" 161 D (4) ","Check Klystron current","WEEKLY"," ' ", 0
"" 161 D (5) ","Check Tension of NFP","WEEKLY"," ' ", 0
"" 161 D (6) ","Check current vacuum pump","WEEKLY"," ' ", 0
"161F', 'Receiver target check MDS', 'WEEKLY', 'IEWR', 2
"161F", "Check receiving target NF", "WEEKLY", "IEWR", 2
'161G', ' Check target receiver recovery ","WEEKLY","IEWR", 2
'161H', 'Receiver weather check MDS', 'WEEKLY', 'IEWR', 2
"161I","Check weather receiver NF ', 'WEEKLY',' ', 0 '.
'161J', 'The weather receiver Check recovery',' ', 0 '.
"161K',' operation spare modem check", "WEEKLY", "IEWR", 3Please put in the form results. Who do you think is easier to read and understand: the results you've posted higher, or these?
` EQUI ACTIV PUBLICAT PMEN ITIES ION_PARA T_ID _PERF GRAPH DESCRIPTION FREQUENCY ENT ORMED -------- ----------------------------------------- --------- ----- ----- 161A Check transmitter average rf power output WEEKLY IEWR 2 161B Check transmitter VSWR WEEKLY IEWR 2 161C Check RMS transmitter pulse width WEEKLY 0 161D(1) Check filament current WEEKLY 0 161D(2) Check focus coil current WEEKLY 0 161D(3) Check Klystron voltage WEEKLY 0 161D(4) Check Klystron current WEEKLY 0 161D(5) Check PFN voltage WEEKLY 0 161D(6) Check vacuum pump current WEEKLY 0 161E Check target receiver MDS WEEKLY IEWR 2 161F Check target receiver NF WEEKLY IEWR 2 161G Check target receiver recovery WEEKLY IEWR 2 161H Check weather receiver MDS WEEKLY IEWR 2 161I Check weather receiver NF WEEKLY 0 161J Check weather receiver recovery WEEKLY 0 161K Check spare modem operation WEEKLY IEWR 3
Who do you think will encourage people to answer your question? Who do you think is more likely to lead to accurate solutions?
The following query is pretty close to what you asked:
SELECT req.publication_paragraph_number AS publication_paragraph , req.description , req.frequency , MAX (lpm.equipment_ident) AS equipment_ident , COUNT (fsep.fac_id) AS activities_performed FROM pm_requirements_table req LEFT OUTER JOIN lpm_paragraph_mapping_table pmap ON req.publication_order = pmap.publication_order AND req.publication_paragraph_number = pmap.publication_paragraph LEFT OUTER JOIN lpm ON TRIM (lpm.publication_paragraph) = pmap.paragraph_alias_mapping AND TRIM (lpm.publication_order) = '6310.19A' AND TRUNC(lpm.start_date, 'YEAR') = TO_DATE ('01/01/2010', 'MM/DD/YYYY') AND lpm.fac_ident = 'EWR' LEFT OUTER JOIN fsep ON fsep.fac_id = lpm.fac_ident AND fsep.facility = lpm.fac_type GROUP BY req.publication_paragraph_number , req.description , req.frequency ORDER BY req.publication_paragraph_number ;
"As you can see, the last two columns, equipment_ident and actiovities_performed, are not what you asked for publication_paragraph ' 161 C". I guess just what you want in these columns. Guess, this isn't a very effective way to solve problems. "Explain what you want in these columns, and how derive you these values in the case of publication_paragraph ' 161 C".
-
Tuning for sql join key table no consumer of the heavy use of the query processor
Obligation comes to tunne prod of the query in
high use of the query processor
sql_id: fp79wb32h7a6t
Module: AHC, P_PatientDQ()
Cost: 7
Elapsed time: hung
Status: Hung, 35,253,460 day at 30 minute intervals
-Create table
create table ahc. PATIENTVISITS
(
ahcid NUMBER,
visitId NUMBER,
visitstatus NVARCHAR2 (100),
visitdate DATE,
visitintime DATE,
visitouttime DATE
)
-Create/recreate the index
create indexes ahc. F1_PATIENTVISIT_AHCID on ahc. PATIENTVISITS (AHCID, VISITID);
create indexes ahc. VISITDATE_IDX on ahc. PATIENTVISITS (TRUNC (VISITDATE));
First total number of table
Select count (1) of
Pvs AHC.patientvisits
-Save County 1387485
create table ahc. PATIENTDEPENDENTVISITS
(
ahcid NUMBER (19) not null,
IDPack NUMBER (10) not null,
visitId NUMBER (19) not null,
dependentvisitid NUMBER (19) not null,
isdiabetic NUMBER (2)
)
-Create/recreate the index
create indexes ahc. K1_PATIENTDEPENDENT_AHCID on ahc. PATIENTDEPENDENTVISITS (AHCID);
Total number of second table
Select count (1) of
AHC.patientdependentvisits POS
-Save County 774599
Original request:
SELECT count (*)
ACH. PVS PATIENTVISITS
WHERE PVS. VISITID IN (SELECT POS. DEPENDENTVISITID
ACH. PATIENTDEPENDENTVISITS POS
WHERE POS. AHCID = 37
AND POS. VISITID = 218
AND POS. ISDIABETIC = 0)
AND SUPERIOR (PVS. VISITSTATUS) = 'PENDING'
AND PVS. AHCID = 37
Count (1)
-----------
1
PL/sql Developer explain plan for the original query
Owner of description Objects_name cost cardin bytes cpucost cost of e/s
SELECT STATEMENT, GOAL = ALL_ROWS 7 1 41 63669 7 AGGREGATION OF TRI 1 41 SEMI OF THE NESTED LOOPS 7 1 41 63669 7 TABLE ACCESS BY INDEX ROWID AHC PATIENTVISITS 4 1 25 33295 4 INDEX RANGE SCAN AHC F1_PATIENTVISIT_AHCID 3 9 23164 3 TABLE ACCESS BY INDEX ROWID AHC PATIENTDEPENDENTVISITS 3 1 16 30375 3 INDEX RANGE SCAN AHC K1_PATIENTDEPENDENT_AHCID 2 14 18093 2 After editing the query
SELECT / * + FIRST_ROWS * / COUNT (1)
ACH. PVS PATIENTVISITS
JOIN THE AHC. PATIENTDEPENDENTVISITS POS ON PVS. VISITID = POS. DEPENDENTVISITID
WHERE PVS. AHCID = POS. AHCID
AND POS. AHCID = 37
AND POS. VISITID = 218
AND POS. ISDIABETIC = 0
AND SUPERIOR (PVS. VISITSTATUS) = 'PENDING'
Count (1)
-----------
1
PL/sql Developer explain plan for change request
Owner of description Objects_name cost cardin bytes cpucost cost of e/s
SELECT STATEMENT, TARGET = TIP: FIRST_ROWS 7 1 41 59257 7 AGGREGATION OF TRI 1 41 NESTED LOOPS NESTED LOOPS 7 1 41 59257 7 TABLE ACCESS BY INDEX ROWID AHC PATIENTDEPENDENTVISITS 4 1 16 36646 4 INDEX RANGE SCAN AHC K1_PATIENTDEPENDENT_AHCID 3 14 24364 3 INDEX RANGE SCAN AHC F1_PATIENTVISIT_AHCID 2 1 15293 2 TABLE ACCESS BY INDEX ROWID AHC PATIENTVISITS 3 1 25 22611 3 here after I changed the query no display cost = 7 io wait = improvement also 7 can someone please help these
How to adjust or rewrite lots of join not keys to multiple records on table table
Thank you
VSM
you have not answered my question. Are you really calling it 35 million times in 30 minutes?
If so, why?
-
Need help with sql query performance
Dear all,
I have a sql like query below, I need to give the following query please help me identify which statement I should tune to have better performanece.
Select rownum LINE_NUM,
A.LINE_ID,
TO_CHAR (A.INVITMID),
TO_NUMBER (A.PICKQTY),
UNLOADINGPNT NULL,
RRNUM NULL,
WORKORDNUM NULL,
WORKORDDESC NULL,
A.PONUM,
DTR_DUMB NULL,
A.DESCRIPTION,
FROM_SUB NULL,
TO_SUB NULL,
NO SOURCE,
ASSET_NUMBER NULL,
A.RECEIPTNUM,
MOVEORD NULL,
FROM_LOC NULL,
TO_LOC NULL,
MSD_NUM NULL,
CONTAIN_LINE NULL,
A.UOM,
A.PO_RELEASE
de)
Select headerid Po.Po_Header_Id,
rcv1. Po_Line_Id LINE_ID,
rcv1.item_id INVITMID,
(NVL(Rcv1.Transact_Qty,0)-NVL(rcv2.transact_qty,0)) PICKQTY,
Po.Segment1 PONUM,
Rcv1.Receipt_Num RECEIPTNUM,
Rcv1.Item_Desc DESCRIPTION,
Rcv1.Transact_Uom GLU,
Rcv1.Po_release
Po_Headers_All in.,.
(Select rcv3. Po_Header_Id, RCV3.receipt_num, rcv3. Po_Line_Id, rcv3. Destination_Type_Code, rcv3. Item_Id, rcv3. Item_Desc, rcv3. Transact_Uom, SUM (rcv3. Transact_Qty) Transact_Qty, rcv3. PO_RELEASE OF)
SELECT A.Po_Header_Id,
C.RECEIPT_NUM receipt_num,
A.Po_Line_Id,
A.Destination_Type_Code,
B.Item_Id,
B.item_description Item_Desc,
A.UNIT_OF_MEASURE Transact_Uom,
A.QUANTITY Transact_Qty,
D.RELEASE_NUM PO_RELEASE
OF RCV_TRANSACTIONS,.
RCV_SHIPMENT_HEADERS C.
B RCV_SHIPMENT_LINES,
PO_RELEASES_ALL D
WHERE C.SHIPMENT_HEADER_ID = A.SHIPMENT_HEADER_ID
AND B.SHIPMENT_LINE_ID = A.SHIPMENT_LINE_ID
AND UPPER (A.Transaction_Type) = "to DELIVER".
AND higher (A.Destination_Type_Code) = "EXPENSES".
AND D.PO_RELEASE_ID = A.PO_RELEASE_ID
UNION ALL
SELECT A.Po_Header_Id,
C.RECEIPT_NUM receipt_num,
A.Po_Line_Id,
A.Destination_Type_Code,
B.Item_Id,
B.item_description Item_Desc,
A.UNIT_OF_MEASURE Transact_Uom,
A.QUANTITY Transact_Qty,
D.RELEASE_NUM PO_RELEASE
OF RCV_TRANSACTIONS,.
RCV_SHIPMENT_HEADERS C.
B RCV_SHIPMENT_LINES,
PO_RELEASES_ALL D
WHERE C.SHIPMENT_HEADER_ID = A.SHIPMENT_HEADER_ID
AND B.SHIPMENT_LINE_ID = A.SHIPMENT_LINE_ID
AND B.ITEM_ID IS NULL
AND UPPER (A.Transaction_Type) = "to DELIVER".
AND higher (A.Destination_Type_Code) = "WORKSHOP".
D.PO_RELEASE_ID AND = A.PO_RELEASE_ID) rcv3
GROUP BY rcv3. Po_Header_Id, RCV3.receipt_num, rcv3. Po_Line_Id, rcv3. Destination_Type_Code, rcv3. Item_Id, rcv3. Item_Desc, rcv3. Transact_Uom, rcv3. Rcv1 PO_RELEASE),
(SELECT A.PO_LINE_ID,
Sum (A.Quantity) transact_qty,
A.PO_HEADER_ID,
C.RECEIPT_NUM
OF RCV_TRANSACTIONS,.
RCV_SHIPMENT_HEADERS C.
B RCV_SHIPMENT_LINES,
PO_RELEASES_ALL D
WHERE C.SHIPMENT_HEADER_ID = A.SHIPMENT_HEADER_ID
AND B.SHIPMENT_LINE_ID = A.SHIPMENT_LINE_ID
AND UPPER (A.Transaction_Type) = "RETURN to the RECEPTION"
AND D.PO_RELEASE_ID = A.PO_RELEASE_ID
A.PO_LINE_ID, A.PO_HEADER_ID, C.RECEIPT_NUM GROUP) Rcv2
Where Po.Po_Header_Id = Rcv1.Po_Header_Id (+)
And Rcv1.Po_Line_Id = Rcv2.Po_Line_Id (+)
And Rcv1.Receipt_Num = Rcv2.Receipt_Num (+)
And Rcv1.Transact_Qty <>Nvl(Rcv2.Transact_Qty,999999999)
Group of po.po_header_id, rcv1.po_line_id, po.segment1, rcv1.receipt_num, rcv1.item_id, Rcv1.Item_Desc, rcv1. TRANSACT_UOM, rcv1. PO_RELEASE, (NVL(Rcv1.Transact_Qty,0)-NVL(RCV2.transact_qty,0))) has
Is my version of the database: Oracle Database 11g Enterprise Edition Release 11.2.0.3.0 - 64 bit Production
Please find the attached PLAN to EXPLAIN.
Thank you
May be essentially the same join (between a, b, c and d) twice instead of three times
sounds like it could be done with a single join (between a, b, c, and d), but you do not some columns than the columns of rcv1 rcv2
We can work on what we can see only
Select rownum line_num,
rcv1.po_line_id line_id,
TO_CHAR (rcv1.item_id) invitmid,
NVL(rcv1.transact_qty,0) - nvl(rcv2.transact_qty,0) pickqty,
unloadingpnt null,
rrnum null,
workordnum null,
workorddesc null,
Po. Ponum Segment1,
dtr_dumb null,
description of the rcv1.item_desc,
from_sub null,
to_sub null,
No source,
asset_number null,
rcv1.receipt_num receiptnum,
moveord null,
from_loc null,
to_loc null,
msd_num null,
contain_line null,
Glu rcv1.transact_uom,
rcv1.po_release
of po_headers_all in.
left outer join
(select a.po_header_id,
c.receipt_num,
a.po_line_id,
a.destination_type_code,
b.item_id,
b.item_description item_desc,
a.unit_of_measure transact_uom,
Sum (a.Quantity) transact_qty,
d.release_num po_release
from (select shipment_header_id,
shipment_line_id,
po_release_id,
po_header_id,
po_line_id,
destination_type_code,
unit_of_measure,
quantity
of rcv_transactions
where upper (a.transaction_type) = "to DELIVER".
and upper (a.destination_type_code) ('charge', 'WORKSHOP')
) a
inner join
rcv_shipment_lines b
On a.shipment_line_id = b.shipment_line_id
inner join
c rcv_shipment_headers
On a.shipment_header_id = c.shipment_header_id
left outer join
po_releases_all d
On a.po_release_id = d.po_release_id
where upper (a.destination_type_code) = "EXPENSES".
or (upper (a.destination_type_code) = 'WORKSHOP'
and b.item_id is null
)
A.po_header_id group,
c.receipt_num,
a.po_line_id,
a.destination_type_code,
b.item_id,
b.item_description,
a.unit_of_measure,
d.release_num
) rcv1
On po.po_header_id = rcv1.po_header_id
left outer join
(select a.po_line_id,
Sum (a.Quantity) transact_qty,
a.po_header_id,
c.receipt_num
from (select shipment_header_id,
shipment_line_id,
po_release_id,
po_header_id,
quantity
of rcv_transactions
where upper (a.transaction_type) = "RETURN to THE RECIPIENTS.
) a
inner join
rcv_shipment_lines b
On a.shipment_line_id = b.shipment_line_id
inner join
c rcv_shipment_headers
On a.shipment_header_id = c.shipment_header_id
left outer join
po_releases_all d
On a.po_release_id = d.po_release_id
A.po_line_id group,
a.po_header_id,
c.receipt_num
) rcv2
On rcv1.po_line_id = rcv2.po_line_id
and rcv1.receipt_num = rcv2.receipt_num
where rcv1.transact_qty! = nvl(rcv2.transact_qty,999999999)
Concerning
Etbin
-
Please, help me to join of two tables?
Hello..
I'm using oracle 11g.
I have two tables with below description
1.esb_v_study_personnel
study_code_alias varchar2,
Site_ID number,
role_at_site_level_desc varchar2
2 esb_v_study_site
study_code_alias varchar2
Site_ID
I'm counting the role_at_site_level_desc where it is'Monitor' or 'primary monitor'
So I wrote the following query
Select study_code_alias, site_id,.
no_of_study_monitors (role_at_site_lvl_desc)
esb_v_study_site_personnel
study_code_alias IN & arg_trial_code
role_at_site_lvl_desc in ()"Monitor" "Main screen"()
Group of study_code_alias, study_site_id
order by study_site_id
using the above, I'm getting lines of 1617.
but I want to map the resultant site_id
esb_v_study_site with lines of 1647. If I want to get all the site_id in esb_v_study_site table mapping to above query.
Can you guide me on this point.
I tried with a left outer join, but still iam getting lines of 1617.
Select study_code_alias,
no_of_study_monitors (role_at_site_lvl_desc)
esb_v_study_site_personnel
study_code_alias IN & arg_trial_code
role_at_site_lvl_desc in ()"Monitor" "Main screen"()
Group of study_code_alias, study_site_id
order of study_site_id) a
LEFT OUTER JOIN
ON a.trial_no = d.trial_no et a.study_site_id = d.study_site_id
où d.study_code_alias in & arg_trial_code
Group by d.study_code_alias, d.study_site_id, a.no_of_study_monitors
order by d.study_site_id
Please help me on this?
I'm not quite sure, because your query seems to us of small missing pieces. He was probably down during some copy & paste on this forum.
I guess the reason is that the left join is performed after the group where the count on the column does not count NULL values that might be created by the outer join.
Maybe you can start with the following query and give us the results and tell us if it is always wrong and what the outcome would be expected.
example (not tested the syntax)
select d.study_code_alias ,d.site_id , count(a.role_at_site_lvl_desc) no_of_study_monitors , count(distinct a.role_at_site_lvl_desc) no2 , count(*) no3 from esb_v_study_site d left join esb_v_study_site_personnel a on a.trial_no=d.trial_no and a.study_site_id=d.study_site_id and a.role_at_site_lvl_desc in ('Field Monitor','Primary Monitor') where d.study_code_alias IN (&arg_trial_code) group by d.study_code_alias,d.study_site_id order by d.study_site_id;
BTW: If you read the FAQ in the upper right corner, here, he said how well sql zip code search.
-
Where clause ' where 1 = 1 ' help with SQL tuning
Hello Tuning specialists,.
It is useful to use ' where 1 = 1 ' and then type all joins and conditions in the statements 'AND' of the SQL when writing SQL queries. I would like to know if it helps with the writing queirs this way SQL query performance.
Thanks in advance.
Published by: oracle_developer on October 8, 2012 10:41oracle_developer wrote:
Hello Tuning specialists,.
It is useful to use ' where 1 = 1 ' and then type all joins and joins in the statements "AND" when writing SQL queries.
I would like to know if it helps with the writing queirs this way SQL query performance.He has No. performance impact.
It is done when building dynamic SQL, so each sentence can start with AND
Maybe you are looking for
-
How can I install my old hp scanjet 2400 driver
I have not find a driver for my old HP scanjet 2400 driver. Help, please.
-
After retrieving the Satellite A200 doesn't recognized partitions
Recently my A200 Satellite crashed, but since you are using the Windows recovery disc is no longer recognizing the partition that came pre-installed, and I can is more to move, copy, or delete files. Someone at - it ideas? Thank you.
-
I'm trying to update the graphics card on my computer Pavilion p7 - 1270t product # A5T37AV #ABA. The motherboard is the IPISB-CU Carmel2. What I have seen most of the new NVIDIA cards will not work on this motherboard because they need UEFI rather t
-
How to get rid of peanut butter on my keyboard...
Well, then it's really stupid. I ate an Apple with peanut butter on it, but I accidentally dropped it on my macbook pro keyboard... How to clean it without damaging anything? I tried already to wipe most of it, if there's still some left between the
-
Video driver corrupt, unable to play videos
Original title: can not play videos I have a Dell Dimension E520 XP. My DVD player can run audio and video CDs, but I get the error on Windows Media Player and Real Player (key exchange error) who report that my video driver is damaged. I don't kno