insertIntoTableStatementSQL

fun insertIntoTableStatementSQL(tableName: String, numColumns: Int, schemaName: String? = null): String

Creates an SQL string that can be used to insert data into the table

insert into schemaName.tableName values (?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?)

The number of parameter values is controlled by the number of columns parameter.

Return

a generic SQL insert statement with appropriate number of parameters for the table

Parameters

tableName

the name of the table to be inserted into

numColumns

the number of columns starting from the left to insert into

schemaName

the schema containing the table


fun insertIntoTableStatementSQL(tableName: String, fields: List<String>, schemaName: String? = null): String

Creates an SQL string that can be used to insert data into the table

insert into schemaName.tableName (fieldName1, fieldName2, fieldName3) values (?, ?, ?)

The number of parameter values is controlled by the size of the field array. This assumes that the supplied field names are valid for the supplied table name.

Return

a generic SQL insert statement with appropriate number of parameters for the table

Parameters

tableName

the name of the table to be inserted into

fields

the names of the fields that will receive data within the table

schemaName

the schema containing the table