Browse Source

Merge pull request #615 in BA/design from ~XIAOXIA/design:dev to dev

* commit 'efda5a486ffdca44437e9c84bbd830784823e7d1':
  rt
  rt
  oracle 存储过程问题
master
superman 8 years ago
parent
commit
31364316b0
  1. 11
      designer_base/src/com/fr/design/data/tabledata/tabledatapane/ProcedureDataPane.java

11
designer_base/src/com/fr/design/data/tabledata/tabledatapane/ProcedureDataPane.java

@ -299,7 +299,6 @@ public class ProcedureDataPane extends AbstractTableDataPane<StoreProcedure> imp
text = StringUtils.EMPTY; text = StringUtils.EMPTY;
} }
text = text.trim(); text = text.trim();
String[] tableName = text.split("\\.");
String connectionname = this.connectionTableProcedurePane.getSelectedDatabaseConnnectonName(); String connectionname = this.connectionTableProcedurePane.getSelectedDatabaseConnnectonName();
try { try {
String procedureText = FRContext.getCurrentEnv().getProcedureText(this.connectionTableProcedurePane.getSelectedDatabaseConnnectonName(), text); String procedureText = FRContext.getCurrentEnv().getProcedureText(this.connectionTableProcedurePane.getSelectedDatabaseConnnectonName(), text);
@ -307,16 +306,16 @@ public class ProcedureDataPane extends AbstractTableDataPane<StoreProcedure> imp
// 获取参数默认值,例如:NAME in varchar2 default 'SCOTT',默认值为SCOTT // 获取参数默认值,例如:NAME in varchar2 default 'SCOTT',默认值为SCOTT
String parameterDefaultValue = ""; String parameterDefaultValue = "";
if (StringUtils.isNotEmpty(procedureText)) { if (StringUtils.isNotEmpty(procedureText)) {
int index_begin = procedureText.indexOf("BEGIN"); int index_begin = procedureText.indexOf("BEGIN");
//from sam: 默认值只会在begin之前声明, 不然会把所有的存储过程里带'xx'的都作为默认值 //from sam: 默认值只会在begin之前声明, 不然会把所有的存储过程里带'xx'的都作为默认值
String defaulValueStr = index_begin == -1 ? procedureText : procedureText.substring(0, index_begin); String defaulValueStr = index_begin == -1 ? procedureText : procedureText.substring(0, index_begin);
String[] strs = defaulValueStr.split("\'"); String[] strs = defaulValueStr.split("\'");
parameterDefaultValue = strs.length > 1 ? strs[1] : parameterDefaultValue; parameterDefaultValue = strs.length > 1 ? strs[1] : parameterDefaultValue;
} }
StoreProcedureParameter[] newparameters; StoreProcedureParameter[] newparameters;
newparameters = FRContext.getCurrentEnv().getStoreProcedureDeclarationParameters(connectionname, tableName[tableName.length - 1], parameterDefaultValue); newparameters = FRContext.getCurrentEnv().getStoreProcedureDeclarationParameters(connectionname, text, parameterDefaultValue);
editorPane.populate(newparameters); editorPane.populate(newparameters);

Loading…
Cancel
Save