06 Update Umzug Migration Postgres 13 17 (ab Prodat 2104) » update_01_ViewsNFunctions.sql
1 |
CREATE FUNCTION TSystem.views__all__drop() RETURNS void AS $$ |
---|---|
2 |
BEGIN
|
3 |
|
4 |
|
5 |
RETURN; |
6 |
END $$ LANGUAGE plpgsql; |
7 |
--
|
8 |
|
9 |
--
|
10 |
CREATE FUNCTION TSystem.views__all__create() RETURNS VOID AS $$ |
11 |
BEGIN
|
12 |
|
13 |
RETURN; |
14 |
END $$ LANGUAGE plpgsql; |
15 |
--
|
16 |
|
17 |
--
|
18 |
|
19 |
CREATE FUNCTION TSystem.views__Adressen__recreate() RETURNS VOID AS $$ |
20 |
BEGIN
|
21 |
DROP VIEW IF EXISTS adressen_view CASCADE; |
22 |
|
23 |
CREATE OR REPLACE VIEW adressen_view AS |
24 |
SELECT
|
25 |
dbrid, |
26 |
ad_krz AS adk_ad_krz, |
27 |
ad_krz, |
28 |
ad_fa1, |
29 |
ad_fa2, |
30 |
ad_adrzus, |
31 |
ad_anr, |
32 |
ad_titel, |
33 |
ad_name, |
34 |
ad_vorn, |
35 |
ad_str, |
36 |
ad_plz, |
37 |
ad_ort, |
38 |
ad_landiso::VARCHAR(5), |
39 |
ad_land, |
40 |
ad_pfc, |
41 |
ad_fax, |
42 |
ad_tel1, |
43 |
ad_tel2, |
44 |
ad_email1, |
45 |
ad_email2, |
46 |
ad_such, |
47 |
ad_ustidnr, |
48 |
ad_branche, |
49 |
ad_stat, |
50 |
ad_bem, |
51 |
adk.modified_date, |
52 |
ad_auslauf
|
53 |
FROM adk ; |
54 |
|
55 |
RETURN; |
56 |
END $$ LANGUAGE plpgsql; |
57 |
|
58 |
SELECT TSystem.views__Adressen__recreate(); |
59 |
|
60 |
CREATE SCHEMA IF NOT EXISTS tCache; |
61 |
|
62 |
CREATE FUNCTION TCache.CachedViews_Clear() RETURNS BOOLEAN AS $$ |
63 |
DECLARE
|
64 |
r RECORD; |
65 |
e BOOLEAN; |
66 |
BEGIN
|
67 |
|
68 |
RETURN false; |
69 |
END $$ LANGUAGE plpgsql; |
70 |
|
71 |
|
72 |
/*Delete für alle Tabellen setzen!!!!!*/
|
73 |
CREATE FUNCTION table_delete() RETURNS TRIGGER AS $$ |
74 |
BEGIN
|
75 |
|
76 |
|
77 |
RETURN old; |
78 |
END $$ LANGUAGE plpgsql; |
79 |
|
80 |
|
81 |
|
82 |
CREATE FUNCTION TSystem.views__ReportingAuftg__recreate() RETURNS VOID AS $$ |
83 |
BEGIN
|
84 |
|
85 |
DROP VIEW IF EXISTS treporting.auftg_beleg_positionennachtrag; |
86 |
DROP VIEW IF EXISTS treporting.auftg_beleg_positionen; |
87 |
|
88 |
|
89 |
END $$ LANGUAGE plpgsql; |
90 |
|
91 |
--/*
|
92 |
CREATE FUNCTION treporting.recreatereportingauftgviews( ) RETURNS void AS $$ |
93 |
BEGIN
|
94 |
RETURN; |
95 |
END $$ LANGUAGE plpgsql; |
96 |
--*/
|
97 |
|
98 |
CREATE OR REPLACE FUNCTION treporting.RecreateViews() RETURNS void AS $$ |
99 |
BEGIN
|
100 |
RETURN; |
101 |
END $$ LANGUAGE plpgsql; |
102 |
|
103 |
CREATE OR REPLACE FUNCTION TWawi.RecreateViews() RETURNS void AS $$ |
104 |
BEGIN
|
105 |
RETURN; |
106 |
END $$ LANGUAGE plpgsql; |
107 |
|
108 |
|
109 |
CREATE OR REPLACE FUNCTION DropBelegViews() RETURNS VOID AS $$ |
110 |
BEGIN
|
111 |
DROP VIEW IF EXISTS eingrech; |
112 |
DROP VIEW IF EXISTS eingrech_pos; |
113 |
DROP VIEW IF EXISTS lieferschein; |
114 |
DROP VIEW IF EXISTS lieferschein_pos; |
115 |
END $$ LANGUAGE plpgsql; |
116 |
|
117 |
CREATE FUNCTION lang_versart(INTEGER, VARCHAR) RETURNS VARCHAR AS $$ -- #7137 |
118 |
BEGIN
|
119 |
|
120 |
RETURN null; |
121 |
END $$ LANGUAGE plpgsql; |