Icon

2. Write To DB

KBL: String manipulation and wrting to a database
Workflow: WriteToDB This workflow ultimately writes a data table into a database. In particular, we use here the SQLite database because it is filebased and does not require additional installation.This workflow also shows how to performs different kinds of string manipulation, number to string conversions and viceversa. Notice that the workhorse of the string manipulation operations is the String Manipulation node, which includes a large numberof string manipulation functions.Note. This workflow has to be executed BEFORE executing workflow My First Data Exploration String Splitting Type Conversion String Replacement Joining Strings Write data to SQLite DatabaseUse the SQlite Connector node to connect to the SQLite database.Notice that SQLite is a file based database. The SQlite Connector nodethus requires the path of the database file. It also supports the knime://protocol. SQLite driver is already included in the SQLite Connectornode. Drivers of most popular databases are included in databaseconnector nodes for databases' most recent versions.Then connect a DB Writer node to the SQLite Connector node to actuallywrite the data into a new table. split column class iniris and <attr>by position<attr> = Setosa/ Virginica/ Versicolorsplit column class iniris and <attr>by regex<attr> = Setosa/ Virginica/ Versicolorreplace all Ir* with IRISconvert class_Arr[0]toUPPERCASEread data fromiris.data filewith path relative to"current workflow"build<attr>: "IRIS"rearrange column orderfor next nodecolumn combinerfrom iris name to class nocombine <attr> and "IRIS"into <attr>:IRISreplace all "Iris"with "IRIS"transform integer and floating parts of petal width from double into integerssplit column class iniris and <attr>by delimiter '-'<attr> = Setosa/ Virginica/ Versicolorsplit petal width into integer and floatingby using '.' as thedelimiter string ina Cell Splitter nodewrite output data table into SQLite databaseconnecting toSQLIte Databaseknime:// protocol supportedpetal widthfrom Double toStringtransform integer and double intonumbers Cell SplitterBy Position Regex Split String Replacer Case Converter CSV Reader String Manipulation Column Resorter Rule Engine Column Combiner String Manipulation Double To Int Cell Splitter Cell Splitter DB Writer SQLite Connector Number To String String To Number Workflow: WriteToDB This workflow ultimately writes a data table into a database. In particular, we use here the SQLite database because it is filebased and does not require additional installation.This workflow also shows how to performs different kinds of string manipulation, number to string conversions and viceversa. Notice that the workhorse of the string manipulation operations is the String Manipulation node, which includes a large numberof string manipulation functions.Note. This workflow has to be executed BEFORE executing workflow My First Data Exploration String Splitting Type Conversion String Replacement Joining Strings Write data to SQLite DatabaseUse the SQlite Connector node to connect to the SQLite database.Notice that SQLite is a file based database. The SQlite Connector nodethus requires the path of the database file. It also supports the knime://protocol. SQLite driver is already included in the SQLite Connectornode. Drivers of most popular databases are included in databaseconnector nodes for databases' most recent versions.Then connect a DB Writer node to the SQLite Connector node to actuallywrite the data into a new table. split column class iniris and <attr>by position<attr> = Setosa/ Virginica/ Versicolorsplit column class iniris and <attr>by regex<attr> = Setosa/ Virginica/ Versicolorreplace all Ir* with IRISconvert class_Arr[0]toUPPERCASEread data fromiris.data filewith path relative to"current workflow"build<attr>: "IRIS"rearrange column orderfor next nodecolumn combinerfrom iris name to class nocombine <attr> and "IRIS"into <attr>:IRISreplace all "Iris"with "IRIS"transform integer and floating parts of petal width from double into integerssplit column class iniris and <attr>by delimiter '-'<attr> = Setosa/ Virginica/ Versicolorsplit petal width into integer and floatingby using '.' as thedelimiter string ina Cell Splitter nodewrite output data table into SQLite databaseconnecting toSQLIte Databaseknime:// protocol supportedpetal widthfrom Double toStringtransform integer and double intonumbersCell SplitterBy Position Regex Split String Replacer Case Converter CSV Reader String Manipulation Column Resorter Rule Engine Column Combiner String Manipulation Double To Int Cell Splitter Cell Splitter DB Writer SQLite Connector Number To String String To Number

Nodes

Extensions

Links