Method: Myreplicator::SqlCommands.export_sql
- Defined in:
- lib/exporter/sql_commands.rb
.export_sql(*args) ⇒ Object
Builds SQL needed for incremental exports
274 275 276 277 278 279 280 281 282 283 284 285 286 287 |
# File 'lib/exporter/sql_commands.rb', line 274 def self.export_sql *args = args. sql = "SELECT * FROM #{[:db]}.#{[:table]} " if [:incremental_col] && ![:incremental_val].blank? if [:incremental_col_type] == "datetime" sql += "WHERE #{[:incremental_col]} >= '#{[:incremental_val]}'" else sql += "WHERE #{[:incremental_col]} >= #{[:incremental_val]}" end end return sql end |