utility function to create a SQL statement based on passed arguments

create_sql(dataName, fieldName, fieldName2, dataType, defaultSqlStatement)

Arguments

dataName

Character or numeric. value of argument passed

fieldName

Character. Database fieldname name which has value = dataName

fieldName2

Character. Alternative field name for string values of dataName

dataType

Character. Formatting for the dataName in the database

defaultSqlStatement

String. Select statement. (eg. "Select * from db")

Value

String. SQL statement

Examples

if (FALSE) {
create_sql(dataName = "all",fieldName="svspp", fieldname2= "comname",
 dataType = "%03d",defaultSqlStatement="select * from svdbs.svspecies_list")
}