Class: SQLStatement::SelectInsert
Overview
Creates a statement of the form
INSERT INTO targettable (fields) SELECT values FROM ... WHERE ...
(The generated sql statement may contain aliases in the SELECT clause. This should be harmless.)
Instance Attribute Summary collapse
-
#targettable ⇒ Object
The name of the table to insert into.
Attributes inherited from Select
Instance Method Summary collapse
Methods inherited from Select
#+, #<<, #allfields, #condition, #field, #groupby, #initialize, #leftjoin, newlists, #orderby, #placeheld, #table, #to_sqlpart
Constructor Details
This class inherits a constructor from SQLStatement::Select
Instance Attribute Details
#targettable ⇒ Object
The name of the table to insert into.
412 413 414 |
# File 'lib/sql/statement.rb', line 412 def targettable @targettable end |
Instance Method Details
#to_s ⇒ Object
414 415 416 |
# File 'lib/sql/statement.rb', line 414 def to_s "INSERT INTO #{@targettable.to_sqlpart} (#{names_s}) #{super}" end |