Icon

2. Write To DB

There has been no title set for this workflow's metadata.

KBL: String manipulation and wrting to a database

String and data manimulation, saving data to a database




URL: KNIME Beginner's Luck (Book Homepage) https://www.knime.com/knimepress/beginners-luck

Annotations and comments
  • Workflow: Write To DB This workflow ultimately writes a data table into a database. In particular, we use here the SQLite database because it is file based and does not require additional installation. This workflow also shows how to performs different kinds of string manipulation, number to string conversions and vice versa. Notice that the workhorse of the string manipulation operations is the String Manipulation node, which includes a large number of string manipulation functions. Note. This workflow has to be executed BEFORE executing workflow My First Data Exploration
  • String Splitting
  • String Replacement
  • Write data to SQLite Database Use the SQlite Connector node to connect to the SQLite database. Notice that SQLite is a file based database. The SQlite Connector node thus requires the path of the database file. It also supports the knime:// protocol. SQLite driver is already included in the SQLite Connector node. Drivers of most popular databases are included in database connector nodes for databases' most recent versions. Then connect a DB Writer node to the SQLite Connector node to actually write the data into a new table.
  • Joining Strings
  • Type Conversion
  • read data from iris.data file with path relative to "current workflow"
  • convert class_Arr[0] to UPPERCASE
  • split column class in iris and <attr> by delimiter '-' <attr> = Setosa/ Virginica/ Versicolor
  • split petal width into integer and floating by using '.' as the delimiter string in a Cell Splitter node
  • split column class in iris and <attr> by position <attr> = Setosa/ Virginica/ Versicolor
  • combine <attr> and "IRIS" into <attr>:IRIS
  • rearrange column order for next node column combiner
  • write output data table into SQLite database
  • transform integer and floating parts of petal width from double into integers
  • petal width from Double to String
  • split column class in iris and <attr> by regex <attr> = Setosa/ Virginica/ Versicolor
  • from iris name to class no
  • connecting to SQLIte Database knime:// protocol supported
  • build <attr>: "IRIS"
  • replace all "Iris" with "IRIS"
  • replace all Ir* with IRIS
  • transform integer and double into numbers

Nodes

Extensions

Links