• R/O
  • HTTP
  • SSH
  • HTTPS

rapideact: Commit


Commit MetaInfo

Revisionfb9d25392f1031dff977a3d91bebf14c1c2a4fd2 (tree)
Time2017-06-30 07:25:01
Authorkuboryu <kuboryu@yaho...>
Commiterkuboryu

Log Message

20170630

Change Summary

Incremental Difference

--- a/com/rapide_act/CmnProps.java
+++ b/com/rapide_act/CmnProps.java
@@ -797,7 +797,7 @@ public class CmnProps{
797797 + " b.length as data_precision, "
798798 + " b.scale as data_scale, "
799799 + " case b.nulls"
800- + " when '0' then '〇'"
800+ + " when 'N' then '〇'"
801801 + " else null "
802802 + " end as nullable,"
803803 + " b.default as data_default "
--- a/com/rapide_act/CmnUtils.java
+++ b/com/rapide_act/CmnUtils.java
@@ -336,7 +336,9 @@ public class CmnUtils{
336336 _colType.toUpperCase().equals("VARCHAR") ||
337337 _colType.toUpperCase().equals("VARCHAR2") ||
338338 _colType.toUpperCase().equals("NVARCHAR") ||
339- _colType.toUpperCase().equals("NVARCHAR2")
339+ _colType.toUpperCase().equals("NVARCHAR2") ||
340+ _colType.toUpperCase().equals("GRAPHIC") ||
341+ _colType.toUpperCase().equals("VARGRAPHIC")
340342 ){
341343 return true;
342344 } else {
--- 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_MYSQL || cp.dbType <0){
76+ if (cp.dbType > cp.DB_TYPE_DB2 || cp.dbType <0){
7777 throw new Exception("データベースが対象外です。[" + cp.DB_TYPE_NAME[cp.dbType] + "]");
7878 }
7979 if(cp.inFolder != null){
--- a/com/rapide_act/RapideMetaUnloader.java
+++ b/com/rapide_act/RapideMetaUnloader.java
@@ -441,8 +441,13 @@ public class RapideMetaUnloader{
441441 sbIx2Cnts.append("ALTER TABLE " + cp.DB_SQL_QUOTEDS[cp.dbType]+ strSplit[LINE][COL01] + cp.DB_SQL_QUOTEDE[cp.dbType]+ " DROP CONSTRAINT " + cp.DB_SQL_QUOTEDS[cp.dbType]+ strSplit[LINE][COL02] + cp.DB_SQL_QUOTEDE[cp.dbType]+ cp.SQL_TERMINATOR[cp.dbType]);
442442 }
443443 } else if (strSplit[LINE][COL04].equals("U")){
444- sbIxCnts.append("ALTER TABLE " + cp.DB_SQL_QUOTEDS[cp.dbType]+ strSplit[LINE][COL01] + cp.DB_SQL_QUOTEDE[cp.dbType]+ " ADD CONSTRAINT " + cp.DB_SQL_QUOTEDS[cp.dbType]+ strSplit[LINE][COL02] + cp.DB_SQL_QUOTEDE[cp.dbType]+ " UNIQUE(");
445- sbIx2Cnts.append("ALTER TABLE " + cp.DB_SQL_QUOTEDS[cp.dbType]+ strSplit[LINE][COL01] + cp.DB_SQL_QUOTEDE[cp.dbType]+ " DROP UNIQUE(");
444+ if (cp.dbType == cp.DB_TYPE_DB2){
445+ sbIxCnts.append("CREATE UNIQUE INDEX " + cp.DB_SQL_QUOTEDS[cp.dbType]+ strSplit[LINE][COL02] + cp.DB_SQL_QUOTEDE[cp.dbType] + " ON " + cp.DB_SQL_QUOTEDS[cp.dbType]+ strSplit[LINE][COL01] + cp.DB_SQL_QUOTEDE[cp.dbType]+ " (");
446+ sbIx2Cnts.append("ALTER TABLE " + cp.DB_SQL_QUOTEDS[cp.dbType]+ strSplit[LINE][COL01] + cp.DB_SQL_QUOTEDE[cp.dbType]+ " DROP UNIQUE(");
447+ } else {
448+ sbIxCnts.append("ALTER TABLE " + cp.DB_SQL_QUOTEDS[cp.dbType]+ strSplit[LINE][COL01] + cp.DB_SQL_QUOTEDE[cp.dbType]+ " ADD CONSTRAINT " + cp.DB_SQL_QUOTEDS[cp.dbType]+ strSplit[LINE][COL02] + cp.DB_SQL_QUOTEDE[cp.dbType]+ " UNIQUE(");
449+ sbIx2Cnts.append("ALTER TABLE " + cp.DB_SQL_QUOTEDS[cp.dbType]+ strSplit[LINE][COL01] + cp.DB_SQL_QUOTEDE[cp.dbType]+ " DROP UNIQUE(");
450+ }
446451 } else {
447452 if (cp.dbType == cp.DB_TYPE_MYSQL && !strSplit[LINE][COL03].equals("") && !strSplit[LINE][COL03].equals("BTREE")){
448453 sbIxCnts.append("CREATE " + strSplit[LINE][COL03] + " INDEX " + cp.DB_SQL_QUOTEDS[cp.dbType]+ strSplit[LINE][COL02] + cp.DB_SQL_QUOTEDE[cp.dbType]+ " ON " + strSplit[LINE][COL01] + "(");
@@ -473,7 +478,11 @@ public class RapideMetaUnloader{
473478 sbIx2Cnts.append("ALTER TABLE " + cp.DB_SQL_QUOTEDS[cp.dbType]+ strSplit[LINE][COL01] + cp.DB_SQL_QUOTEDE[cp.dbType]+ " DROP CONSTRAINT " + cp.DB_SQL_QUOTEDS[cp.dbType]+ strSplit[LINE][COL02] + cp.DB_SQL_QUOTEDE[cp.dbType]+ cp.SQL_TERMINATOR[cp.dbType]);
474479 }
475480 } else if (strSplit[LINE][COL04].equals("U")){
476- sbIxCnts.append("ALTER TABLE " + cp.DB_SQL_QUOTEDS[cp.dbType]+ strSplit[LINE][COL01] + cp.DB_SQL_QUOTEDE[cp.dbType]+ " ADD CONSTRAINT " + cp.DB_SQL_QUOTEDS[cp.dbType]+ strSplit[LINE][COL02] + cp.DB_SQL_QUOTEDE[cp.dbType]+ " UNIQUE(");
481+ if (cp.dbType == cp.DB_TYPE_DB2){
482+ sbIxCnts.append("CREATE UNIQUE INDEX " + cp.DB_SQL_QUOTEDS[cp.dbType]+ strSplit[LINE][COL02] + cp.DB_SQL_QUOTEDE[cp.dbType] + " ON " + cp.DB_SQL_QUOTEDS[cp.dbType] + strSplit[LINE][COL01] + cp.DB_SQL_QUOTEDE[cp.dbType]+ " (");
483+ } else {
484+ sbIxCnts.append("ALTER TABLE " + cp.DB_SQL_QUOTEDS[cp.dbType]+ strSplit[LINE][COL01] + cp.DB_SQL_QUOTEDE[cp.dbType]+ " ADD CONSTRAINT " + cp.DB_SQL_QUOTEDS[cp.dbType]+ strSplit[LINE][COL02] + cp.DB_SQL_QUOTEDE[cp.dbType]+ " UNIQUE(");
485+ }
477486 sbIx2Cnts.append("ALTER TABLE " + cp.DB_SQL_QUOTEDS[cp.dbType]+ strSplit[LINE][COL01] + cp.DB_SQL_QUOTEDE[cp.dbType]+ " DROP UNIQUE(");
478487 } else {
479488 if (cp.dbType == cp.DB_TYPE_MYSQL && !strSplit[LINE][COL03].equals("") && !strSplit[LINE][COL03].equals("BTREE")){
@@ -717,7 +726,11 @@ public class RapideMetaUnloader{
717726 cacheSz = strSplit[LINE][COL07];
718727 if(cacheSz.equals("0"))cacheSz="10";
719728 lstNo = strSplit[LINE][COL08];
720- pw[CREATE].print("CREATE SEQUENCE " + cp.DB_SQL_QUOTEDS[cp.dbType]+ seqName + cp.DB_SQL_QUOTEDE[cp.dbType]+ " MINVALUE " + minVal + " MAXVALUE " + maxVal + " INCREMENT BY " + incSz + " START WITH " + lstNo);
729+ if (cp.dbType == cp.DB_TYPE_DB2){
730+ pw[CREATE].print("CREATE SEQUENCE " + cp.DB_SQL_QUOTEDS[cp.dbType]+ seqName + cp.DB_SQL_QUOTEDE[cp.dbType]+ " AS BIGINT MINVALUE " + minVal + " MAXVALUE " + maxVal + " INCREMENT BY " + incSz + " START WITH " + lstNo);
731+ } else {
732+ pw[CREATE].print("CREATE SEQUENCE " + cp.DB_SQL_QUOTEDS[cp.dbType]+ seqName + cp.DB_SQL_QUOTEDE[cp.dbType]+ " MINVALUE " + minVal + " MAXVALUE " + maxVal + " INCREMENT BY " + incSz + " START WITH " + lstNo);
733+ }
721734 if (cp.dbType == cp.DB_TYPE_ORACLE){
722735 pw[CREATE].print(" CACHE " + cacheSz);
723736 if (odFg.equals("N")){
@@ -741,6 +754,22 @@ public class RapideMetaUnloader{
741754 } else {
742755 pw[CREATE].print(" CYCLE");
743756 }
757+ } else if (cp.dbType == cp.DB_TYPE_DB2){
758+ if (cacheSz.equals("")){
759+ pw[CREATE].print(" NO CACHE");
760+ } else {
761+ pw[CREATE].print(" CACHE " + cacheSz);
762+ }
763+ if (cycFg.equals("N")){
764+ pw[CREATE].print(" NO CYCLE");
765+ } else {
766+ pw[CREATE].print(" CYCLE");
767+ }
768+ if (odFg.equals("N")){
769+ pw[CREATE].print(" NO ORDER");
770+ } else {
771+ pw[CREATE].print(" ORDER");
772+ }
744773 }
745774 pw[CREATE].print(cp.SQL_TERMINATOR[cp.dbType]);
746775 pw[DROP].print("DROP SEQUENCE " + cp.DB_SQL_QUOTEDS[cp.dbType]+ seqName + cp.DB_SQL_QUOTEDE[cp.dbType]+ cp.SQL_TERMINATOR[cp.dbType]);
@@ -768,18 +797,18 @@ public class RapideMetaUnloader{
768797 tbName = strSplit[LINE][COL03];
769798 dbLnk = strSplit[LINE][COL04];
770799
771- pw[CREATE].print("CREATE SYNONYM " + cp.DB_SQL_QUOTEDS[cp.dbType]+ synmName + cp.DB_SQL_QUOTEDE[cp.dbType]+ " FOR ");
800+ pw[CREATE].print("CREATE SYNONYM " + cp.DB_SQL_QUOTEDS[cp.dbType] + synmName + cp.DB_SQL_QUOTEDE[cp.dbType] + " FOR ");
772801 if(cp.dbType == cp.DB_TYPE_ORACLE){
773802 if(!dbLnk.equals("")){
774- pw[CREATE].print(cp.DB_SQL_QUOTEDS[cp.dbType]+ tbName + cp.DB_SQL_QUOTEDE[cp.dbType]+ "@" + cp.DB_SQL_QUOTEDS[cp.dbType]+ dbLnk + cp.DB_SQL_QUOTEDS[cp.dbType]);
803+ pw[CREATE].print(cp.DB_SQL_QUOTEDS[cp.dbType] + tbName + cp.DB_SQL_QUOTEDE[cp.dbType] + "@" + cp.DB_SQL_QUOTEDS[cp.dbType]+ dbLnk + cp.DB_SQL_QUOTEDS[cp.dbType]);
775804 } else {
776- pw[CREATE].print(cp.DB_SQL_QUOTEDS[cp.dbType]+ tbOwner + cp.DB_SQL_QUOTEDE[cp.dbType]+ "." + cp.DB_SQL_QUOTEDS[cp.dbType]+ tbName + cp.DB_SQL_QUOTEDE[cp.dbType]);
805+ pw[CREATE].print(cp.DB_SQL_QUOTEDS[cp.dbType] + tbOwner + cp.DB_SQL_QUOTEDE[cp.dbType] + "." + cp.DB_SQL_QUOTEDS[cp.dbType]+ tbName + cp.DB_SQL_QUOTEDE[cp.dbType]);
777806 }
778- } else if(cp.dbType == cp.DB_TYPE_SQLSERVER){
779- pw[CREATE].print(tbName);
807+ } else {
808+ pw[CREATE].print(cp.DB_SQL_QUOTEDS[cp.dbType] + tbName + cp.DB_SQL_QUOTEDE[cp.dbType]);
780809 }
781810 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]);
811+ pw[DROP].print("DROP SYNONYM " + cp.DB_SQL_QUOTEDS[cp.dbType] + synmName + cp.DB_SQL_QUOTEDE[cp.dbType] + cp.SQL_TERMINATOR[cp.dbType]);
783812 for(int i=0;i<strSplit[LINE].length;i++)CmnUtils.debugPrint("'" + strSplit[LINE][i] + "'");
784813 }
785814 for(int i=0;i<pw.length;i++){
Show on old repository browser