我正在将我的数据库服务器从 PostgreSQL 迁移到 Oracle 11g。我尝试了各种工具,例如Squirrel SQL。但是大多数迁移工具都支持表和视图的迁移。我找不到迁移我的过程和功能的解决方案。我可以迁移功能和程序的方式是什么。请找到以下功能之一。
CREATE OR REPLACE FUNCTION hrms.fngetstatus(iactdate character varying, ideactdate character varying)
RETURNS character varying AS
$BODY$
returnval VARCHAR (1);
BEGIN
IF TO_DATE (iactdate, 'mm/dd/yyyy') >
TO_DATE (TO_CHAR (SYSDATE, 'mm/dd/yyyy'), 'mm/dd/yyyy')
AND TO_DATE (ideactdate, 'mm/dd/yyyy') >
TO_DATE (TO_CHAR (SYSDATE, 'mm/dd/yyyy'), 'mm/dd/yyyy')
THEN
returnval := 'D';
ELSIF TO_DATE (iactdate, 'mm/dd/yyyy') >
TO_DATE (TO_CHAR (SYSDATE, 'mm/dd/yyyy'), 'mm/dd/yyyy')
AND TO_DATE (ideactdate, 'mm/dd/yyyy') IS NULL
THEN
returnval := 'D';
ELSIF TO_DATE (iactdate, 'mm/dd/yyyy') <=
TO_DATE (TO_CHAR (SYSDATE, 'mm/dd/yyyy'), 'mm/dd/yyyy')
AND TO_DATE (ideactdate, 'mm/dd/yyyy') >
TO_DATE (TO_CHAR (SYSDATE, 'mm/dd/yyyy'), 'mm/dd/yyyy')
THEN
returnval := 'A';
ELSIF TO_DATE (iactdate, 'mm/dd/yyyy') <=
TO_DATE (TO_CHAR (SYSDATE, 'mm/dd/yyyy'), 'mm/dd/yyyy')
AND TO_DATE (ideactdate, 'mm/dd/yyyy') IS NULL
THEN
returnval := 'A';
ELSIF TO_DATE (iactdate, 'mm/dd/yyyy') <
TO_DATE (TO_CHAR (SYSDATE, 'mm/dd/yyyy'), 'mm/dd/yyyy')
AND TO_DATE (ideactdate, 'mm/dd/yyyy') <=
TO_DATE (TO_CHAR (SYSDATE, 'mm/dd/yyyy'), 'mm/dd/yyyy')
THEN
returnval := 'D';
ELSIF TO_DATE (iactdate, 'mm/dd/yyyy') =
TO_DATE (TO_CHAR (SYSDATE, 'mm/dd/yyyy'), 'mm/dd/yyyy')
AND TO_DATE (ideactdate, 'mm/dd/yyyy') =
TO_DATE (TO_CHAR (SYSDATE, 'mm/dd/yyyy'), 'mm/dd/yyyy')
THEN
returnval := 'D';
ELSIF TO_DATE (ideactdate, 'mm/dd/yyyy') >=
TO_DATE (TO_CHAR (SYSDATE, 'mm/dd/yyyy'), 'mm/dd/yyyy')
AND TO_DATE (iactdate, 'mm/dd/yyyy') is null
THEN
returnval := 'A';
ELSIF TO_DATE (iactdate, 'mm/dd/yyyy') <=
TO_DATE (TO_CHAR (SYSDATE, 'mm/dd/yyyy'), 'mm/dd/yyyy')
AND TO_DATE (ideactdate, 'mm/dd/yyyy') <
TO_DATE (TO_CHAR (SYSDATE, 'mm/dd/yyyy'), 'mm/dd/yyyy')
THEN
returnval := 'A';
ELSIF TO_DATE (iactdate, 'mm/dd/yyyy') >
TO_DATE (TO_CHAR (SYSDATE, 'mm/dd/yyyy'), 'mm/dd/yyyy')
AND TO_DATE (ideactdate, 'mm/dd/yyyy') <
TO_DATE (TO_CHAR (SYSDATE, 'mm/dd/yyyy'), 'mm/dd/yyyy')
THEN
returnval := 'D';
ELSIF TO_DATE (iactdate, 'mm/dd/yyyy') >
TO_DATE (TO_CHAR (SYSDATE, 'mm/dd/yyyy'), 'mm/dd/yyyy')
AND TO_DATE (ideactdate, 'mm/dd/yyyy') <=
TO_DATE (TO_CHAR (SYSDATE, 'mm/dd/yyyy'), 'mm/dd/yyyy')
THEN
returnval := 'D';
END IF;
RETURN returnval;
END$BODY$
LANGUAGE edbspl VOLATILE SECURITY DEFINER
COST 100;
ALTER FUNCTION hrms.fngetstatus(character varying, character varying)
OWNER TO enterprisedb;