From: | Martin Gainty <mgainty(at)hotmail(dot)com> |
---|---|
To: | <abr_ora(at)yahoo(dot)com>, "pgsql-general(at)postgresql(dot)org" <pgsql-general(at)postgresql(dot)org> |
Subject: | Re: Oracle Functions to PostgreSQL |
Date: | 2009-02-24 15:22:29 |
Message-ID: | BLU142-W244E171632EE094D852CCEAEAF0@phx.gbl |
Views: | Raw Message | Whole Thread | Download mbox | Resend email |
Thread: | |
Lists: | 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(at)yahoo(dot)com
Subject: [GENERAL] Oracle Functions to PostgreSQL
To: pgsql-general(at)postgresql(dot)org
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.
http://windowslive.com/explore?ocid=TXT_TAGLM_WL_t2_hm_justgotbetter_explore_022009
From | Date | Subject | |
---|---|---|---|
Next Message | Gregory Stark | 2009-02-24 15:35:58 | Re: Indexing a Bit String column |
Previous Message | George Oakman | 2009-02-24 15:10:56 | Indexing a Bit String column |