Problem with tSybaseInput

One Star

Problem with tSybaseInput

Using Sybase server (11) as source database, we have some problems with the tSybaseInput component
the following steps work well :
- Db Sybase connection OK (Jconnect 5.5)
- Sybase Queries OK
- The Structure of Table are checked OK
with tSybaseInput based on a query or on table (log in a tLogRow component), only the fisrt position is retrieved.
We performed a few tests with the following format fields char(1), char(6), char(10) and INT(10).
We don't see where does the problem come from.
If anybody have an idea or a lead to follow ?
Thank you
Employee

Re: Problem with tSybaseInput

Hello,
Can you post your Job, the properties and the schema of your components ?
Regards,
One Star

Re: Problem with tSybaseInput

Hello,
for further informations, we work on
- TOS-Win32-r3483-V2.1.0M1
- Java project
The steps of the job are :
- Delete target oracle
- Select Sybase data
- Generate a date file (tfileoutputdelimited ) and archive the file.
- Insert Oracle data (direct tOracleOutput or with tmap, it doesn't matter, same bad results..)
The retrieving field CAMP_LIBELLE (CHAR(25 BYTE)) is troncated to 1 CHAR in output file and Oracle table
The tSybaseInput is elaborated with
-properties type : Repository
-schema type : Repository
-Query type is Buit-in
following the logs and the java code of the JobTestEnvironnement
Thank you for your help
Regards


Starting job JobTestEnvironnement at 09:13 18/07/2007.
.-----------------+------------.
| tLogRow_1 |
|=----------------+-----------=|
|CAMP_CodeCampagne|CAMP_Libelle|
|=----------------+-----------=|
|0 |P |
|2 |N |
|3 |P |
|9 |D |
'-----------------+------------'
Job JobTestEnvironnement ended at 09:13 18/07/2007.

// ============================================================================
//
// Copyright (c) 2005-2007, Talend Inc.
//
// This source code has been automatically generated by Talend Open Studio
// / JobDesigner (CodeGenerator version 2.1.0.M1_r3483).
// You can find more information about Talend products at www.talend.com.
// You may distribute this code under the terms of the GNU LGPL license
// (http://www.gnu.org/licenses/lgpl.html).
//
// ============================================================================
package prototypebdc.jobtestenvironnement;
import routines.Misc;
import routines.Numeric;
import routines.TalendDate;
import routines.TalendString;
import routines.system.*;
import java.text.ParseException;
import java.text.SimpleDateFormat;
import java.util.Date;
/**
* JobTestEnvironnement null null
*
* @author
* @version 0.1
* @status
*/
public class JobTestEnvironnement {
// create and load default properties
private static java.util.Properties defaultProps = new java.util.Properties();
// create application properties with default
private static java.util.Properties context = new java.util.Properties();
private static final String jobName = "JobTestEnvironnement";
private static final String projectName = "PROTOTYPEBDC";
private static String currentComponent = "";
private static final java.util.Map<String, Long> start_Hash = new java.util.HashMap<String, Long>();
private static final java.util.Map<String, Long> end_Hash = new java.util.HashMap<String, Long>();
private static final java.util.Map<String, Boolean> ok_Hash = new java.util.HashMap<String, Boolean>();
private static final java.util.Map<String, Object> globalMap = new java.util.HashMap<String, Object>();
private class TalendException extends Exception {
private Exception e = null;
private JobTestEnvironnement c = null;
private TalendException(JobTestEnvironnement c, Exception e) {
this.e = e;
this.c = c;
}
@Override
public void printStackTrace() {
System.err.println("Exception in component " + currentComponent);
e.printStackTrace();
try {
for (java.lang.reflect.Method m : this.getClass()
.getEnclosingClass().getMethods()) {
if (m.getName().compareTo(currentComponent + "_error") == 0) {
m.invoke(c, (Object[]) null);
}
}
} catch (java.lang.SecurityException e) {
this.e.printStackTrace();
} catch (java.lang.IllegalArgumentException e) {
this.e.printStackTrace();
} catch (java.lang.IllegalAccessException e) {
this.e.printStackTrace();
} catch (java.lang.reflect.InvocationTargetException e) {
this.e.printStackTrace();
}
}
}
public void tSybaseInput_1_error() throws TalendException {
end_Hash.put("tSybaseInput_1", java.util.Calendar.getInstance()
.getTimeInMillis());
}
public void tFileOutputDelimited_1_error() throws TalendException {
end_Hash.put("tFileOutputDelimited_1", java.util.Calendar.getInstance()
.getTimeInMillis());
}
public void tLogRow_1_error() throws TalendException {
end_Hash.put("tLogRow_1", java.util.Calendar.getInstance()
.getTimeInMillis());
}
public void tFileArchive_1_error() throws TalendException {
end_Hash.put("tFileArchive_1", java.util.Calendar.getInstance()
.getTimeInMillis());
}
public void tOracleOutput_1_error() throws TalendException {
end_Hash.put("tOracleOutput_1", java.util.Calendar.getInstance()
.getTimeInMillis());
}
public void tOracleRow_1_error() throws TalendException {
end_Hash.put("tOracleRow_1", java.util.Calendar.getInstance()
.getTimeInMillis());
}
private class row1Struct {
private char CAMP_CodeCampagne;
private char CAMP_Libelle;
}
private class row2Struct {
private char CAMP_CodeCampagne;
private char CAMP_Libelle;
}
private class row3Struct {
private char CAMP_CodeCampagne;
private char CAMP_Libelle;
}
public void tSybaseInput_1Process() throws TalendException {
try {
row2Struct row2 = new row2Struct();
row2Struct row1 = row2;
row3Struct row3 = new row3Struct();
/**
* start
*/
ok_Hash.put("tLogRow_1", false);
start_Hash.put("tLogRow_1", java.util.Calendar.getInstance()
.getTimeInMillis());
currentComponent = "tLogRow_1";
// /////////////////////
class Util_tLogRow_1 {
String[] des_top = { ".", ".", "-", "+" };
String[] des_head = { "|=", "=|", "-", "+" };
String[] des_bottom = { "'", "'", "-", "+" };
String name = "";
java.util.List<String[]> list = new java.util.ArrayList<String[]>();
int[] colLengths = new int;
public void addRow(String[] row) {
for (int i = 0; i < 2; i++) {
if (row != null) {
colLengths = Math.max(colLengths, row
.length());
}
}
list.add(row);
}
public void setTableName(String name) {
this.name = name;
}
public StringBuffer format() {
StringBuffer sb = new StringBuffer();
sb.append(print(des_top));
int totals = 0;
for (int i = 0; i < colLengths.length; i++) {
totals = totals + colLengths;
}
// name
sb.append("|");
int k = 0;
for (k = 0; k < (totals + 1 - name.length()) / 2; k++) {
sb.append(' ');
}
sb.append(name);
for (int i = 0; i < totals + 1 - name.length() - k; i++) {
sb.append(' ');
}
sb.append("|\n");
// head and rows
sb.append(print(des_head));
for (int i = 0; i < list.size(); i++) {
String[] row = list.get(i);
java.util.Formatter formatter = new java.util.Formatter(
new StringBuffer());
StringBuffer sbformat = new StringBuffer();
sbformat.append("|%1$-");
sbformat.append(colLengths);
sbformat.append("s");
sbformat.append("|%2$-");
sbformat.append(colLengths);
sbformat.append("s");
sbformat.append("|\n");
formatter.format(sbformat.toString(), (Object[]) row);
sb.append(formatter.toString());
if (i == 0)
sb.append(print(des_head)); // print the head
}
// end
sb.append(print(des_bottom));
return sb;
}
private StringBuffer print(String[] fillChars) {
StringBuffer sb = new StringBuffer();
// first column
sb.append(fillChars);
for (int i = 0; i < colLengths - fillChars.length()
+ 1; i++) {
sb.append(fillChars);
}
sb.append(fillChars);
// last column
for (int i = 0; i < colLengths - fillChars.length()
+ 1; i++) {
sb.append(fillChars);
}
sb.append(fillChars);
sb.append("\n");
return sb;
}
}
Util_tLogRow_1 util_tLogRow_1 = new Util_tLogRow_1();
util_tLogRow_1.setTableName("tLogRow_1");
util_tLogRow_1.addRow(new String[] { "CAMP_CodeCampagne",
"CAMP_Libelle", });
int nb_line_tLogRow_1 = 0;
// /////////////////////
/**
* stop
*/
/**
* start
*/
ok_Hash.put("tFileOutputDelimited_1", false);
start_Hash.put("tFileOutputDelimited_1", java.util.Calendar
.getInstance().getTimeInMillis());
currentComponent = "tFileOutputDelimited_1";
int nb_line_tFileOutputDelimited_1 = 0;
final String OUT_DELIM_tFileOutputDelimited_1 = /**
* Start field
* tFileOutputDelimited_1:FIELDSEPARATOR
*/
";"/** End field tFileOutputDelimited_1:FIELDSEPARATOR */
;
final String OUT_DELIM_ROWSEP_tFileOutputDelimited_1 = /**
* Start
* field
* tFileOutputDelimited_1:ROWSEPARATOR
*/
"\n"/** End field tFileOutputDelimited_1:ROWSEPARATOR */
;
final java.io.BufferedWriter outtFileOutputDelimited_1 = new java.io.BufferedWriter(
new java.io.OutputStreamWriter(
new java.io.FileOutputStream(/**
* Start field
* tFileOutputDelimited_1:FILENAME
*/
"D:/Output/campagnes.txt"/**
* End field
* tFileOutputDelimited_1:FILENAME
*/
, false), "ISO-8859-15"));
outtFileOutputDelimited_1.write("CAMP_CodeCampagne");
outtFileOutputDelimited_1.write(OUT_DELIM_tFileOutputDelimited_1);
outtFileOutputDelimited_1.write("CAMP_Libelle");
outtFileOutputDelimited_1
.write(OUT_DELIM_ROWSEP_tFileOutputDelimited_1);
/**
* stop
*/
/**
* start
*/
ok_Hash.put("tOracleOutput_1", false);
start_Hash.put("tOracleOutput_1", java.util.Calendar.getInstance()
.getTimeInMillis());
currentComponent = "tOracleOutput_1";
java.lang.Class.forName("oracle.jdbc.driver.OracleDriver");
String url_tOracleOutput_1 = "jdbcSmiley Surprisedracle:thin:@" + "SFRA120151"
+ ":" + "1521" + ":" + "PILODWHD";
String dbUser_tOracleOutput_1 = "PILOFLUX";
String dbPwd_tOracleOutput_1 = "PILOFLUX";
java.sql.Connection conn_tOracleOutput_1 = java.sql.DriverManager
.getConnection(url_tOracleOutput_1, dbUser_tOracleOutput_1,
dbPwd_tOracleOutput_1);
java.sql.PreparedStatement pstmt_tOracleOutput_1 = null;
pstmt_tOracleOutput_1 = conn_tOracleOutput_1
.prepareStatement("INSERT INTO " + "BDC_CAMPAGNES"
+ " (CAMP_CodeCampagne,CAMP_Libelle) VALUES (?,?)");
int commitEvery_tOracleOutput_1 = 10000;
int commitCounter_tOracleOutput_1 = 0;
conn_tOracleOutput_1.setAutoCommit(false);
int nb_line_tOracleOutput_1 = 0;
int nb_line_update_tOracleOutput_1 = 0;
int nb_line_inserted_tOracleOutput_1 = 0;
int nb_line_deleted_tOracleOutput_1 = 0;
/**
* stop
*/
/**
* start
*/
ok_Hash.put("tSybaseInput_1", false);
start_Hash.put("tSybaseInput_1", java.util.Calendar.getInstance()
.getTimeInMillis());
currentComponent = "tSybaseInput_1";
int nb_line_tSybaseInput_1 = 0;
java.lang.Class.forName("com.sybase.jdbc3.jdbc.SybDriver");
String url_tSybaseInput_1 = "jdbc:sybase:Tds:" + "NEWTST" + ":"
+ "3000" + "/" + "BDC";
String dbUser_tSybaseInput_1 = "sa";
String dbPwd_tSybaseInput_1 = "dbadmin";
java.sql.Connection conn_tSybaseInput_1 = java.sql.DriverManager
.getConnection(url_tSybaseInput_1, dbUser_tSybaseInput_1,
dbPwd_tSybaseInput_1);
java.sql.Statement stmt_tSybaseInput_1 = conn_tSybaseInput_1
.createStatement();
java.sql.ResultSet rs_tSybaseInput_1 = stmt_tSybaseInput_1
.executeQuery("SELECT CAMPAGNES.CAMP_CodeCampagne, CAMPAGNES.CAMP_Libelle FROM CAMPAGNES");
java.sql.ResultSetMetaData rsmd_tSybaseInput_1 = rs_tSybaseInput_1
.getMetaData();
int colQtyInRs_tSybaseInput_1 = rsmd_tSybaseInput_1
.getColumnCount();
globalMap
.put("tSybaseInput_1_QUERY",
"SELECT CAMPAGNES.CAMP_CodeCampagne, CAMPAGNES.CAMP_Libelle FROM CAMPAGNES");
while (rs_tSybaseInput_1.next()) {
nb_line_tSybaseInput_1++;
if (colQtyInRs_tSybaseInput_1 < 1) {
row2.CAMP_CodeCampagne = ' ';
} else {
if (rs_tSybaseInput_1.getString(1) != null
&& (rs_tSybaseInput_1.getString(1)).length() > 0) {
row2.CAMP_CodeCampagne = rs_tSybaseInput_1.getString(1)
.charAt(0);
} else {
if ((rs_tSybaseInput_1.getString(1)).equals("")) {
row2.CAMP_CodeCampagne = '\0';
} else {
throw new RuntimeException(
"Value is empty for column : 'CAMP_CodeCampagne', value is invalid or this column should be nullable or have a default value.");
}
}
}
if (colQtyInRs_tSybaseInput_1 < 2) {
row2.CAMP_Libelle = ' ';
} else {
if (rs_tSybaseInput_1.getString(2) != null
&& (rs_tSybaseInput_1.getString(2)).length() > 0) {
row2.CAMP_Libelle = rs_tSybaseInput_1.getString(2)
.charAt(0);
} else {
if ((rs_tSybaseInput_1.getString(2)).equals("")) {
row2.CAMP_Libelle = '\0';
} else {
throw new RuntimeException(
"Value is empty for column : 'CAMP_Libelle', value is invalid or this column should be nullable or have a default value.");
}
}
}
row3.CAMP_CodeCampagne = row2.CAMP_CodeCampagne;
row3.CAMP_Libelle = row2.CAMP_Libelle;
/**
* stop
*/
/**
* start
*/
currentComponent = "tSybaseInput_1";
/**
* stop
*/
/**
* start
*/
currentComponent = "tFileOutputDelimited_1";
StringBuilder sb_tFileOutputDelimited_1 = new StringBuilder();
sb_tFileOutputDelimited_1.append(
row2.CAMP_CodeCampagne);
sb_tFileOutputDelimited_1
.append(OUT_DELIM_tFileOutputDelimited_1);
sb_tFileOutputDelimited_1.append(
row2.CAMP_Libelle);
sb_tFileOutputDelimited_1
.append(OUT_DELIM_ROWSEP_tFileOutputDelimited_1);
outtFileOutputDelimited_1.write(sb_tFileOutputDelimited_1
.toString());
nb_line_tFileOutputDelimited_1++;
row1.CAMP_CodeCampagne = row2.CAMP_CodeCampagne;
row1.CAMP_Libelle = row2.CAMP_Libelle;
/**
* stop
*/
/**
* start
*/
currentComponent = "tLogRow_1";
// /////////////////////
String[] row_tLogRow_1 = new String;
row_tLogRow_1 = String.valueOf(row1.CAMP_CodeCampagne);
row_tLogRow_1 = String.valueOf(row1.CAMP_Libelle);
util_tLogRow_1.addRow(row_tLogRow_1);
nb_line_tLogRow_1++;
// ////
// ////
// /////////////////////
/**
* stop
*/
/**
* start
*/
currentComponent = "tOracleOutput_1";
if (String.valueOf(row3.CAMP_CodeCampagne).toLowerCase()
.equals("null")) {
pstmt_tOracleOutput_1.setNull(1, java.sql.Types.CHAR);
} else if (row3.CAMP_CodeCampagne == '\0') {
pstmt_tOracleOutput_1.setString(1, "");
} else {
pstmt_tOracleOutput_1.setString(1, String
.valueOf(row3.CAMP_CodeCampagne));
}
if (String.valueOf(row3.CAMP_Libelle).toLowerCase().equals(
"null")) {
pstmt_tOracleOutput_1.setNull(2, java.sql.Types.CHAR);
} else if (row3.CAMP_Libelle == '\0') {
pstmt_tOracleOutput_1.setString(2, "");
} else {
pstmt_tOracleOutput_1.setString(2, String
.valueOf(row3.CAMP_Libelle));
}
pstmt_tOracleOutput_1.executeUpdate();
nb_line_inserted_tOracleOutput_1++;
commitCounter_tOracleOutput_1++;
if (commitEvery_tOracleOutput_1 <= commitCounter_tOracleOutput_1) {
conn_tOracleOutput_1.commit();
commitCounter_tOracleOutput_1 = 0;
}
/**
* stop
*/
/**
* start
*/
currentComponent = "tSybaseInput_1";
}
stmt_tSybaseInput_1.close();
conn_tSybaseInput_1.close();
globalMap.put("tSybaseInput_1_NB_LINE", nb_line_tSybaseInput_1);
ok_Hash.put("tSybaseInput_1", true);
end_Hash.put("tSybaseInput_1", java.util.Calendar.getInstance()
.getTimeInMillis());
/**
* stop
*/
/**
* start
*/
currentComponent = "tFileOutputDelimited_1";
outtFileOutputDelimited_1.close();
globalMap.put("tFileOutputDelimited_1_NB_LINE",
nb_line_tFileOutputDelimited_1);
ok_Hash.put("tFileOutputDelimited_1", true);
end_Hash.put("tFileOutputDelimited_1", java.util.Calendar
.getInstance().getTimeInMillis());
tFileArchive_1Process();
/**
* stop
*/
/**
* start
*/
currentComponent = "tLogRow_1";
// ////
java.io.PrintStream consoleOut_tLogRow_1 = null;
if (globalMap.get("tLogRow_CONSOLE") != null) {
consoleOut_tLogRow_1 = (java.io.PrintStream) globalMap
.get("tLogRow_CONSOLE");
} else {
consoleOut_tLogRow_1 = new java.io.PrintStream(
new java.io.BufferedOutputStream(System.out));
globalMap.put("tLogRow_CONSOLE", consoleOut_tLogRow_1);
}
consoleOut_tLogRow_1.println(util_tLogRow_1.format().toString());
consoleOut_tLogRow_1.flush();
// ////
globalMap.put("tLogRow_1_NB_LINE", nb_line_tLogRow_1);
// /////////////////////
ok_Hash.put("tLogRow_1", true);
end_Hash.put("tLogRow_1", java.util.Calendar.getInstance()
.getTimeInMillis());
/**
* stop
*/
/**
* start
*/
currentComponent = "tOracleOutput_1";
conn_tOracleOutput_1.commit();
pstmt_tOracleOutput_1.close();
conn_tOracleOutput_1.close();
globalMap.put("tOracleOutput_1_NB_LINE", nb_line_tOracleOutput_1);
globalMap.put("tOracleOutput_1_NB_LINE_UPDATED",
nb_line_update_tOracleOutput_1);
globalMap.put("tOracleOutput_1_NB_LINE_INSERTED",
nb_line_inserted_tOracleOutput_1);
globalMap.put("tOracleOutput_1_NB_LINE_DELETED",
nb_line_deleted_tOracleOutput_1);
ok_Hash.put("tOracleOutput_1", true);
end_Hash.put("tOracleOutput_1", java.util.Calendar.getInstance()
.getTimeInMillis());
/**
* stop
*/
} catch (Exception e) {
throw new TalendException(this, e);
}
}
public void tFileArchive_1Process() throws TalendException {
try {
/**
* start
*/
ok_Hash.put("tFileArchive_1", false);
start_Hash.put("tFileArchive_1", java.util.Calendar.getInstance()
.getTimeInMillis());
currentComponent = "tFileArchive_1";
/**
* stop
*/
/**
* start
*/
currentComponent = "tFileArchive_1";
String sourceDir_tFileArchive_1 = "D:/Output";
java.io.File file_tFileArchive_1 = new java.io.File(
sourceDir_tFileArchive_1);
String zipFile_tFileArchive_1 = "D:/archives/Campagnes.zip";
int level_tFileArchive_1 = 4;
final java.util.List<java.io.File> list_tFileArchive_1 = new java.util.ArrayList<java.io.File>();
file_tFileArchive_1.listFiles(new java.io.FilenameFilter() {
public boolean accept(java.io.File dir, String name) {
java.io.File file = new java.io.File(dir, name);
if (file.isFile()) {
list_tFileArchive_1.add(file);
return true;
}
return false;
}
});
org.apache.tools.zip.ZipOutputStream out_tFileArchive_1 = null;
if (list_tFileArchive_1.size() > 0) {
int beginIndex_tFileArchive_1 = file_tFileArchive_1.getPath()
.length() + 1;
out_tFileArchive_1 = new org.apache.tools.zip.ZipOutputStream(
new java.io.BufferedOutputStream(
new java.io.FileOutputStream(
zipFile_tFileArchive_1)));
out_tFileArchive_1.setLevel(level_tFileArchive_1);
// here get the file list
for (int i_tFileArchive_1 = 0; i_tFileArchive_1 < list_tFileArchive_1
.size(); i_tFileArchive_1++) {
java.io.BufferedInputStream in_tFileArchive_1 = new java.io.BufferedInputStream(
new java.io.FileInputStream(list_tFileArchive_1
.get(i_tFileArchive_1)));
out_tFileArchive_1
.putNextEntry(new org.apache.tools.zip.ZipEntry(
list_tFileArchive_1.get(i_tFileArchive_1)
.getPath().substring(
beginIndex_tFileArchive_1)));
int readLen_tFileArchive_1;
byte[] buf_tFileArchive_1 = new byte;
while ((readLen_tFileArchive_1 = in_tFileArchive_1.read(
buf_tFileArchive_1, 0, 1024)) != -1)
out_tFileArchive_1.write(buf_tFileArchive_1, 0,
readLen_tFileArchive_1);
in_tFileArchive_1.close();
}
}
if (out_tFileArchive_1 != null)
out_tFileArchive_1.close();
/**
* stop
*/
/**
* start
*/
currentComponent = "tFileArchive_1";
ok_Hash.put("tFileArchive_1", true);
end_Hash.put("tFileArchive_1", java.util.Calendar.getInstance()
.getTimeInMillis());
/**
* stop
*/
} catch (Exception e) {
throw new TalendException(this, e);
}
}
public void tOracleRow_1Process() throws TalendException {
try {
/**
* start
*/
ok_Hash.put("tOracleRow_1", false);
start_Hash.put("tOracleRow_1", java.util.Calendar.getInstance()
.getTimeInMillis());
currentComponent = "tOracleRow_1";
java.lang.Class.forName("oracle.jdbc.driver.OracleDriver");
String url_tOracleRow_1 = "jdbcSmiley Surprisedracle:thin:@" + "SFRA120151" + ":"
+ "1521" + ":" + "PILODWHD";
String dbUser_tOracleRow_1 = "PILOFLUX";
String dbPwd_tOracleRow_1 = "PILOFLUX";
java.sql.Connection conn_tOracleRow_1 = java.sql.DriverManager
.getConnection(url_tOracleRow_1, dbUser_tOracleRow_1,
dbPwd_tOracleRow_1);
java.sql.PreparedStatement pstmt_tOracleRow_1 = conn_tOracleRow_1
.prepareStatement("truncate table BDC_CAMPAGNES");
globalMap.put("tOracleRow_1_QUERY", "truncate table BDC_CAMPAGNES");
int commitEvery_tOracleRow_1 = 100;
int commitCounter_tOracleRow_1 = 0;
conn_tOracleRow_1.setAutoCommit(false);
/**
* stop
*/
/**
* start
*/
currentComponent = "tOracleRow_1";
commitCounter_tOracleRow_1++;
try {
pstmt_tOracleRow_1.execute();
} catch (Exception e) {
throw new RuntimeException(
"Execution failure, there might be an error in your SQL syntax.");
}
if (commitEvery_tOracleRow_1 <= commitCounter_tOracleRow_1) {
conn_tOracleRow_1.commit();
commitCounter_tOracleRow_1 = 0;
}
/**
* stop
*/
/**
* start
*/
currentComponent = "tOracleRow_1";
if (commitEvery_tOracleRow_1 > commitCounter_tOracleRow_1) {
conn_tOracleRow_1.commit();
commitCounter_tOracleRow_1 = 0;
}
pstmt_tOracleRow_1.close();
conn_tOracleRow_1.close();
ok_Hash.put("tOracleRow_1", true);
end_Hash.put("tOracleRow_1", java.util.Calendar.getInstance()
.getTimeInMillis());
/**
* stop
*/
tSybaseInput_1Process();
} catch (Exception e) {
throw new TalendException(this, e);
}
}
public static boolean watch = false;
public static int portStats = 3334;
public static int portTraces = 4334;
public static String clientHost;
public static String defaultClientHost = "localhost";
public static String contextStr = "Default";
public static String pid = "0";
public static String rootPid = null;
public static String fatherPid = null;
public static String status = "";
public static void main(String[] args) {
for (String arg : args) {
JobTestEnvironnement.evalParam(arg);
}
if (clientHost == null) {
clientHost = defaultClientHost;
}
pid = TalendString.getAsciiRandomString(6);
if (rootPid == null) {
rootPid = pid;
}
if (fatherPid == null) {
fatherPid = pid;
}
try {
java.io.InputStream inContext = JobTestEnvironnement.class
.getClassLoader()
.getSystemResourceAsStream(
"prototypebdc/jobtestenvironnement/contexts/Default.properties");
if (inContext != null) {
defaultProps.load(inContext);
inContext.close();
context = new java.util.Properties(defaultProps);
}
if (contextStr.compareTo("Default") != 0) {
inContext = JobTestEnvironnement.class.getClassLoader()
.getSystemResourceAsStream(
"prototypebdc/jobtestenvironnement/contexts/"
+ contextStr + ".properties");
if (inContext != null) {
context.load(inContext);
inContext.close();
}
}
} catch (java.io.IOException ie) {
System.err.println("Could not load context " + contextStr);
ie.printStackTrace();
}
long end = 0;
long start = java.util.Calendar.getInstance().getTimeInMillis();
JobTestEnvironnement JobTestEnvironnementClass = new JobTestEnvironnement();
try {
JobTestEnvironnementClass.tOracleRow_1Process();
status = "end";
} catch (TalendException e) {
status = "failure";
e.printStackTrace();
} finally {
end = java.util.Calendar.getInstance().getTimeInMillis();
if (watch) {
System.out.println((end - start) + " milliseconds");
}
}
}
public static void evalParam(String arg) {
if (arg.startsWith("--watch")) {
watch = true;
} else if (arg.startsWith("--stat_port=")) {
portStats = Integer.parseInt(arg.substring(12));
} else if (arg.startsWith("--trace_port=")) {
portTraces = Integer.parseInt(arg.substring(13));
} else if (arg.startsWith("--client_host=")) {
clientHost = arg.substring(14);
} else if (arg.startsWith("--context=")) {
contextStr = arg.substring(10);
} else if (arg.startsWith("--father_pid=")) {
fatherPid = arg.substring(13);
} else if (arg.startsWith("--root_pid=")) {
rootPid = arg.substring(11);
}
}
}
/*******************************************************************************
* 26617 characters generated by Talend OpenStudio on the 18 juillet 2007
* 09:16:15 CEST
******************************************************************************/
Employee

Re: Problem with tSybaseInput

Hello
I did'nt read well your first post.
Character type only gets one character from DB.
What you need to use is the String type.
Regards,
Michaël.
One Star

Re: Problem with tSybaseInput

Thnak you for your help
Regards