aboutsummaryrefslogtreecommitdiff
path: root/oracle
diff options
context:
space:
mode:
authorBoris Kolpackov <boris@codesynthesis.com>2012-09-13 12:02:43 +0200
committerBoris Kolpackov <boris@codesynthesis.com>2012-09-13 12:02:43 +0200
commite8a334106c3a330dfb202a538338d4aad547c3e3 (patch)
treecde7233347fe0152c72240337b9fb50777759a35 /oracle
parent0301abe9322092ffef1d7713f838dcc12ab29a8e (diff)
Use new --sql-interlude option to fix Oracle custom test
Diffstat (limited to 'oracle')
-rw-r--r--oracle/custom/custom.sql21
-rw-r--r--oracle/custom/makefile10
2 files changed, 6 insertions, 25 deletions
diff --git a/oracle/custom/custom.sql b/oracle/custom/custom.sql
index 94ff5f5..191f397 100644
--- a/oracle/custom/custom.sql
+++ b/oracle/custom/custom.sql
@@ -1,24 +1,7 @@
/* This file contains custom type definitions and helper functions.
*/
-SET FEEDBACK OFF;
-WHENEVER SQLERROR EXIT FAILURE;
-WHENEVER OSERROR EXIT FAILURE;
-
--- @@ Temporary workaround: we cannot replace a type if there are
--- tables that use it. So need to drop the tables first, then
--- create/replace the type, and then create the tables.
---
---CREATE OR REPLACE TYPE Numbers AS VARRAY(100) OF NUMBER(10);
-
-BEGIN
- BEGIN
- EXECUTE IMMEDIATE 'CREATE TYPE Numbers AS VARRAY(100) OF NUMBER(10)';
- EXCEPTION
- WHEN OTHERS THEN
- IF SQLCODE != -955 THEN RAISE; END IF;
- END;
-END;
+CREATE OR REPLACE TYPE Numbers AS VARRAY(100) OF NUMBER(10);
/
CREATE OR REPLACE FUNCTION string_to_numbers(in_str IN VARCHAR2) RETURN Numbers
@@ -57,5 +40,3 @@ BEGIN
RETURN ret;
END;
/
-
-EXIT;
diff --git a/oracle/custom/makefile b/oracle/custom/makefile
index 66a0273..b57e3ea 100644
--- a/oracle/custom/makefile
+++ b/oracle/custom/makefile
@@ -35,8 +35,8 @@ gen := $(addprefix $(out_base)/,$(genf))
$(gen): $(odb)
$(gen): odb := $(odb)
$(gen) $(dist): export odb_options += --database oracle --generate-schema \
---generate-query --hxx-prologue '\#include "traits.hxx"' \
---table-prefix oracle_custom_
+--generate-query --hxx-prologue '\#include "traits.hxx"' --sql-interlude \
+"@ $(src_base)/custom.sql" --table-prefix oracle_custom_
$(gen): cpp_options := -I$(src_base)
$(gen): $(common.l.cpp-options)
@@ -50,8 +50,8 @@ $(out_base)/: $(driver)
#
$(dist): sources := $(cxx_tun)
$(dist): headers := $(odb_hdr)
-$(dist): export extra_headers := traits.hxx custom.sql
-$(dist): data_dist := test.std
+$(dist): export extra_headers := traits.hxx
+$(dist): data_dist := test.std custom.sql
$(dist): export name := $(subst /,-,$(subst $(src_root)/oracle/,,$(src_base)))
$(dist): export extra_dist := $(data_dist) $(name)-vc9.vcproj \
$(name)-vc10.vcxproj $(name)-vc10.vcxproj.filters
@@ -64,7 +64,7 @@ $(dist):
# Test.
#
$(test): $(driver) $(src_base)/test.std
- $(call schema,$(src_base)/custom.sql $(out_base)/test.sql)
+ $(call schema)
$(call message,test $<,$< --options-file $(dcf_root)/db.options \
>$(out_base)/test.out)
$(call message,,diff -u $(src_base)/test.std $(out_base)/test.out)