pass tableName to nextId