Dieser Inhalt liegt nicht in Ihrer Sprache vor. Hier ist die englische Version.
Writing a file to MySQL if the number of its records matches a reference
value
In this scenario, tFileRowCount counts the number of
records in a .txt file, which is compared against a reference value through tJava. Once the two values match, the .txt file will be
written to a MySQL table.
The .txt file has two records:
1;andy
2;mike
Linking the components
Procedure
Drop tFileRowCount, tJava, tFlieInputDelimited,
and tMysqlOutput from the Palette onto the design workspace.
Link tFileRowCount to tJava using an OnSubjobOk trigger.
Link tJava to tFlieInputDelimited using a Run
if trigger.
Link tFlieInputDelimited to tMysqlOutput using a Row > Main
connection.
Configuring the components
Procedure
Double-click tFileRowCount to open its
Basic settings view.
In the File Name field, type in the full
path of the .txt file. You can also click the [...] button to browse for this file.
Select the Ignore empty rows check
box.
Double-click tJava to open its Basic settings view.
In the Code box, enter the function to
print out the number of rows in the file: