-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy path_YDBOCTOVISTAF.sql
86 lines (75 loc) · 5.3 KB
/
_YDBOCTOVISTAF.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
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
#################################################################
# #
# Copyright (c) 2019 Chris Combs
# Copyright (c) 2021-2024 YottaDB LLC and/or its subsidiaries. #
# All rights reserved. #
# #
# This source code contains the intellectual property #
# of its copyright holder(s), and is made available #
# under a license. If you do not know the terms of #
# the license, please stop and do not read further. #
# #
#################################################################
-- These function are deprecated as they can be replaced with now() & variations
DROP FUNCTION IF EXISTS CURRTIMESTAMP(varchar);
DROP FUNCTION IF EXISTS GETDATE(varchar);
DROP FUNCTION IF EXISTS DATEFORMAT(numeric);
DROP FUNCTION IF EXISTS DATEFORMAT(numeric,varchar);
DROP FUNCTION IF EXISTS DATEFORMAT(date(fileman),varchar);
DROP FUNCTION IF EXISTS DATEFORMAT(timestamp(fileman),varchar);
CREATE FUNCTION DATEFORMAT(numeric) RETURNS varchar as $$DATETIME^%YDBOCTOVISTAF;
CREATE FUNCTION DATEFORMAT(numeric,varchar) RETURNS varchar as $$DATETIME^%YDBOCTOVISTAF;
CREATE FUNCTION DATEFORMAT(date(fileman),varchar) RETURNS varchar as $$DATETIME^%YDBOCTOVISTAF;
CREATE FUNCTION DATEFORMAT(timestamp(fileman),varchar) RETURNS varchar as $$DATETIME^%YDBOCTOVISTAF;
DROP FUNCTION IF EXISTS FMGET(varchar); -- old definition that is not invalid
DROP FUNCTION IF EXISTS FMGET(numeric,numeric,numeric);
DROP FUNCTION IF EXISTS FMGET(numeric,numeric,numeric,numeric);
DROP FUNCTION IF EXISTS FMGET(numeric,numeric,numeric,numeric,numeric);
DROP FUNCTION IF EXISTS FMGET(numeric,numeric,numeric,numeric,numeric,numeric);
DROP FUNCTION IF EXISTS FMGET(numeric,numeric,numeric,numeric,numeric,numeric,numeric);
DROP FUNCTION IF EXISTS FMGET(numeric,numeric,numeric,numeric,numeric,numeric,numeric,numeric);
DROP FUNCTION IF EXISTS FMGET(numeric,numeric,numeric,numeric,numeric,numeric,numeric,numeric,numeric);
CREATE FUNCTION FMGET(numeric,numeric,numeric) RETURNS varchar as $$FMGET^%YDBOCTOVISTAF;
CREATE FUNCTION FMGET(numeric,numeric,numeric,numeric) RETURNS varchar as $$FMGET^%YDBOCTOVISTAF;
CREATE FUNCTION FMGET(numeric,numeric,numeric,numeric,numeric) RETURNS varchar as $$FMGET^%YDBOCTOVISTAF;
CREATE FUNCTION FMGET(numeric,numeric,numeric,numeric,numeric,numeric) RETURNS varchar as $$FMGET^%YDBOCTOVISTAF;
CREATE FUNCTION FMGET(numeric,numeric,numeric,numeric,numeric,numeric,numeric) RETURNS varchar as $$FMGET^%YDBOCTOVISTAF;
CREATE FUNCTION FMGET(numeric,numeric,numeric,numeric,numeric,numeric,numeric,numeric) RETURNS varchar as $$FMGET^%YDBOCTOVISTAF;
CREATE FUNCTION FMGET(numeric,numeric,numeric,numeric,numeric,numeric,numeric,numeric,numeric) RETURNS varchar as $$FMGET^%YDBOCTOVISTAF;
DROP FUNCTION IF EXISTS IFNULL(varchar); -- old defintion
DROP FUNCTION IF EXISTS IFNULL(varchar, varchar);
CREATE FUNCTION IFNULL(varchar, varchar) RETURNS varchar as $$IFNULL^%YDBOCTOVISTAF;
DROP FUNCTION IF EXISTS LEFTY(varchar,int);
CREATE FUNCTION LEFTY(varchar,int) RETURNS varchar as $$LEFT^%YDBOCTOVISTAF;
DROP FUNCTION IF EXISTS MPIECE(varchar); -- old definition
DROP FUNCTION IF EXISTS MPIECE(varchar,varchar,int);
CREATE FUNCTION MPIECE(varchar,varchar,int) RETURNS varchar as $$PIECE^%YDBOCTOVISTAF;
DROP FUNCTION IF EXISTS NUMBER(varchar);
CREATE FUNCTION NUMBER(varchar) RETURNS numeric as $$NUMBER^%YDBOCTOVISTAF;
DROP FUNCTION IF EXISTS PATINDEX(varchar,varchar);
CREATE FUNCTION PATINDEX(varchar,varchar) RETURNS int as $$PATINDEX^%YDBOCTOVISTAF;
DROP FUNCTION IF EXISTS RIGHTY(varchar,int);
CREATE FUNCTION RIGHTY(varchar,int) RETURNS varchar as $$RIGHT^%YDBOCTOVISTAF;
DROP FUNCTION IF EXISTS TOKEN(varchar,varchar,integer);
CREATE FUNCTION TOKEN(varchar,varchar,integer) RETURNS varchar as $$PIECE^%YDBOCTOVISTAF;
-- Note that FMDIFF can return an interval using parameter "3", but we don't handle that right now
DROP FUNCTION IF EXISTS FMDIFF(int,int,int); -- old definition
DROP FUNCTION IF EXISTS FMDIFF(numeric,numeric,int);
DROP FUNCTION IF EXISTS FMDIFF(date(fileman),date(fileman),int);
DROP FUNCTION IF EXISTS FMDIFF(timestamp(fileman),timestamp(fileman),int);
DROP FUNCTION IF EXISTS FMDIFF(date(fileman),timestamp(fileman),int);
DROP FUNCTION IF EXISTS FMDIFF(timestamp(fileman),date(fileman),int);
CREATE FUNCTION FMDIFF(numeric,numeric,int) RETURNS integer as $$FMDIFF^%YDBOCTOVISTAF;
CREATE FUNCTION FMDIFF(date(fileman),date(fileman),int) RETURNS integer as $$FMDIFF^%YDBOCTOVISTAF;
CREATE FUNCTION FMDIFF(timestamp(fileman),timestamp(fileman),int) RETURNS integer as $$FMDIFF^%YDBOCTOVISTAF;
CREATE FUNCTION FMDIFF(date(fileman),timestamp(fileman),int) RETURNS integer as $$FMDIFF^%YDBOCTOVISTAF;
CREATE FUNCTION FMDIFF(timestamp(fileman),date(fileman),int) RETURNS integer as $$FMDIFF^%YDBOCTOVISTAF;
DROP FUNCTION IF EXISTS FMNOW();
CREATE FUNCTION FMNOW() RETURNS timestamp(fileman) as $$NOW^XLFDT;
DROP FUNCTION IF EXISTS FMADD(int,int,int,int,int); --old defintion
DROP FUNCTION IF EXISTS FMADD(numeric,int,int,int,int);
DROP FUNCTION IF EXISTS FMADD(date(fileman),int,int,int,int);
DROP FUNCTION IF EXISTS FMADD(timestamp(fileman),int,int,int,int);
CREATE FUNCTION FMADD(numeric,int,int,int,int) RETURNS timestamp(fileman) as $$FMADD^%YDBOCTOVISTAF;
CREATE FUNCTION FMADD(date(fileman),int,int,int,int) RETURNS timestamp(fileman) as $$FMADD^%YDBOCTOVISTAF;
CREATE FUNCTION FMADD(timestamp(fileman),int,int,int,int) RETURNS timestamp(fileman) as $$FMADD^%YDBOCTOVISTAF;