Problem with $ character

Support/help with CloverETL (4.9) and CloverDX (5.0 or newer) implementation problems

aar
Posts: 5
Joined: Fri Nov 14, 2008 12:17 pm

Problem with $ character

Postby aar » Fri Nov 14, 2008 6:56 pm

Hi,

I've installed last version of cloverGUI and clover engine and I have a new problem. I've a database schema called ops$dbo the problem is that clover tries to interprete the $ like a parameter.

Is there a way to fix this bug?

Regards,

Arno

avackova
Posts: 841
Joined: Fri Jul 20, 2007 9:28 am

Postby avackova » Tue Nov 18, 2008 9:09 am

Could you write error message?
Agata Vackova
Javlin a.s.
[email protected]

aar
Posts: 5
Joined: Fri Nov 14, 2008 12:17 pm

Postby aar » Wed Nov 19, 2008 7:34 pm

Code: Select all

org.jetel.exception.JetelException: Maximum # of errors exceeded when inserting record. Exeption thrown by: insert into ops\?.oecgr values(?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?). Message: Pas de valeur spécifiée pour le paramètre 56. caused by: org.postgresql.util.PSQLException: Pas de valeur spécifiée pour le paramètre 56.
   at org.jetel.component.DBOutputTable.runInNormalMode(DBOutputTable.java:718)
   at org.jetel.component.DBOutputTable.execute(DBOutputTable.java:640)
   at org.jetel.graph.Node.run(Node.java:379)
   at java.lang.Thread.run(Unknown Source)
Caused by: org.postgresql.util.PSQLException: Pas de valeur spécifiée pour le paramètre 56.
   at org.postgresql.core.v3.SimpleParameterList.checkAllParametersSet(SimpleParameterList.java:146)
   at org.postgresql.core.v3.QueryExecutorImpl.execute(QueryExecutorImpl.java:182)
   at org.postgresql.jdbc2.AbstractJdbc2Statement.execute(AbstractJdbc2Statement.java:452)
   at org.postgresql.jdbc2.AbstractJdbc2Statement.executeWithFlags(AbstractJdbc2Statement.java:351)
   at org.postgresql.jdbc2.AbstractJdbc2Statement.executeUpdate(AbstractJdbc2Statement.java:305)
   at org.jetel.connection.jdbc.SQLCloverStatement.executeUpdate(SQLCloverStatement.java:291)
   at org.jetel.component.DBOutputTable.runInNormalMode(DBOutputTable.java:684)
   ... 3 more
[/code]

avackova
Posts: 841
Joined: Fri Jul 20, 2007 9:28 am

Postby avackova » Thu Nov 20, 2008 11:36 am

Hello,
it's really problem. You can't use DBInputTable in this case. If you have to have schema name in query you must use Reformat instead of DBInputTable. In your Reformat use following transformation code:

Code: Select all

import java.sql.PreparedStatement;
import java.sql.SQLException;

import org.jetel.component.DataRecordTransform;
import org.jetel.connection.jdbc.CopySQLData;
import org.jetel.connection.jdbc.DBConnection;
import org.jetel.connection.jdbc.SQLUtil;
import org.jetel.connection.jdbc.specific.JdbcSpecific.OperationType;
import org.jetel.data.DataRecord;
import org.jetel.exception.ComponentNotReadyException;
import org.jetel.exception.TransformException;


public class DBInput extends DataRecordTransform {

   PreparedStatement statement;
   CopySQLData[] transmap;
   DBConnection conn;
   
   public boolean init() throws ComponentNotReadyException {
      conn = (DBConnection) graph.getConnection("Connection1");
      if (conn == null) {
         throw new ComponentNotReadyException("Connection not found");
      }
      try {
         statement = conn.getConnection(conn.getId(), OperationType.WRITE).getSqlConnection().prepareStatement("insert into ops$.oecgr values(?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?)");
      } catch (Exception e) {
         throw new ComponentNotReadyException(e);
      }
      return true;
   }
   
   public boolean transform(DataRecord[] arg0, DataRecord[] arg1)
         throws TransformException {
      if (transmap == null) {
         try {
            transmap = CopySQLData.jetel2sqlTransMap(SQLUtil.getFieldTypes(arg0[0].getMetadata(), conn.getJdbcSpecific()), arg0[0]);
         } catch (SQLException e) {
            throw new TransformException(e.getMessage(), e);
         }
      }
      try {
         for (int i = 0; i < transmap.length; i++) {
            transmap[i].jetel2sql(statement);
         }
         return statement.execute();
      } catch (Exception e) {
         throw new TransformException("", e);
      }
   }

}

To Reformat output connect edge with any metadata leading to a Trash.
Agata Vackova

Javlin a.s.

[email protected]


cron