xiaoxia 8 years ago
parent
commit
efda5a486f
  1. 11
      designer_base/src/com/fr/design/data/tabledata/tabledatapane/ProcedureDataPane.java
  2. 4
      designer_base/src/com/fr/env/RemoteEnv.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 = text.trim();
String[] tableName = text.split("\\.");
String connectionname = this.connectionTableProcedurePane.getSelectedDatabaseConnnectonName();
try {
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
String parameterDefaultValue = "";
if (StringUtils.isNotEmpty(procedureText)) {
int index_begin = procedureText.indexOf("BEGIN");
int index_begin = procedureText.indexOf("BEGIN");
//from sam: 默认值只会在begin之前声明, 不然会把所有的存储过程里带'xx'的都作为默认值
String defaulValueStr = index_begin == -1 ? procedureText : procedureText.substring(0, index_begin);
String[] strs = defaulValueStr.split("\'");
//from sam: 默认值只会在begin之前声明, 不然会把所有的存储过程里带'xx'的都作为默认值
String defaulValueStr = index_begin == -1 ? procedureText : procedureText.substring(0, index_begin);
String[] strs = defaulValueStr.split("\'");
parameterDefaultValue = strs.length > 1 ? strs[1] : parameterDefaultValue;
}
StoreProcedureParameter[] newparameters;
newparameters = FRContext.getCurrentEnv().getStoreProcedureDeclarationParameters(connectionname, tableName, parameterDefaultValue);
newparameters = FRContext.getCurrentEnv().getStoreProcedureDeclarationParameters(connectionname, text, parameterDefaultValue);
editorPane.populate(newparameters);

4
designer_base/src/com/fr/env/RemoteEnv.java vendored

@ -1656,12 +1656,12 @@ public class RemoteEnv implements Env {
}
@Override
public StoreProcedureParameter[] getStoreProcedureDeclarationParameters(String connectionName, String[] databaseName, String parameterDefaultValue) throws Exception {
public StoreProcedureParameter[] getStoreProcedureDeclarationParameters(String connectionName, String databaseName, String parameterDefaultValue) throws Exception {
ByteArrayOutputStream out = new ByteArrayOutputStream();
HashMap<String, String> para = new HashMap<String, String>();
para.put("op", "fr_remote_design");
para.put("cmd", "design_get_sp_parameters");
para.put("__name__", StringUtils.join(".", databaseName));
para.put("__name__", databaseName);
para.put("__default_value__", parameterDefaultValue);
para.put("connectionName", connectionName);

Loading…
Cancel
Save