tfischer 2004/12/10 11:06:27
Modified: src/generator/src/templates/sql/base/oracle Tag:
TORQUE_3_1_BRANCH primarykey.vm foreignkey.vm
drop.vm index.vm sequence.vm table.vm
src/generator/src/templates/sql/load/oracle Tag:
TORQUE_3_1_BRANCH row.vm
src/generator/src/templates/sql/id-table Tag:
TORQUE_3_1_BRANCH idtable.oracle
Log:
reverted to state before TRQS222 was applied
Reason: This patch caused the generated sql scripts to be invalid for orcale,
as "/" is (of course) not recognized as a sql delimiter by an oracle console.
Also, one would either have to change the ant sql delimiter from ";" to "/"
for this patch to work with ant, or upgrade to ant 1.6.x and change the
delimiter type to "row". This was not done so far. For good reason, as for
either solution, the SQL scripts saved on disk are invalid.
In short, this means that the creation of oracle tables was broken by the
patch.
Without the patch, the sql scripts are ok, and the ant tasks work allright.
The only inconvenience are messages like "cannot drop xxx as it does not
exists".
Revision Changes Path
No revision
No revision
1.1.2.2 +1 -2
db-torque/src/generator/src/templates/sql/base/oracle/primarykey.vm
Index: primarykey.vm
===================================================================
RCS file:
/home/cvs/db-torque/src/generator/src/templates/sql/base/oracle/primarykey.vm,v
retrieving revision 1.1.2.1
retrieving revision 1.1.2.2
diff -u -r1.1.2.1 -r1.1.2.2
--- primarykey.vm 20 Oct 2004 22:13:34 -0000 1.1.2.1
+++ primarykey.vm 10 Dec 2004 19:06:26 -0000 1.1.2.2
@@ -3,6 +3,5 @@
#if ($table.hasPrimaryKey())
ALTER TABLE $table.Name
ADD CONSTRAINT ${table.Name.substring(0,$length)}_PK
-PRIMARY KEY ($table.printPrimaryKey())
-/
+PRIMARY KEY ($table.printPrimaryKey());
#end
1.1.2.2 +1 -1
db-torque/src/generator/src/templates/sql/base/oracle/foreignkey.vm
Index: foreignkey.vm
===================================================================
RCS file:
/home/cvs/db-torque/src/generator/src/templates/sql/base/oracle/foreignkey.vm,v
retrieving revision 1.1.2.1
retrieving revision 1.1.2.2
diff -u -r1.1.2.1 -r1.1.2.2
--- foreignkey.vm 20 Oct 2004 22:13:34 -0000 1.1.2.1
+++ foreignkey.vm 10 Dec 2004 19:06:26 -0000 1.1.2.2
@@ -8,6 +8,6 @@
#if ($fk.hasOnDelete())
ON DELETE $fk.OnDelete
#end
-/
+;
#end
1.1.2.2 +2 -19
db-torque/src/generator/src/templates/sql/base/oracle/drop.vm
Index: drop.vm
===================================================================
RCS file:
/home/cvs/db-torque/src/generator/src/templates/sql/base/oracle/drop.vm,v
retrieving revision 1.1.2.1
retrieving revision 1.1.2.2
diff -u -r1.1.2.1 -r1.1.2.2
--- drop.vm 20 Oct 2004 22:13:34 -0000 1.1.2.1
+++ drop.vm 10 Dec 2004 19:06:26 -0000 1.1.2.2
@@ -1,21 +1,4 @@
-DECLARE
- TABLE_DOES_NOT_EXIST EXCEPTION;
- PRAGMA EXCEPTION_INIT(TABLE_DOES_NOT_EXIST, -942);
-BEGIN
- EXECUTE IMMEDIATE 'DROP TABLE $table.Name CASCADE CONSTRAINTS';
-EXCEPTION
- WHEN TABLE_DOES_NOT_EXIST THEN NULL;
-END;
-/
+DROP TABLE $table.Name CASCADE CONSTRAINTS;
#if ($table.IdMethod == "native")
-
-DECLARE
- TABLE_DOES_NOT_EXIST EXCEPTION;
- PRAGMA EXCEPTION_INIT(TABLE_DOES_NOT_EXIST, -942);
-BEGIN
- EXECUTE IMMEDIATE 'DROP SEQUENCE $table.SequenceName';
-EXCEPTION
- WHEN TABLE_DOES_NOT_EXIST THEN NULL;
-END;
-/
+DROP SEQUENCE $table.SequenceName;
#end
1.1.2.2 +1 -2
db-torque/src/generator/src/templates/sql/base/oracle/index.vm
Index: index.vm
===================================================================
RCS file:
/home/cvs/db-torque/src/generator/src/templates/sql/base/oracle/index.vm,v
retrieving revision 1.1.2.1
retrieving revision 1.1.2.2
diff -u -r1.1.2.1 -r1.1.2.2
--- index.vm 20 Oct 2004 22:13:34 -0000 1.1.2.1
+++ index.vm 10 Dec 2004 19:06:26 -0000 1.1.2.2
@@ -1,4 +1,3 @@
#foreach ($index in $table.Indices)
-CREATE#if ($index.Unique)UNIQUE#end INDEX $index.Name ON $table.Name
($index.ColumnList)
-/
+CREATE#if ($index.Unique)UNIQUE#end INDEX $index.Name ON $table.Name
($index.ColumnList);
#end
1.1.2.2 +1 -2
db-torque/src/generator/src/templates/sql/base/oracle/sequence.vm
Index: sequence.vm
===================================================================
RCS file:
/home/cvs/db-torque/src/generator/src/templates/sql/base/oracle/sequence.vm,v
retrieving revision 1.1.2.1
retrieving revision 1.1.2.2
diff -u -r1.1.2.1 -r1.1.2.2
--- sequence.vm 20 Oct 2004 22:13:34 -0000 1.1.2.1
+++ sequence.vm 10 Dec 2004 19:06:26 -0000 1.1.2.2
@@ -1,4 +1,3 @@
#if ($table.IdMethod == "native")
-CREATE SEQUENCE $table.SequenceName INCREMENT BY 1 START WITH 1 NOMAXVALUE
NOCYCLE NOCACHE ORDER
-/
+CREATE SEQUENCE $table.SequenceName INCREMENT BY 1 START WITH 1 NOMAXVALUE
NOCYCLE NOCACHE ORDER;
#end
1.1.2.2 +1 -2
db-torque/src/generator/src/templates/sql/base/oracle/table.vm
Index: table.vm
===================================================================
RCS file:
/home/cvs/db-torque/src/generator/src/templates/sql/base/oracle/table.vm,v
retrieving revision 1.1.2.1
retrieving revision 1.1.2.2
diff -u -r1.1.2.1 -r1.1.2.2
--- table.vm 20 Oct 2004 22:13:34 -0000 1.1.2.1
+++ table.vm 10 Dec 2004 19:06:27 -0000 1.1.2.2
@@ -10,8 +10,7 @@
#if($strings.allEmpty([$unique]))$strings.chop($cols,2)#else$cols#end
#if($unique.length()>0)$strings.chop($unique,2)#end
-)
-/
+);
#set ( $pk = $generator.parse("$basepath/primarykey.vm", "", "table", $tbl) )
#if($pk.length()>0)$pk#end
No revision
No revision
1.1.2.2 +1 -2
db-torque/src/generator/src/templates/sql/load/oracle/row.vm
Index: row.vm
===================================================================
RCS file:
/home/cvs/db-torque/src/generator/src/templates/sql/load/oracle/row.vm,v
retrieving revision 1.1.2.1
retrieving revision 1.1.2.2
diff -u -r1.1.2.1 -r1.1.2.2
--- row.vm 20 Oct 2004 22:13:34 -0000 1.1.2.1
+++ row.vm 10 Dec 2004 19:06:27 -0000 1.1.2.2
@@ -1,4 +1,3 @@
INSERT INTO $row.Table.Name (##
#set ($comma="")#foreach($col in
$row.ColumnValues)$comma${col.Column.Name}#set($comma=",")#end)
- VALUES (#set ($comma="")#foreach($col in
$row.ColumnValues)$comma${generator.parse("sql/load/oracle/val.vm", "",
"column", $col)}#set ($comma=",")#end)
-/
+ VALUES (#set ($comma="")#foreach($col in
$row.ColumnValues)$comma${generator.parse("sql/load/oracle/val.vm", "",
"column", $col)}#set ($comma=",")#end);
No revision
No revision
1.2.2.2 +1 -2
db-torque/src/generator/src/templates/sql/id-table/idtable.oracle
Index: idtable.oracle
===================================================================
RCS file:
/home/cvs/db-torque/src/generator/src/templates/sql/id-table/idtable.oracle,v
retrieving revision 1.2.2.1
retrieving revision 1.2.2.2
diff -u -r1.2.2.1 -r1.2.2.2
--- idtable.oracle 20 Oct 2004 22:13:34 -0000 1.2.2.1
+++ idtable.oracle 10 Dec 2004 19:06:27 -0000 1.2.2.2
@@ -1,5 +1,4 @@
#foreach ($tbl in $tables)
-insert into ID_TABLE (id_table_id, table_name, next_id, quantity) VALUES
($initialID, '$tbl.Name', $initialIDValue, $initialIDStep)
-/
+insert into ID_TABLE (id_table_id, table_name, next_id, quantity) VALUES
($initialID, '$tbl.Name', $initialIDValue, $initialIDStep);
#set ( $initialID = $initialID + 1 )
#end
---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]