[pi-code-cleaning] the hex_to_int functions have been deleted.
authorNaroa Iriarte <naroa.iriarte@openbravo.com>
Tue, 26 Apr 2016 16:01:20 +0200
changeset 29514 8496051fbd3b
parent 29513 b29f33019549
child 29515 17707aee7ca4
[pi-code-cleaning] the hex_to_int functions have been deleted.
src-db/database/model/prescript-PostgreSql.sql
--- a/src-db/database/model/prescript-PostgreSql.sql	Tue Apr 26 15:52:47 2016 +0200
+++ b/src-db/database/model/prescript-PostgreSql.sql	Tue Apr 26 16:01:20 2016 +0200
@@ -418,76 +418,6 @@
 ' language 'plpgsql' IMMUTABLE
 /-- END
 
-CREATE OR REPLACE FUNCTION hex_to_int("varchar")
-  RETURNS "numeric" AS
-$BODY$
-DECLARE
-h alias for $1;
-exec varchar;
-curs refcursor;
-res numeric;
-res1 numeric;
-res2 numeric;
-res3 numeric;
-res4 numeric;
-hi varchar;
-h1 varchar;
-h2 varchar;
-h3 varchar;
-h4 varchar;
-exp1 numeric(50);
-exp2 numeric(50);
-exp3 numeric(50);
-BEGIN
-if length(h) < 32 then
-	hi:=repeat('0',32-length(h)) || h;
-else
-	hi:=h;
-end if;
-h1:=substr(hi,25,8);
-h2:=substr(hi,17,8);
-h3:=substr(hi,9,8);
-h4:=substr(hi,1,8);
-exec := 'SELECT x''' || h1 || '''::bigint';
-OPEN curs FOR EXECUTE exec;
-FETCH curs INTO res1;
-CLOSE curs;
-exec := 'SELECT x''' || h2 || '''::bigint';
-OPEN curs FOR EXECUTE exec;
-FETCH curs INTO res2;
-CLOSE curs;
-exec := 'SELECT x''' || h3 || '''::bigint';
-OPEN curs FOR EXECUTE exec;
-FETCH curs INTO res3;
-CLOSE curs;
-exec := 'SELECT x''' || h4 || '''::bigint';
-OPEN curs FOR EXECUTE exec;
-FETCH curs INTO res4;
-CLOSE curs;
-exp1=pow(16::numeric,8::numeric);
-exp2=pow(16::numeric,16::numeric);
-exp3=pow(16::numeric,24::numeric);
-res:=res1;
-res:=res+res2*exp1;
-res:=res+res3*exp2;
-res:=res+res4*exp3;
-return to_number(res);
-END;$BODY$
-  LANGUAGE 'plpgsql' IMMUTABLE STRICT;
-/-- END
-
-CREATE OR REPLACE FUNCTION hex_to_int(numeric) RETURNS numeric AS '
-DECLARE
-h alias for $1;
-BEGIN
-return h;
-END;'
-LANGUAGE 'plpgsql'
-IMMUTABLE
-STRICT;
-/-- END
-
-
 CREATE OR REPLACE FUNCTION add_months
 (
 date,