Re: Oracle Functions to PostgreSQL - Mailing list pgsql-general

From Martin Gainty
Subject Re: Oracle Functions to PostgreSQL
Date
Msg-id BLU142-W244E171632EE094D852CCEAEAF0@phx.gbl
Whole thread Raw
In response to Oracle Functions to PostgreSQL  (Abdul Rahman <abr_ora@yahoo.com>)
List 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 by date:

Previous
From: George Oakman
Date:
Subject: Indexing a Bit String column
Next
From: Gregory Stark
Date:
Subject: Re: Indexing a Bit String column