Search in sources :

Example 1 with MonetDBBulkLoaderMeta

use of org.pentaho.di.trans.steps.monetdbbulkloader.MonetDBBulkLoaderMeta in project pentaho-kettle by pentaho.

the class MonetDBAgileMart method setTableName.

@Override
public void setTableName(String tableName) {
    MonetDBBulkLoaderMeta meta = getMeta();
    meta.setTableName(tableName);
}
Also used : MonetDBBulkLoaderMeta(org.pentaho.di.trans.steps.monetdbbulkloader.MonetDBBulkLoaderMeta)

Example 2 with MonetDBBulkLoaderMeta

use of org.pentaho.di.trans.steps.monetdbbulkloader.MonetDBBulkLoaderMeta in project pentaho-kettle by pentaho.

the class MonetDBAgileMart method init.

@Override
public boolean init(StepMetaInterface smi, StepDataInterface sdi) {
    MonetDBBulkLoaderMeta stepMeta = (MonetDBBulkLoaderMeta) smi;
    stepMeta.setAutoSchema(true);
    stepMeta.setAutoStringWidths(true);
    stepMeta.setTruncate(true);
    return super.init(smi, sdi);
}
Also used : MonetDBBulkLoaderMeta(org.pentaho.di.trans.steps.monetdbbulkloader.MonetDBBulkLoaderMeta)

Example 3 with MonetDBBulkLoaderMeta

use of org.pentaho.di.trans.steps.monetdbbulkloader.MonetDBBulkLoaderMeta in project pentaho-kettle by pentaho.

the class MonetDBBulkLoaderDialog method create.

// Generate code for create table...
// Conversions done by Database
private void create() {
    try {
        MonetDBBulkLoaderMeta info = new MonetDBBulkLoaderMeta();
        getInfo(info);
        // new name might not yet be linked to other steps!
        String name = stepname;
        SQLStatement sql = info.getTableDdl(transMeta, name, false, null, false);
        if (!sql.hasError()) {
            if (sql.hasSQL()) {
                SQLEditor sqledit = new SQLEditor(transMeta, shell, SWT.NONE, info.getDatabaseMeta(), transMeta.getDbCache(), sql.getSQL());
                sqledit.open();
            } else {
                MessageBox mb = new MessageBox(shell, SWT.OK | SWT.ICON_INFORMATION);
                mb.setMessage(BaseMessages.getString(PKG, "MonetDBBulkLoaderDialog.NoSQLNeeds.DialogMessage"));
                mb.setText(BaseMessages.getString(PKG, "MonetDBBulkLoaderDialog.NoSQLNeeds.DialogTitle"));
                mb.open();
            }
        } else {
            MessageBox mb = new MessageBox(shell, SWT.OK | SWT.ICON_ERROR);
            mb.setMessage(sql.getError());
            mb.setText(BaseMessages.getString(PKG, "MonetDBBulkLoaderDialog.SQLError.DialogTitle"));
            mb.open();
        }
    } catch (KettleException ke) {
        new ErrorDialog(shell, BaseMessages.getString(PKG, "MonetDBBulkLoaderDialog.CouldNotBuildSQL.DialogTitle"), BaseMessages.getString(PKG, "MonetDBBulkLoaderDialog.CouldNotBuildSQL.DialogMessage"), ke);
    }
}
Also used : MonetDBBulkLoaderMeta(org.pentaho.di.trans.steps.monetdbbulkloader.MonetDBBulkLoaderMeta) KettleException(org.pentaho.di.core.exception.KettleException) SQLEditor(org.pentaho.di.ui.core.database.dialog.SQLEditor) ErrorDialog(org.pentaho.di.ui.core.dialog.ErrorDialog) SQLStatement(org.pentaho.di.core.SQLStatement) MessageBox(org.eclipse.swt.widgets.MessageBox)

Aggregations

MonetDBBulkLoaderMeta (org.pentaho.di.trans.steps.monetdbbulkloader.MonetDBBulkLoaderMeta)3 MessageBox (org.eclipse.swt.widgets.MessageBox)1 SQLStatement (org.pentaho.di.core.SQLStatement)1 KettleException (org.pentaho.di.core.exception.KettleException)1 SQLEditor (org.pentaho.di.ui.core.database.dialog.SQLEditor)1 ErrorDialog (org.pentaho.di.ui.core.dialog.ErrorDialog)1