public void execute() { final String sqlSep = _session.getQueryTokenizer().getSQLStatementSeparator(); final StringBuffer buf = new StringBuffer(); buf.append("USE "); buf.append(_catalogName); buf.append(sqlSep + "\n"); buf.append("DBCC SHRINKFILE ("); buf.append(_databaseFileName); buf.append(", TRUNCATEONLY)\n"); buf.append(sqlSep); buf.append("\n"); _session.getSessionInternalFrame().getSQLPanelAPI().appendSQLScript(buf.toString(), true); _session.getSessionInternalFrame().getSQLPanelAPI().executeCurrentSQL(); _session.selectMainTab(ISession.IMainPanelTabIndexes.SQL_TAB); } }
public void execute() { StringBuffer sqlBuffer = new StringBuffer(); final String sqlSep = _session.getQueryTokenizer().getSQLStatementSeparator(); sqlBuffer.append("DBCC INDEXDEFRAG("); sqlBuffer.append(_tableInfo.getCatalogName()); sqlBuffer.append(","); sqlBuffer.append(_tableInfo.getSimpleName()); sqlBuffer.append(","); sqlBuffer.append(_indexName); sqlBuffer.append(")\n"); sqlBuffer.append(sqlSep); sqlBuffer.append(" \n"); _session.getSessionInternalFrame().getSQLPanelAPI().appendSQLScript(sqlBuffer.toString(), true); _session.getSessionInternalFrame().getSQLPanelAPI().executeCurrentSQL(); _session.selectMainTab(ISession.IMainPanelTabIndexes.SQL_TAB); } }
public void execute() { StringBuffer sqlBuffer = new StringBuffer(); final String sqlSep = _session.getQueryTokenizer().getSQLStatementSeparator(); sqlBuffer.append("DBCC SHOW_STATISTICS(["); sqlBuffer.append(_tableInfo.getCatalogName()); sqlBuffer.append("."); sqlBuffer.append(_tableInfo.getSchemaName()); sqlBuffer.append("."); sqlBuffer.append(_tableInfo.getSimpleName()); sqlBuffer.append("],"); sqlBuffer.append(_indexName); sqlBuffer.append(")\n"); sqlBuffer.append(sqlSep); sqlBuffer.append("\n"); _session.getSessionInternalFrame().getSQLPanelAPI().appendSQLScript(sqlBuffer.toString(), true); _session.getSessionInternalFrame().getSQLPanelAPI().executeCurrentSQL(); _session.selectMainTab(ISession.IMainPanelTabIndexes.SQL_TAB); } }
public void execute() { if (_dbs.length > 0) { final String sqlSep = _session.getQueryTokenizer().getSQLStatementSeparator(); final StringBuffer buf = new StringBuffer(); for (int i = 0; i < _dbs.length; i++) { final IDatabaseObjectInfo ti = _dbs[i]; buf.append("DBCC SHRINKDATABASE("); buf.append(ti.getSimpleName()); buf.append(",TRUNCATEONLY)"); buf.append("\n"); buf.append(sqlSep); buf.append("\n"); } _session.getSessionInternalFrame().getSQLPanelAPI().appendSQLScript(buf.toString(), true); _session.getSessionInternalFrame().getSQLPanelAPI().executeCurrentSQL(); _session.selectMainTab(ISession.IMainPanelTabIndexes.SQL_TAB); } } }
public void execute() { if (_dbs.length > 0) { final String sqlSep = _session.getQueryTokenizer().getSQLStatementSeparator(); final StringBuffer buf = new StringBuffer(); for (int i = 0; i < _dbs.length; i++) { final IDatabaseObjectInfo ti = _dbs[i]; buf.append("BACKUP LOG " + ti.getSimpleName() + " WITH TRUNCATE_ONLY\n"); buf.append(sqlSep); buf.append("\n"); } _session.getSessionInternalFrame().getSQLPanelAPI().appendSQLScript(buf.toString(), true); _session.getSessionInternalFrame().getSQLPanelAPI().executeCurrentSQL(); _session.selectMainTab(ISession.IMainPanelTabIndexes.SQL_TAB); } } }
/** * Execute this command. */ public void execute() { final IObjectTreeAPI api = _session.getSessionInternalFrame().getObjectTreeAPI(); final IDatabaseObjectInfo[] dbObjs = api.getSelectedDatabaseObjects(); // Get the names of all the selected tables in a comma separated list, StringBuffer tableList = new StringBuffer(512); for (int i = 0; i < dbObjs.length; ++i) { tableList.append(dbObjs[i].getQualifiedName()).append(","); } if (tableList.length() > 0) { tableList.setLength(tableList.length() - 1); // Remove trailing "," } // Execute the SQL command in the SQL tab and then display the SQL tab. final StringBuffer cmd = new StringBuffer(512); cmd.append(getMySQLCommand()) .append(' ') .append(tableList); final String cmdStr = checkSQL(cmd.toString()); if (cmdStr != null && cmdStr.length() > 0) { _session.getSessionInternalFrame().getSQLPanelAPI().appendSQLScript(cmdStr, true); _session.getSessionInternalFrame().getSQLPanelAPI().executeCurrentSQL(); _session.selectMainTab(ISession.IMainPanelTabIndexes.SQL_TAB); } }
public void execute() { final String sqlSep = _session.getQueryTokenizer().getSQLStatementSeparator(); final IObjectTreeAPI api = _session.getSessionInternalFrame().getObjectTreeAPI(); final IDatabaseObjectInfo[] dbObjs = api.getSelectedDatabaseObjects(); // Get the names of all the selected tables in a comma separated list, final StringBuffer cmd = new StringBuffer(512); for (int i = 0; i < dbObjs.length; ++i) { cmd.append("UPDATE STATISTICS "); cmd.append(dbObjs[i].getCatalogName()); cmd.append("."); cmd.append(dbObjs[i].getSchemaName()); cmd.append("."); cmd.append(dbObjs[i].getSimpleName()); cmd.append(" WITH FULLSCAN, ALL\n"); cmd.append(sqlSep); cmd.append("\n"); } if (cmd != null && cmd.length() > 0) { _session.getSessionInternalFrame().getSQLPanelAPI().appendSQLScript(cmd.toString(), true); _session.getSessionInternalFrame().getSQLPanelAPI().executeCurrentSQL(); _session.selectMainTab(ISession.IMainPanelTabIndexes.SQL_TAB); } } }
/** * Execute this command. */ public void execute() { final StringBuffer buf = new StringBuffer(2048); final String sep = " " + _session.getQueryTokenizer().getSQLStatementSeparator(); final IObjectTreeAPI api = _session.getSessionInternalFrame().getObjectTreeAPI(); final IDatabaseObjectInfo[] dbObjs = api.getSelectedDatabaseObjects(); for (int i = 0; i < dbObjs.length; ++i) { final String cmd = getMySQLCommand(dbObjs[i]); if (cmd != null && cmd.length() > 0) { buf.append(cmd).append(" ").append(sep).append('\n'); } } // Execute the SQL command in the SQL tab and then display the SQL tab. if (buf.length() > 0) { _session.getSessionInternalFrame().getSQLPanelAPI().appendSQLScript(buf.toString(), true); _session.getSessionInternalFrame().getSQLPanelAPI().executeCurrentSQL(); _session.selectMainTab(ISession.IMainPanelTabIndexes.SQL_TAB); } }
public void actionPerformed(ActionEvent evt) { if (_panel != null) { CursorChanger cursorChg = new CursorChanger(getApplication().getMainFrame()); cursorChg.show(); try { _panel.executeCurrentSQL(); } finally { cursorChg.restore(); } } } }
public void actionPerformed(ActionEvent evt) { if (_panel != null) { CursorChanger cursorChg = new CursorChanger(getApplication().getMainFrame()); cursorChg.show(); try { _panel.executeCurrentSQL(); } finally { cursorChg.restore(); } } } }