Search Postgresql Archives

Re: Oracle Functions to PostgreSQL

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



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@xxxxxxxxx
Subject: Oracle Functions to PostgreSQL
To: pgsql-general@xxxxxxxxxxxxxx

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.

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Index of Archives]     [Postgresql Jobs]     [Postgresql Admin]     [Postgresql Performance]     [Linux Clusters]     [PHP Home]     [PHP on Windows]     [Kernel Newbies]     [PHP Classes]     [PHP Books]     [PHP Databases]     [Postgresql & PHP]     [Yosemite]
  Powered by Linux