forked from orafce/orafce
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathorafce--3.13--3.14.sql
34 lines (30 loc) · 1.29 KB
/
orafce--3.13--3.14.sql
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
CREATE OR REPLACE FUNCTION oracle.unistr(text)
RETURNS text
AS 'MODULE_PATHNAME','orafce_unistr'
LANGUAGE 'c';
do $$
BEGIN
IF EXISTS(SELECT * FROM pg_settings WHERE name = 'server_version_num' AND setting::int >= 120000) THEN
ALTER FUNCTION varchar2(varchar2, integer, boolean) SUPPORT varchar2_transform;
ELSE
UPDATE pg_proc SET protransform= 'varchar2_transform'::regproc::oid WHERE proname='varchar2';
INSERT INTO pg_depend (classid, objid, objsubid,
refclassid, refobjid, refobjsubid, deptype)
VALUES('pg_proc'::regclass::oid, 'varchar2'::regproc::oid, 0,
'pg_proc'::regclass::oid, 'varchar2_transform'::regproc::oid, 0, 'n');
END IF;
END
$$;
do $$
BEGIN
IF EXISTS(SELECT * FROM pg_settings WHERE name = 'server_version_num' AND setting::int >= 120000) THEN
ALTER FUNCTION nvarchar2(nvarchar2, integer, boolean) SUPPORT nvarchar2_transform;
ELSE
UPDATE pg_proc SET protransform= 'nvarchar2_transform'::regproc::oid WHERE proname='nvarchar2';
INSERT INTO pg_depend (classid, objid, objsubid,
refclassid, refobjid, refobjsubid, deptype)
VALUES('pg_proc'::regclass::oid, 'nvarchar2'::regproc::oid, 0,
'pg_proc'::regclass::oid, 'nvarchar2_transform'::regproc::oid, 0, 'n');
END IF;
END
$$;