Data/Seed and Data/Test: Correction to apau.ctl to remove duplicates. Modules/compile.sql: Correction to 'report' query. Schema/ext...: Check whether external tables have been defined before attempting to drop them. Schema/v_...: Force creation of views that rely on PL/SQL code. Explicitly name the column returned by V_QUOTE_DETAILS.vw so that the comments can be applied. git-svn-id: http://locode01.ad.dom/svn/WEBMIP/trunk@3452 248e525c-4dfb-0310-94bc-949c084e9493
42 lines
1.2 KiB
Plaintext
42 lines
1.2 KiB
Plaintext
CREATE OR REPLACE FORCE VIEW v_current_quote_status
|
|
AS
|
|
SELECT qute_id
|
|
,event_date
|
|
,qust_code
|
|
FROM (SELECT qute_id
|
|
,event_date
|
|
,qust_code
|
|
,decode(qust_code
|
|
,'INP'
|
|
,1
|
|
,'AV'
|
|
,2
|
|
,'SELREJ'
|
|
,3
|
|
,'SELECTED'
|
|
,5
|
|
,'REJECTED'
|
|
,6
|
|
,'ACCEPTED'
|
|
,7
|
|
,'LAPSED'
|
|
,8) AS this_event
|
|
,MAX(decode(qust_code
|
|
,'INP'
|
|
,1
|
|
,'AV'
|
|
,2
|
|
,'SELREJ'
|
|
,3
|
|
,'SELECTED'
|
|
,5
|
|
,'REJECTED'
|
|
,6
|
|
,'ACCEPTED'
|
|
,7
|
|
,'LAPSED'
|
|
,8)) over(PARTITION BY qute_id) AS max_event
|
|
FROM quote_events)
|
|
WHERE this_event = max_event
|
|
/
|