Class: SQLStatement::SelectCreate
Overview
Creates a statement of the form
CREATE [TEMPORARY] TABLE targettable SELECT ... FROM ... WHERE ...
Instance Attribute Summary collapse
-
#targettable ⇒ Object
The name of the table to create.
-
#temporary ⇒ Object
Indicates whether a temporary table (which automatically deletes itself when the connection to the database closes) should be created.
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 create.
395 396 397 |
# File 'lib/sql/statement.rb', line 395 def targettable @targettable end |
#temporary ⇒ Object
Indicates whether a temporary table (which automatically deletes itself when the connection to the database closes) should be created. This may not be supported by all databases.
400 401 402 |
# File 'lib/sql/statement.rb', line 400 def temporary @temporary end |
Instance Method Details
#to_s ⇒ Object
402 403 404 |
# File 'lib/sql/statement.rb', line 402 def to_s "CREATE #{ @temporary ? 'TEMPORARY ':''}TABLE #{@targettable.to_sqlpart} #{super}" end |