• R/O
  • HTTP
  • SSH
  • HTTPS

rapideact: Commit


Commit MetaInfo

Revision207cf6c7b5dd089fc994592765c8cc5b5aabb2d8 (tree)
Time2017-06-17 06:42:23
Authorkuboryu <kuboryu@yaho...>
Commiterkuboryu

Log Message

20170617

Change Summary

Incremental Difference

--- a/com/rapide_act/CmnProps.java
+++ b/com/rapide_act/CmnProps.java
@@ -39,7 +39,7 @@ public class CmnProps{
3939 protected static final String [] DB_TYPE_NAME = {"ORACLE", "SQLSERVER", "MYSQL", "DB2", "POSTGRESQL", "HIRDB"};
4040 protected static final String [] DB_SQL_QUOTEDS = {"\"", "[", "`", "\"", "\"", "\""};
4141 protected static final String [] DB_SQL_QUOTEDE = {"\"", "]", "`", "\"", "\"", "\""};
42- protected static final String [] SQL_TERMINATOR = {";", System.getProperty("line.separator") + "GO", ";", ";", ";", ";"};
42+ protected static final String [] SQL_TERMINATOR = {";" + System.getProperty("line.separator"), System.getProperty("line.separator") + "GO" + System.getProperty("line.separator"), ";" + System.getProperty("line.separator"), ";", ";", ";"};
4343 protected static final String [] SQL_PREFIX = {"@", ":r ", "source ", "", "", ""};
4444 protected static final String [] SQL_COMMENT_MARK = {"--", "--", "--", "--", "--", "--"};
4545 protected static final int MASK_PTN_ALL = 0;
--- a/com/rapide_act/CmnUtils.java
+++ b/com/rapide_act/CmnUtils.java
@@ -598,7 +598,18 @@ public class CmnUtils{
598598 return false;
599599 }
600600 }
601-
601+
602+ protected static boolean isCharacterSet(String _str) throws Exception{
603+ if(
604+ _str.toUpperCase().equals("CP932") ||
605+ _str.toUpperCase().equals("UTF8") ||
606+ _str.toUpperCase().equals("UJIS")){
607+ return true;
608+ } else {
609+ return false;
610+ }
611+ }
612+
602613 protected static String[] getSystemProperty(String _str) throws Exception{
603614 String [] retValue = null;
604615 if(System.getProperty(_str)!=null){
--- a/com/rapide_act/RapideMetaLoader.java
+++ b/com/rapide_act/RapideMetaLoader.java
@@ -73,7 +73,7 @@ public class RapideMetaLoader{
7373 cp = new CmnProps();
7474 cp.setProperty(database);
7575
76- if (cp.dbType > cp.DB_TYPE_SQLSERVER || cp.dbType <0){
76+ if (cp.dbType > cp.DB_TYPE_MYSQL || cp.dbType <0){
7777 throw new Exception("データベースが対象外です。[" + cp.DB_TYPE_NAME[cp.dbType] + "]");
7878 }
7979 if(cp.inFolder != null){
@@ -211,7 +211,7 @@ public class RapideMetaLoader{
211211 }
212212 }
213213 } else {
214- sqlLine = CmnUtils.split(strMltLine, ";");
214+ sqlLine = CmnUtils.split(strMltLine, _cp.SQL_TERMINATOR[_cp.dbType]);
215215 for(int l = 0;l<sqlLine.length;l++){
216216 if(!sqlLine[l].equals("")){
217217 try {
--- a/com/rapide_act/RapideMetaUnloader.java
+++ b/com/rapide_act/RapideMetaUnloader.java
@@ -263,8 +263,8 @@ public class RapideMetaUnloader{
263263 }
264264 if (!strSplit[LINE][COL01].equals(tableName)){
265265 pw[CREATE].println(cp.SQL_PREFIX[cp.dbType] + "TABLES/" + tableName + ".sql");
266- pw[DROP].println("DROP TABLE " + cp.DB_SQL_QUOTEDS[cp.dbType]+ tableName + cp.DB_SQL_QUOTEDE[cp.dbType]+ cp.DROP_OPTION[cp.dbType] + cp.SQL_TERMINATOR[cp.dbType]);
267- pw[TRUNCATE].println("TRUNCATE TABLE " + cp.DB_SQL_QUOTEDS[cp.dbType]+ tableName + cp.DB_SQL_QUOTEDE[cp.dbType]+ cp.SQL_TERMINATOR[cp.dbType]);
266+ pw[DROP].print("DROP TABLE " + cp.DB_SQL_QUOTEDS[cp.dbType]+ tableName + cp.DB_SQL_QUOTEDE[cp.dbType]+ cp.DROP_OPTION[cp.dbType] + cp.SQL_TERMINATOR[cp.dbType]);
267+ pw[TRUNCATE].print("TRUNCATE TABLE " + cp.DB_SQL_QUOTEDS[cp.dbType]+ tableName + cp.DB_SQL_QUOTEDE[cp.dbType]+ cp.SQL_TERMINATOR[cp.dbType]);
268268 sbTbCnts.append(cp.lineSeparator);
269269 sbTbCnts.append(")" + cp.SQL_TERMINATOR[cp.dbType]);
270270 sbTbCnts.append(cp.lineSeparator);
@@ -343,8 +343,8 @@ public class RapideMetaUnloader{
343343 sbTbCnts.append(" NULL");
344344 }
345345 pw[CREATE].println(cp.SQL_PREFIX[cp.dbType] + "TABLES/" + tableName + ".sql");
346- pw[DROP].println("DROP TABLE " + cp.DB_SQL_QUOTEDS[cp.dbType]+ tableName + cp.DB_SQL_QUOTEDE[cp.dbType]+ cp.DROP_OPTION[cp.dbType] + cp.SQL_TERMINATOR[cp.dbType]);
347- pw[TRUNCATE].println("TRUNCATE TABLE " + cp.DB_SQL_QUOTEDS[cp.dbType]+ tableName + cp.DB_SQL_QUOTEDE[cp.dbType]+ cp.SQL_TERMINATOR[cp.dbType]);
346+ pw[DROP].print("DROP TABLE " + cp.DB_SQL_QUOTEDS[cp.dbType]+ tableName + cp.DB_SQL_QUOTEDE[cp.dbType]+ cp.DROP_OPTION[cp.dbType] + cp.SQL_TERMINATOR[cp.dbType]);
347+ pw[TRUNCATE].print("TRUNCATE TABLE " + cp.DB_SQL_QUOTEDS[cp.dbType]+ tableName + cp.DB_SQL_QUOTEDE[cp.dbType]+ cp.SQL_TERMINATOR[cp.dbType]);
348348 sbTbCnts.append(cp.lineSeparator);
349349 sbTbCnts.append(")" + cp.SQL_TERMINATOR[cp.dbType]);
350350 sbTbCnts.append(cp.lineSeparator);
@@ -549,7 +549,7 @@ public class RapideMetaUnloader{
549549 strSplit[LINE] = CmnUtils.split(strLine, cp.delimiter);
550550 CmnUtils.debugPrint("'" + strSplit[LINE][COL01] + "'");
551551 pw[CREATE].println(cp.SQL_PREFIX[cp.dbType] + "VIEWS/" + strSplit[LINE][COL01] + ".sql");
552- pw[DROP].println("DROP VIEW " + cp.DB_SQL_QUOTEDS[cp.dbType]+ strSplit[LINE][COL01] + cp.DB_SQL_QUOTEDE[cp.dbType]+ cp.SQL_TERMINATOR[cp.dbType]);
552+ pw[DROP].print("DROP VIEW " + cp.DB_SQL_QUOTEDS[cp.dbType]+ strSplit[LINE][COL01] + cp.DB_SQL_QUOTEDE[cp.dbType]+ cp.SQL_TERMINATOR[cp.dbType]);
553553 if (strSplit[LINE].length>1)CmnUtils.debugPrint("'" + strSplit[LINE][COL02] + "'");
554554 pw[CONTENTS] = new PrintWriter(new BufferedWriter(new FileWriter(new File(subFolder + "/" + strSplit[LINE][COL01] + ".sql"))));
555555
@@ -593,12 +593,12 @@ public class RapideMetaUnloader{
593593 strContents = alData2.get(0).trim();
594594 strSplit[1] = CmnUtils.split(strContents, cp.lineSeparator);
595595 for(int i=0;i<strSplit[1].length;i++)if(!strSplit[1][i].trim().equals(""))pw[CONTENTS].println(strSplit[1][i].replaceAll("\"\"","\"").replaceAll(Pattern.quote(cp.user.toUpperCase() + "."),"").replaceAll(Pattern.quote(cp.user.toLowerCase() + "."),""));
596- pw[CONTENTS].println(cp.SQL_TERMINATOR[cp.dbType]);
596+ pw[CONTENTS].print(cp.SQL_TERMINATOR[cp.dbType]);
597597
598- if (!strSplit[LINE][COL02].trim().equals(""))pw[CONTENTS].println(commentOnTable(cp, strSplit[LINE][COL01], strSplit[LINE][COL02], cp.TYPE_VIEW));
598+ if (!strSplit[LINE][COL02].trim().equals(""))pw[CONTENTS].print(commentOnTable(cp, strSplit[LINE][COL01], strSplit[LINE][COL02], cp.TYPE_VIEW));
599599 for(int i=0;i<alData.size();i++){
600600 if ((i+1) % columnCount == 0){
601- if (!alData.get(i).trim().equals(""))pw[CONTENTS].println(commentOnColumn(cp, strSplit[LINE][COL01], alData.get(i-1), alData.get(i), cp.TYPE_VIEW));
601+ if (!alData.get(i).trim().equals(""))pw[CONTENTS].print(commentOnColumn(cp, strSplit[LINE][COL01], alData.get(i-1), alData.get(i), cp.TYPE_VIEW));
602602 }
603603 }
604604 pw[CONTENTS].close();
@@ -625,32 +625,67 @@ public class RapideMetaUnloader{
625625 strSplit[LINE] = CmnUtils.split(strLine, cp.delimiter);
626626 CmnUtils.debugPrint("'" + strSplit[LINE][COL01] + "'");
627627 pw[CREATE].println(cp.SQL_PREFIX[cp.dbType] + "PROCEDURES/" + strSplit[LINE][COL01] + ".sql");
628- pw[DROP].println("DROP " + strSplit[LINE][COL02] + " " + cp.DB_SQL_QUOTEDS[cp.dbType] + strSplit[LINE][COL01] + cp.DB_SQL_QUOTEDE[cp.dbType] + cp.SQL_TERMINATOR[cp.dbType]);
628+ pw[DROP].print("DROP " + strSplit[LINE][COL02] + " " + cp.DB_SQL_QUOTEDS[cp.dbType] + strSplit[LINE][COL01] + cp.DB_SQL_QUOTEDE[cp.dbType] + cp.SQL_TERMINATOR[cp.dbType]);
629629 if (strSplit[LINE].length>1)CmnUtils.debugPrint("'" + strSplit[LINE][COL02] + "'");
630630 pw[CONTENTS] = new PrintWriter(new BufferedWriter(new FileWriter(new File(subFolder + "/" + strSplit[LINE][COL01] + ".sql"))));
631631 if (cp.dbType == cp.DB_TYPE_ORACLE){
632632 pw[CONTENTS].println("/* " + strSplit[LINE][COL01] + " */");
633633 pw[CONTENTS].print("CREATE OR REPLACE ");
634- } else if (cp.dbType == cp.DB_TYPE_MYSQL){
634+ }
635+ if (cp.dbType == cp.DB_TYPE_MYSQL){
635636 if(strSplit[LINE][COL02].equals("TRIGGER")){
636- pw[CONTENTS].println("CREATE " + strSplit[LINE][COL02] + " " + cp.DB_SQL_QUOTEDS[cp.dbType] + strSplit[LINE][COL01] + cp.DB_SQL_QUOTEDE[cp.dbType] + " " + strSplit[LINE][COL03] + " " + strSplit[LINE][COL04] + " ON " + cp.DB_SQL_QUOTEDS[cp.dbType] + strSplit[LINE][COL05] + cp.DB_SQL_QUOTEDE[cp.dbType] + " FOR EACH ROW");
637- } else {
638- pw[CONTENTS].println("CREATE " + strSplit[LINE][COL02] + " " + cp.DB_SQL_QUOTEDS[cp.dbType] + strSplit[LINE][COL01] + cp.DB_SQL_QUOTEDE[cp.dbType]);
637+ stmt = dao.prepareSql("show create trigger " + cp.DB_SQL_QUOTEDS[cp.dbType] + strSplit[LINE][COL01] + cp.DB_SQL_QUOTEDE[cp.dbType]);
638+ } else if (strSplit[LINE][COL02].equals("PROCEDURE")){
639+ stmt = dao.prepareSql("show create procedure " + cp.DB_SQL_QUOTEDS[cp.dbType] + strSplit[LINE][COL01] + cp.DB_SQL_QUOTEDE[cp.dbType]);
640+ } else if (strSplit[LINE][COL02].equals("FUNCTION")){
641+ stmt = dao.prepareSql("show create function " + cp.DB_SQL_QUOTEDS[cp.dbType] + strSplit[LINE][COL01] + cp.DB_SQL_QUOTEDE[cp.dbType]);
639642 }
643+ } else {
644+ stmt = dao.prepareSql(cp.sql_proc[cp.dbType]);
645+ stmt.setString(1,strSplit[LINE][COL02]);
646+ stmt.setString(2,strSplit[LINE][COL01]);
640647 }
641- stmt = dao.prepareSql(cp.sql_proc[cp.dbType]);
642- stmt.setString(1,strSplit[LINE][COL02]);
643- stmt.setString(2,strSplit[LINE][COL01]);
644648 dao.executeSql();
645649 alData = dao.getArrayList();
650+ boolean mysql_s_flag = false;
651+ boolean mysql_e_flag = false;
646652 for(int i=0;i<alData.size();i++){
647653 strContents = alData.get(i);
648- if(!strContents.equals(""))pw[CONTENTS].println(strContents.replaceAll("\"\"","\"").replaceAll(Pattern.quote(cp.user.toUpperCase() + "."),"").replaceAll(Pattern.quote(cp.user.toLowerCase() + "."),""));
654+ if (cp.dbType == cp.DB_TYPE_MYSQL){
655+ if(!mysql_s_flag){
656+ String [] spcDiv = CmnUtils.split(strContents," ");
657+ if(spcDiv.length >0 && spcDiv[0].toUpperCase().equals("CREATE")){
658+ mysql_s_flag = true;
659+ for(int j=0;j<spcDiv.length;j++){
660+ if(j==0){
661+ pw[CONTENTS].print(spcDiv[j]);
662+ } else if(j!=1) {
663+ pw[CONTENTS].print(" " + spcDiv[j]);
664+ }
665+ }
666+ }
667+ } else if(mysql_s_flag && !mysql_e_flag){
668+ String [] spcDiv = CmnUtils.split(strContents," ");
669+ if(spcDiv.length >0 && CmnUtils.isCharacterSet(spcDiv[0])){
670+ mysql_e_flag = true;
671+ pw[CONTENTS].println("");
672+ } else {
673+ for(int j=0;j<spcDiv.length;j++){
674+ if(j==0){
675+ pw[CONTENTS].print(spcDiv[j]);
676+ } else {
677+ pw[CONTENTS].print(" " + spcDiv[j]);
678+ }
679+ }
680+ }
681+ }
682+ } else {
683+ if(!strContents.equals(""))pw[CONTENTS].println(strContents.replaceAll("\"\"","\"").replaceAll(Pattern.quote(cp.user.toUpperCase() + "."),"").replaceAll(Pattern.quote(cp.user.toLowerCase() + "."),""));
684+ }
649685 }
650686
651687 if (cp.dbType == cp.DB_TYPE_SQLSERVER){
652- pw[CONTENTS].println(cp.SQL_TERMINATOR[cp.dbType]);
653- //pw[CONTENTS].println("/");
688+ pw[CONTENTS].print(cp.SQL_TERMINATOR[cp.dbType]);
654689 }
655690 pw[CONTENTS].close();
656691 pw[CONTENTS] = null;
@@ -707,8 +742,8 @@ public class RapideMetaUnloader{
707742 pw[CREATE].print(" CYCLE");
708743 }
709744 }
710- pw[CREATE].println(cp.SQL_TERMINATOR[cp.dbType]);
711- pw[DROP].println("DROP SEQUENCE " + cp.DB_SQL_QUOTEDS[cp.dbType]+ seqName + cp.DB_SQL_QUOTEDE[cp.dbType]+ cp.SQL_TERMINATOR[cp.dbType]);
745+ pw[CREATE].print(cp.SQL_TERMINATOR[cp.dbType]);
746+ pw[DROP].print("DROP SEQUENCE " + cp.DB_SQL_QUOTEDS[cp.dbType]+ seqName + cp.DB_SQL_QUOTEDE[cp.dbType]+ cp.SQL_TERMINATOR[cp.dbType]);
712747 for(int i=0;i<strSplit[LINE].length;i++)CmnUtils.debugPrint("'" + strSplit[LINE][i] + "'");
713748 }
714749 for(int i=0;i<pw.length;i++){
@@ -743,8 +778,8 @@ public class RapideMetaUnloader{
743778 } else if(cp.dbType == cp.DB_TYPE_SQLSERVER){
744779 pw[CREATE].print(tbName);
745780 }
746- pw[CREATE].println(cp.SQL_TERMINATOR[cp.dbType]);
747- pw[DROP].println("DROP SYNONYM " + cp.DB_SQL_QUOTEDS[cp.dbType]+ synmName + cp.DB_SQL_QUOTEDE[cp.dbType]+ cp.SQL_TERMINATOR[cp.dbType]);
781+ pw[CREATE].print(cp.SQL_TERMINATOR[cp.dbType]);
782+ pw[DROP].print("DROP SYNONYM " + cp.DB_SQL_QUOTEDS[cp.dbType]+ synmName + cp.DB_SQL_QUOTEDE[cp.dbType]+ cp.SQL_TERMINATOR[cp.dbType]);
748783 for(int i=0;i<strSplit[LINE].length;i++)CmnUtils.debugPrint("'" + strSplit[LINE][i] + "'");
749784 }
750785 for(int i=0;i<pw.length;i++){
@@ -774,11 +809,11 @@ public class RapideMetaUnloader{
774809 while((strLine=br[WK_FILE].readLine()) != null){
775810 strSplit[LINE] = CmnUtils.split(strLine, cp.delimiter);
776811 if(!fkName.equals(strSplit[LINE][COL02]) && !fkName.equals("")){
777- pw[CREATE].println("ALTER TABLE " + cp.DB_SQL_QUOTEDS[cp.dbType]+ tbName + cp.DB_SQL_QUOTEDE[cp.dbType]+ " ADD CONSTRAINT " + cp.DB_SQL_QUOTEDS[cp.dbType]+ fkName + cp.DB_SQL_QUOTEDE[cp.dbType]+ " FOREIGN KEY (" + cp.DB_SQL_QUOTEDS[cp.dbType]+ fkCol + cp.DB_SQL_QUOTEDE[cp.dbType]+ ") REFERENCES " + cp.DB_SQL_QUOTEDS[cp.dbType]+ rtbName + cp.DB_SQL_QUOTEDE[cp.dbType]+ " (" + cp.DB_SQL_QUOTEDS[cp.dbType]+ rfkCol + cp.DB_SQL_QUOTEDE[cp.dbType]+ ")" + cp.SQL_TERMINATOR[cp.dbType]);
812+ pw[CREATE].print("ALTER TABLE " + cp.DB_SQL_QUOTEDS[cp.dbType]+ tbName + cp.DB_SQL_QUOTEDE[cp.dbType]+ " ADD CONSTRAINT " + cp.DB_SQL_QUOTEDS[cp.dbType]+ fkName + cp.DB_SQL_QUOTEDE[cp.dbType]+ " FOREIGN KEY (" + cp.DB_SQL_QUOTEDS[cp.dbType]+ fkCol + cp.DB_SQL_QUOTEDE[cp.dbType]+ ") REFERENCES " + cp.DB_SQL_QUOTEDS[cp.dbType]+ rtbName + cp.DB_SQL_QUOTEDE[cp.dbType]+ " (" + cp.DB_SQL_QUOTEDS[cp.dbType]+ rfkCol + cp.DB_SQL_QUOTEDE[cp.dbType]+ ")" + cp.SQL_TERMINATOR[cp.dbType]);
778813 if(cp.dbType == cp.DB_TYPE_MYSQL){
779- pw[DROP].println("ALTER TABLE " + cp.DB_SQL_QUOTEDS[cp.dbType]+ tbName + cp.DB_SQL_QUOTEDE[cp.dbType]+ " DROP FOREIGN KEY " + cp.DB_SQL_QUOTEDS[cp.dbType]+ fkName + cp.DB_SQL_QUOTEDE[cp.dbType]+ cp.SQL_TERMINATOR[cp.dbType]);
814+ pw[DROP].print("ALTER TABLE " + cp.DB_SQL_QUOTEDS[cp.dbType]+ tbName + cp.DB_SQL_QUOTEDE[cp.dbType]+ " DROP FOREIGN KEY " + cp.DB_SQL_QUOTEDS[cp.dbType]+ fkName + cp.DB_SQL_QUOTEDE[cp.dbType]+ cp.SQL_TERMINATOR[cp.dbType]);
780815 } else {
781- pw[DROP].println("ALTER TABLE " + cp.DB_SQL_QUOTEDS[cp.dbType]+ tbName + cp.DB_SQL_QUOTEDE[cp.dbType]+ " DROP CONSTRAINT " + cp.DB_SQL_QUOTEDS[cp.dbType]+ fkName + cp.DB_SQL_QUOTEDE[cp.dbType]+ cp.SQL_TERMINATOR[cp.dbType]);
816+ pw[DROP].print("ALTER TABLE " + cp.DB_SQL_QUOTEDS[cp.dbType]+ tbName + cp.DB_SQL_QUOTEDE[cp.dbType]+ " DROP CONSTRAINT " + cp.DB_SQL_QUOTEDS[cp.dbType]+ fkName + cp.DB_SQL_QUOTEDE[cp.dbType]+ cp.SQL_TERMINATOR[cp.dbType]);
782817 }
783818 for(int i=0;i<strSplit[LINE].length;i++)CmnUtils.debugPrint("'" + strSplit[LINE][i] + "'");
784819 tbName = strSplit[LINE][COL01];
@@ -809,11 +844,11 @@ public class RapideMetaUnloader{
809844 }
810845
811846 }
812- pw[CREATE].println("ALTER TABLE " + cp.DB_SQL_QUOTEDS[cp.dbType]+ tbName + cp.DB_SQL_QUOTEDE[cp.dbType]+ " ADD CONSTRAINT " + cp.DB_SQL_QUOTEDS[cp.dbType]+ fkName + cp.DB_SQL_QUOTEDE[cp.dbType]+ " FOREIGN KEY (" + cp.DB_SQL_QUOTEDS[cp.dbType]+ fkCol + cp.DB_SQL_QUOTEDE[cp.dbType]+ ") REFERENCES " + cp.DB_SQL_QUOTEDS[cp.dbType]+ rtbName + cp.DB_SQL_QUOTEDE[cp.dbType]+ " (" + cp.DB_SQL_QUOTEDS[cp.dbType]+ rfkCol + cp.DB_SQL_QUOTEDE[cp.dbType]+ ")" + cp.SQL_TERMINATOR[cp.dbType]);
847+ pw[CREATE].print("ALTER TABLE " + cp.DB_SQL_QUOTEDS[cp.dbType]+ tbName + cp.DB_SQL_QUOTEDE[cp.dbType]+ " ADD CONSTRAINT " + cp.DB_SQL_QUOTEDS[cp.dbType]+ fkName + cp.DB_SQL_QUOTEDE[cp.dbType]+ " FOREIGN KEY (" + cp.DB_SQL_QUOTEDS[cp.dbType]+ fkCol + cp.DB_SQL_QUOTEDE[cp.dbType]+ ") REFERENCES " + cp.DB_SQL_QUOTEDS[cp.dbType]+ rtbName + cp.DB_SQL_QUOTEDE[cp.dbType]+ " (" + cp.DB_SQL_QUOTEDS[cp.dbType]+ rfkCol + cp.DB_SQL_QUOTEDE[cp.dbType]+ ")" + cp.SQL_TERMINATOR[cp.dbType]);
813848 if(cp.dbType == cp.DB_TYPE_MYSQL){
814- pw[DROP].println("ALTER TABLE " + cp.DB_SQL_QUOTEDS[cp.dbType]+ tbName + cp.DB_SQL_QUOTEDE[cp.dbType]+ " DROP FOREIGN KEY " + cp.DB_SQL_QUOTEDS[cp.dbType]+ fkName + cp.DB_SQL_QUOTEDE[cp.dbType]+ cp.SQL_TERMINATOR[cp.dbType]);
849+ pw[DROP].print("ALTER TABLE " + cp.DB_SQL_QUOTEDS[cp.dbType]+ tbName + cp.DB_SQL_QUOTEDE[cp.dbType]+ " DROP FOREIGN KEY " + cp.DB_SQL_QUOTEDS[cp.dbType]+ fkName + cp.DB_SQL_QUOTEDE[cp.dbType]+ cp.SQL_TERMINATOR[cp.dbType]);
815850 } else {
816- pw[DROP].println("ALTER TABLE " + cp.DB_SQL_QUOTEDS[cp.dbType]+ tbName + cp.DB_SQL_QUOTEDE[cp.dbType]+ " DROP CONSTRAINT " + cp.DB_SQL_QUOTEDS[cp.dbType]+ fkName + cp.DB_SQL_QUOTEDE[cp.dbType]+ cp.SQL_TERMINATOR[cp.dbType]);
851+ pw[DROP].print("ALTER TABLE " + cp.DB_SQL_QUOTEDS[cp.dbType]+ tbName + cp.DB_SQL_QUOTEDE[cp.dbType]+ " DROP CONSTRAINT " + cp.DB_SQL_QUOTEDS[cp.dbType]+ fkName + cp.DB_SQL_QUOTEDE[cp.dbType]+ cp.SQL_TERMINATOR[cp.dbType]);
817852 }
818853 for(int i=0;i<pw.length;i++){
819854 if(pw[i]!=null){
@@ -870,9 +905,9 @@ public class RapideMetaUnloader{
870905 pw[W_CREATE_PKEY].print(" BUFFER_POOL " + bufPool + ")");
871906 pw[W_CREATE_PKEY].print(" TABLESPACE " + cp.DB_SQL_QUOTEDS[cp.dbType]+ tblSpace + cp.DB_SQL_QUOTEDE[cp.dbType]);
872907 if(logging.equals("NO")){
873- pw[W_CREATE_PKEY].println(" NOLOGGING" + cp.SQL_TERMINATOR[cp.dbType]);
908+ pw[W_CREATE_PKEY].print(" NOLOGGING" + cp.SQL_TERMINATOR[cp.dbType]);
874909 } else {
875- pw[W_CREATE_PKEY].println(cp.SQL_TERMINATOR[cp.dbType]);
910+ pw[W_CREATE_PKEY].print(cp.SQL_TERMINATOR[cp.dbType]);
876911 }
877912 } else {
878913 pw[W_CREATE_PKEY].println(strLine);
@@ -906,9 +941,9 @@ public class RapideMetaUnloader{
906941 pw[W_CREATE_UKEY].print(" BUFFER_POOL " + bufPool + ")");
907942 pw[W_CREATE_UKEY].print(" TABLESPACE " + cp.DB_SQL_QUOTEDS[cp.dbType]+ tblSpace + cp.DB_SQL_QUOTEDE[cp.dbType]);
908943 if(logging.equals("NO")){
909- pw[W_CREATE_UKEY].println(" NOLOGGING" + cp.SQL_TERMINATOR[cp.dbType]);
944+ pw[W_CREATE_UKEY].print(" NOLOGGING" + cp.SQL_TERMINATOR[cp.dbType]);
910945 } else {
911- pw[W_CREATE_UKEY].println(cp.SQL_TERMINATOR[cp.dbType]);
946+ pw[W_CREATE_UKEY].print(cp.SQL_TERMINATOR[cp.dbType]);
912947 }
913948 } else {
914949 pw[W_CREATE_UKEY].println(strLine);
@@ -942,9 +977,9 @@ public class RapideMetaUnloader{
942977 pw[W_CREATE_INDEX].print(" BUFFER_POOL " + bufPool + ")");
943978 pw[W_CREATE_INDEX].print(" TABLESPACE " + cp.DB_SQL_QUOTEDS[cp.dbType]+ tblSpace + cp.DB_SQL_QUOTEDE[cp.dbType]);
944979 if(logging.equals("NO")){
945- pw[W_CREATE_INDEX].println(" NOLOGGING" + cp.SQL_TERMINATOR[cp.dbType]);
980+ pw[W_CREATE_INDEX].print(" NOLOGGING" + cp.SQL_TERMINATOR[cp.dbType]);
946981 } else {
947- pw[W_CREATE_INDEX].println(cp.SQL_TERMINATOR[cp.dbType]);
982+ pw[W_CREATE_INDEX].print(cp.SQL_TERMINATOR[cp.dbType]);
948983 }
949984 } else {
950985 pw[W_CREATE_INDEX].println(strLine);
@@ -992,7 +1027,7 @@ public class RapideMetaUnloader{
9921027 br[WK_FILE] = new BufferedReader(new FileReader(tb));
9931028 pw[CONTENTS] = new PrintWriter(new BufferedWriter(new FileWriter(oTb)));
9941029 while((strLine=br[WK_FILE].readLine()) != null){
995- if(strLine.equals(")" + cp.SQL_TERMINATOR[cp.dbType])){
1030+ if(strLine.equals(");")){
9961031 rowNo = CmnUtils.getArrayRowNo(alData, 12, 1, tbName);
9971032 if (rowNo != -1){
9981033 rowData = CmnUtils.getArrayRowData(alData, 12, rowNo);
@@ -1018,12 +1053,12 @@ public class RapideMetaUnloader{
10181053 pw[CONTENTS].print(" BUFFER_POOL " + bufPool + ")");
10191054 pw[CONTENTS].print(" TABLESPACE " + cp.DB_SQL_QUOTEDS[cp.dbType]+ tblSpace + cp.DB_SQL_QUOTEDE[cp.dbType]);
10201055 if(logging.equals("NO")){
1021- pw[CONTENTS].println(" NOLOGGING" + cp.SQL_TERMINATOR[cp.dbType]);
1056+ pw[CONTENTS].print(" NOLOGGING" + cp.SQL_TERMINATOR[cp.dbType]);
10221057 } else {
1023- pw[CONTENTS].println(cp.SQL_TERMINATOR[cp.dbType]);
1058+ pw[CONTENTS].print(cp.SQL_TERMINATOR[cp.dbType]);
10241059 }
10251060 } else {
1026- pw[CONTENTS].println(")" + cp.SQL_TERMINATOR[cp.dbType]);
1061+ pw[CONTENTS].print(")" + cp.SQL_TERMINATOR[cp.dbType]);
10271062 }
10281063 } else {
10291064 pw[CONTENTS].println(strLine);
Show on old repository browser