Re: Oracle Functions to PostgreSQL

Поиск
Список
Период
Сортировка
От Martin Gainty
Тема Re: Oracle Functions to PostgreSQL
Дата
Msg-id BLU142-W244E171632EE094D852CCEAEAF0@phx.gbl
обсуждение исходный текст
Ответ на Oracle Functions to PostgreSQL  (Abdul Rahman <abr_ora@yahoo.com>)
Список pgsql-general
you're going to have alot of work as ANNOTATIONS and DATATYPES are different e.g.

--------------- Postgres function which calcs geo_distance
CREATE OR REPLACE FUNCTION geo_distance (point, point)
RETURNS float8
LANGUAGE 'C' IMMUTABLE STRICT AS '$libdir/earthdistance';

--Oracle has no clue what points or float8 might be so you'll have to convert to
--known Oracle Datatypes or packaged objects
NUMBER,VARCHAR2,CHAR,DATE,BLOB,CLOB

IMMUTABLE can be accomplished if you birth the functionality to a Java Class and add @Immutable
CREATE OR REPLACE PACKAGE Function_Container AS
 FUNCTION JavaFunction
 (AOracleDatatype IN VARCHAR2)
 RETURN VARCHAR2
IS
LANGUAGE 'JAVA'
NAME 'package.ImmutableProjectToAccomplishAOracleFunction' (char[]) return char[]';
/

Here is the Java file
package package;
@Immutable
public class ImmutableProjectToAccomplishAOracleFunction { }
--STRICT is only available in Oracle11

Martin
______________________________________________
Disclaimer and confidentiality note
Everything in this e-mail and any attachments relates to the official business of Sender. This transmission is of a confidential nature and Sender does not endorse distribution to any party other than intended recipient. Sender does not necessarily endorse content contained within this transmission.





Date: Tue, 24 Feb 2009 04:46:30 -0800
From: abr_ora@yahoo.com
Subject: [GENERAL] Oracle Functions to PostgreSQL
To: pgsql-general@postgresql.org

.ExternalClass DIV {;}
Hi all,

Is there any preferably open source tool to convert Oracle Functions to PostgreSQL Functions.

Thanks,
Abdul Rehman.



Windows Live™ Hotmail®:…more than just e-mail. Check it out.

В списке pgsql-general по дате отправления:

Предыдущее
От: George Oakman
Дата:
Сообщение: Indexing a Bit String column
Следующее
От: Gregory Stark
Дата:
Сообщение: Re: Indexing a Bit String column