diff options
author | Boris Kolpackov <boris@codesynthesis.com> | 2012-09-17 10:39:38 +0200 |
---|---|---|
committer | Boris Kolpackov <boris@codesynthesis.com> | 2012-09-17 10:39:38 +0200 |
commit | ffd4bae910ad8e64b044b694ac3e2bab948f7bba (patch) | |
tree | 6570adfbabe2e9436334cdcfe57378a9a844a199 | |
parent | a9a31b5ca7deb54388f805c94e585e359162e2e4 (diff) |
Work around Oracle 10.2 issue with CREATE OR REPLACE TYPE
-rw-r--r-- | oracle/custom/custom.sql | 13 |
1 files changed, 12 insertions, 1 deletions
diff --git a/oracle/custom/custom.sql b/oracle/custom/custom.sql index 191f397..6e22903 100644 --- a/oracle/custom/custom.sql +++ b/oracle/custom/custom.sql @@ -1,7 +1,18 @@ /* This file contains custom type definitions and helper functions. */ -CREATE OR REPLACE TYPE Numbers AS VARRAY(100) OF NUMBER(10); +/* For some reason CREATE OR REPLACE TYPE does not work on Oracle 10.2. */ +BEGIN + BEGIN + EXECUTE IMMEDIATE 'DROP TYPE Numbers'; + EXCEPTION + WHEN OTHERS THEN + IF SQLCODE != -4043 THEN RAISE; END IF; + END; +END; +/ + +CREATE TYPE Numbers AS VARRAY(100) OF NUMBER(10); / CREATE OR REPLACE FUNCTION string_to_numbers(in_str IN VARCHAR2) RETURN Numbers |