It would be cool if it was possible to create aliases that allow parameters at arbitrary positions: alias mysel "select * from $9 where =" later use it with mysel mytab mycol 42
if\(toExecute.matches\(".\*\(\\\\\{\\\d\\\\\}\).\*"\)\)\{ int countP = \(" "+toExecute+" "\).split\("\(\\\\\{\\\d\\\\\}\)"\).length-1; String\[\] params = param.trim\(\).split\("\[ \]"\); List realParams = new ArrayList\(\); StringBuffer rest = new StringBuffer\(\); for \(int i = 0; i < params.length; i++\) \{ if\( i <countP\)\{ realParams.add\(params\[i\]\); \}else\{ rest.append\(" "+params\[i\]\); \} \} toExecute = MessageFormat.format\(toExecute + rest, realParams.toArray\(\)\); \}else\{ toExecute = toExecute + param; \}
Log in to post a comment.