Fix Oracle producer
[dbsrgits/SQL-Translator.git] / lib / SQL / Translator / Producer / Oracle.pm
index bbcab0c..9b8adbc 100644 (file)
@@ -89,8 +89,8 @@ context the slash will be still there to ensure compatibility with SQLPlus.
 
 use strict;
 use warnings;
-use vars qw[ $VERSION $DEBUG $WARN ];
-$VERSION = '1.59';
+our ( $DEBUG, $WARN );
+our $VERSION = '1.59';
 $DEBUG   = 0 unless defined $DEBUG;
 
 use SQL::Translator::Schema::Constants;
@@ -248,10 +248,9 @@ sub produce {
         $create .= ";\n\n";
         # If wantarray is not set we have to add "/" in this statement
         # DBI->do() needs them omitted
-        # triggers may NOT end with a semicolon
-        $create .= join "/\n\n", @trigger_defs;
-        # for last trigger
-        $create .= "/\n\n";
+        # triggers may NOT end with a semicolon but a "/" instead
+        $create .= "$_/\n\n"
+            for @trigger_defs;
         return $create;
     }
 }
@@ -709,7 +708,7 @@ sub create_field {
           "CREATE OR REPLACE TRIGGER $trig_name\n".
           "BEFORE INSERT OR UPDATE ON $table_name_q\n".
           "FOR EACH ROW WHEN (new.$field_name_q IS NULL)\n".
-          "BEGIN \n".
+          "BEGIN\n".
           " SELECT sysdate INTO :new.$field_name_q FROM dual;\n".
           "END;\n";