Guys,
just found that for object views, created under parent view, view/edit window extracts wrong DDL in comparison with the original one. DBMS_METADATA extracts the right one.
This is what I have in view/edit:
CREATE OR REPLACE VIEW V_TR_DOC_LINES OF tr_doc_lines AS
SELECT dl.document_id,
dl.line_number,
d.doc_date,
d.doc_number,
d.active,
dl.item_id,
tr.from_depot from_id,
tr.to_depot to_id,
dl.qty,
dl.amount
FROM document_lines dl, documents d, tr_depot tr
WHERE d.id = dl.document_id
and tr.document_id=d.id
and d.doc_type = 'TR'
in DBMS_METADATA:
CREATE OR REPLACE FORCE VIEW "FROST"."V_TR_DOC_LINES" OF "FROST"."TR_DOC_LINES"
under v_doc_lines AS
SELECT dl.document_id,
dl.line_number,
d.doc_date,
d.doc_number,
d.active,
dl.item_id,
tr.from_depot from_id,
tr.to_depot to_id,
dl.qty,
dl.amount
FROM document_lines dl, documents d, tr_depot tr
WHERE d.id = dl.document_id
and tr.document_id=d.id
and d.doc_type = 'TR'
;
See how "under v_doc_lines" clause is missing in the first DDL, which makes a big difference!!!
just found that for object views, created under parent view, view/edit window extracts wrong DDL in comparison with the original one. DBMS_METADATA extracts the right one.
This is what I have in view/edit:
CREATE OR REPLACE VIEW V_TR_DOC_LINES OF tr_doc_lines AS
SELECT dl.document_id,
dl.line_number,
d.doc_date,
d.doc_number,
d.active,
dl.item_id,
tr.from_depot from_id,
tr.to_depot to_id,
dl.qty,
dl.amount
FROM document_lines dl, documents d, tr_depot tr
WHERE d.id = dl.document_id
and tr.document_id=d.id
and d.doc_type = 'TR'
in DBMS_METADATA:
CREATE OR REPLACE FORCE VIEW "FROST"."V_TR_DOC_LINES" OF "FROST"."TR_DOC_LINES"
under v_doc_lines AS
SELECT dl.document_id,
dl.line_number,
d.doc_date,
d.doc_number,
d.active,
dl.item_id,
tr.from_depot from_id,
tr.to_depot to_id,
dl.qty,
dl.amount
FROM document_lines dl, documents d, tr_depot tr
WHERE d.id = dl.document_id
and tr.document_id=d.id
and d.doc_type = 'TR'
;
See how "under v_doc_lines" clause is missing in the first DDL, which makes a big difference!!!