Hallo,
also hier ist der/die View:
Select
a.FID ,
b.FID as FFID,
a.GEOM ,
b.NUMMER as NAME,
a.AREA ,
b.RECHTSVERBINDLICHKEIT,
b.REIHENFOLGE ,
b.DATEN ,
b.BEZEICHNUNG ,
b.NOTIZ ,
b.id,
TO_DATE(b.RECHTSVERBINDLICHKEIT,'DD.MM.YYYY') as DATUM
from BPLAN a left join BPLANUEBERSICHT b on a.ID = b.ID
Ich muss dazu sagen, dass der/die View nicht von mir angelegt wurde. Dieser wurde von einem Techniker einer Firma angelegt. Ich habe lediglich die Zeile TO_DATE... hinzugefügt.
SQL> desc BPLANUEBERSICHT
--------------------------------------------------------------------------------
CREATE TABLE BPLANUEBERSICHT(
--------------------------------------------------------------------------------
FID NUMBER (10) NOT NULL,
BEZEICHNUNG NVARCHAR2 (300),
DATEN NVARCHAR2 (200),
NOTIZ NVARCHAR2 (600),
NUMMER NVARCHAR2 (20),
PLAN NVARCHAR2 (160),
RECHTSVERBINDLICHKEIT NVARCHAR2 (40),
REIHENFOLGE NUMBER (20),
REVISIONNUMBER NUMBER (22) NOT NULL,
GFZ NUMBER (10,2),
ID VARCHAR2 (10)
);
CREATE UNIQUE INDEX BPLANUEBERSICHT_P ON BPLANUEBERSICHT (FID);
--TRIGGER BPLANUEBERSICHTABUS
DECLARE
BEGIN
IF NOT FeatureClass.IsTriggerProcessingEnabled() THEN RETURN; END IF;
FEATURE.SET_CURRENT_RULE(143);
/* This is an automatically generated script. Do not alter it!
Start of section 143 $*/
TBLabel.Feature_tab.DELETE;
/*$ 143 End of section
This is an automatically generated script. Do not alter it! */
END;
--TRIGGER BPLANUEBERSICHT_AIS
DECLARE
BEGIN
IF NOT FeatureClass.IsTriggerProcessingEnabled() THEN RETURN; END IF;
FEATURE.SET_CURRENT_RULE(142);
/* This is an automatically generated script. Do not alter it!
Start of section 142 $*/
declare
nFid number;
nOperation number;
begin
/* _LAS (after statement) */
if (FeatureClass.IsTriggerProcessingEnabled() and FeatureClass.IsLabelTriggerEnabled()) then
if (TBLabel.Feature_tab.COUNT > 0) then
for i in TBLabel.Feature_tab.FIRST..TBLabel.Feature_tab.LAST LOOP
nFid := TBLabel.Feature_tab(i).fid;
nOperation := TBLabel.Feature_tab(i).operation;
if inserting then
Feature.CreateAutoLabels('BPLANUEBERSICHT', nFid);
elsif updating then
if nOperation = 2 then
Feature.UpdateLabels('BPLANUEBERSICHT', nFid);
elsif nOperation = 1 then
Feature.UpdateLabelsText('BPLANUEBERSICHT', nFid);
end if;
end if;
end loop;
end if;
end if;
end;
/*$ 142 End of section
This is an automatically generated script. Do not alter it! */
END;
--TRIGGER BPLANUEBERSICHT_AUS
DECLARE
BEGIN
IF NOT FeatureClass.IsTriggerProcessingEnabled() THEN RETURN; END IF;
FEATURE.SET_CURRENT_RULE(142);
/* This is an automatically generated script. Do not alter it!
Start of section 142 $*/
declare
nFid number;
nOperation number;
begin
/* _LAS (after statement) */
if (FeatureClass.IsTriggerProcessingEnabled() and FeatureClass.IsLabelTriggerEnabled()) then
if (TBLabel.Feature_tab.COUNT > 0) then
for i in TBLabel.Feature_tab.FIRST..TBLabel.Feature_tab.LAST LOOP
nFid := TBLabel.Feature_tab(i).fid;
nOperation := TBLabel.Feature_tab(i).operation;
if inserting then
Feature.CreateAutoLabels('BPLANUEBERSICHT', nFid);
elsif updating then
if nOperation = 2 then
Feature.UpdateLabels('BPLANUEBERSICHT', nFid);
elsif nOperation = 1 then
Feature.UpdateLabelsText('BPLANUEBERSICHT', nFid);
end if;
end if;
end loop;
end if;
end if;
end;
/*$ 142 End of section
This is an automatically generated script. Do not alter it! */
END;
--TRIGGER BPLANUEBERSICHT_BIR
DECLARE
BEGIN
IF NOT FeatureClass.IsTriggerProcessingEnabled() THEN RETURN; END IF;
FEATURE.SET_CURRENT_RULE(141);
/* This is an automatically generated script. Do not alter it!
Start of section 141 $*/
declare
labelFeature TBLabel.LabelFeature;
begin
/* _LAR (edit geometry) */
if (:new.fid is null or :new.fid = 0) then
select tb_ufid_s.nextval into :new.fid from dual;
end if;
labelFeature.fid := :new.FID;
labelFeature.operation := 2;
if TBLabel.Feature_tab.COUNT = 0 then
TBLabel.Feature_tab(1) := labelFeature;
else
TBLabel.Feature_tab(TBLabel.Feature_tab.LAST + 1) := labelFeature;
end if;
end;
/*$ 141 End of section
This is an automatically generated script. Do not alter it! */
END;
--TRIGGER BPLANUEBERSICHT_BIS
DECLARE
BEGIN
IF NOT FeatureClass.IsTriggerProcessingEnabled() THEN RETURN; END IF;
FEATURE.SET_CURRENT_RULE(143);
/* This is an automatically generated script. Do not alter it!
Start of section 143 $*/
TBLabel.Feature_tab.DELETE;
/*$ 143 End of section
This is an automatically generated script. Do not alter it! */
END;
--TRIGGER BPLANUEBERSICHT_BUR
DECLARE
BEGIN
IF NOT FeatureClass.IsTriggerProcessingEnabled() THEN RETURN; END IF;
FEATURE.SET_CURRENT_RULE(140);
/* This is an automatically generated script. Do not alter it!
Start of section 140 $*/
declare
labelFeature TBLabel.LabelFeature;
begin
/* _LAE (Edit Attribute) */
if :new.FID is not null then
labelFeature.fid := :new.FID;
labelFeature.operation := 1;
if TBLabel.Feature_tab.COUNT = 0 then
TBLabel.Feature_tab(1) := labelFeature;
else
TBLabel.Feature_tab(TBLabel.Feature_tab.LAST + 1) := labelFeature;
end if;
end if;
end;
/*$ 140 End of section
This is an automatically generated script. Do not alter it! */
FEATURE.SET_CURRENT_RULE(141);
/* This is an automatically generated script. Do not alter it!
Start of section 141 $*/
IF UPDATING ('GEOM') OR UPDATING ('ORIENTATION') THEN
declare
labelFeature TBLabel.LabelFeature;
begin
/* _LAR (edit geometry) */
if (:new.fid is null or :new.fid = 0) then
select tb_ufid_s.nextval into :new.fid from dual;
end if;
labelFeature.fid := :new.FID;
labelFeature.operation := 2;
if TBLabel.Feature_tab.COUNT = 0 then
TBLabel.Feature_tab(1) := labelFeature;
else
TBLabel.Feature_tab(TBLabel.Feature_tab.LAST + 1) := labelFeature;
end if;
end;
END IF;
/*$ 141 End of section
This is an automatically generated script. Do not alter it! */
END;
--TRIGGER BPLANUEBERSICHT_FID
DECLARE
BEGIN
-- update
IF updating THEN
IF ld.FID = :new.FID THEN
UPDATE TB_UFID SET TOUCH_TS = SYSTIMESTAMP WHERE FID = :new.fid;
END IF;
-- insert
ELSIF inserting THEN
IF (:new.fid IS NULL or :new.fid = 0) THEN
SELECT tb_ufid_s.nextval INTO :new.fid FROM DUAL;
END IF;
-- Delete first the existing fid if the feature class id and the fid is the same
DELETE FROM TB_UFID WHERE fid = :new.fid and f_class_id = 2;
INSERT INTO TB_UFID (fid, f_class_id, TOUCH_TS) VALUES (:new.fid, 2, SYSTIMESTAMP);
-- delete
ELSE
DECLARE
BEGIN
UPDATE TB_UFID SET TOUCH_TS = SYSTIMESTAMP WHERE FID = ld.fid;
EXCEPTION
WHEN NO_DATA_FOUND THEN
NULL;
END;
END IF;
END;
Eine Antwort auf diesen Beitrag verfassen (mit Zitat/Zitat des Beitrags) IP