sqlin Processor

sqlin is a controller processor used to read records from a database.


Common Settings

SettingDescriptionData TypeDefault
service.type=sqlinindicates the type of processorstringn/a
schedulehow often to check for new recordsstringn/a
datasource.namename of the database connection to usestringn/a
max.docs.per.delivermax docs to deliver in parallelstringn/a
doc.formatxml or jsonstringn/a

Batching Records

In most cases, you will want to group your records into discrete batches.

SettingsDescription
batch.grouping.enabledenable batching
note: if disabled, each document created will contain up to batch.max.records
batch.max.recordsmax number of records per batch
batch.grouping.column.namethe grouping colummn
batch.grouping.allow.breaksbreak the group into another document if the number of records surpasses batch.max.records

Table Columns

sqlin has a dependency on specific columns existing in the table for various purposes, e.g. for batching, keeping state, etc.

Column NameDescriptionRequiredRequres Index
tedi_statusused to keep state during processingyesyes
tedi_publish_dtTEDI will update this column with the date is successfully processed the record(s).yesyes
tedi_row_idprimary key - uniquely identifies each recordyesyes
tedi_group_idties of set of records together for batchingnoyes

Statements

sqlin uses a number of SQL statements when integrating with databases.

StatementDescription
pre-readused to mark (udpate) a set of records for processing
readreads the records (select) marked during the pre-read step
post-readmarks the records success or fail if delivering the records was a success
abandon checkchecks for records left in the pre-read state
deleteused to delete records from one or more tables that were successfully received and no longer needed

Pre-Read

SettingsDescription
pre.read.update.timeoutsql statement timeout
pre.read.update.sqlthe sql statement to execute
pre.read.update.sql = "UPDATE pub_single_out "                                          \
                      "SET tedi_status = :p1"                                           \
                      ", tedi_publish_dt = TO_CHAR(SYSDATE, 'YYYY-MM-DD HH24:MI:SS')"   \
                      " WHERE tedi_status = 'new'"                                      \
                      " AND rownum < 10"

Read

SettingsDescription
read.timeoutsql statement timeout
read.ignore.nullsskip columns with null values
read.trim.spacetrim whitespace for values
read.sqlthe sql statement to execute
read.sql = "SELECT tedi_publish_dt"   \
           ", tedi_row_id"            \
           ", a_decimal"              \
           ", a_string"               \
           ", a_datetime"             \
           " FROM pub_single_out"     \
           " WHERE tedi_status = :p1"

Post-Read

SettingsDescription
post.read.update.success.statusvalue to set tedi_status on success
post.read.update.error.statusvalue to set tedi_status on failure
post.read.update.batch.sizemax number of records to update at one time
post.read.update.key.columnsthe key columns for the table
post.read.update.sqlthe sql statement to execute
post.read.update.sql = "UPDATE pub_single_out "    \
                       " SET tedi_status = :p1"    \
                       " WHERE tedi_status = :p2"

Abandon Check

SettingsDescription
abandon.check.enabledenable or disable the check
abandon.check.timeoutsql statement timeout
abandon.check.intervalhow often to run
abandon.check.sqlthe sql statement to execute
abandon.check.sql = "UPDATE spub_single_out "             \
                    " SET tedi_status = 'unknown'"     \
                    " WHERE tedi_publish_dt < :p1"       \
                    " AND tedi_status LIKE 'tedi-%'"

Delete

In the event you have multiple tables, and without RI, you can configure multiple delete statements.

SettingsDescription
delete.enabledenable or disable the purging of records completely
delete.intervalhow often to run
{integer}.delete.timeoutsql statement timeout
{integer}.delete.enabledenable/disable individual statements
{integer}.delete.sqlthe delete statement to execute
0.delete.sql = "DELETE FROM tedi.pub_single_out"     \
               " WHERE tedi_status = 'success'"      \
               " AND tedi_publish_dt < TO_CHAR(SYSDATE-1, 'YYYY-MM-DD HH24:MI:SS')"