Menu

#1462 table created via subquery not like a view

current-release
closed-invalid
doc-bug (2)
5
2016-12-30
2016-12-30
No

http://hsqldb.org/doc/guide/databaseobjects-chapt.html#dbc_table_creation says"An <as subquery="" clause=""> used in table definition creates a table based on a </as>

. This kind of table definition is similar to a view definition." Yet after creating a (non-text) table from a text table via an as-subquery clause, and then DROPping the source (text) table, I still have my data in the newer, non-text table. So the latter table is not similar to a VIEW onto the former, dropped table.

Discussion

  • George Herson

    George Herson - 2016-12-30

    Wasn't able to preview that before posting, sorry for the corruption. Retrying:

    http://hsqldb.org/doc/guide/databaseobjects-chapt.html#dbc_table_creation says"An <as subquery clause> used in table definition creates a table based on a <table subquery>. This kind of table definition is similar to a view definition." Yet after creating a (non-text) table from a text table via an as-subquery clause, and then DROPping the source (text) table, I still have my data in the newer, non-text table. So the latter table is not similar to a VIEW onto the former, dropped table.

    I don't know enough of HSQLDB's functionality to suggest fixed verbiage.

     
  • Fred Toussi

    Fred Toussi - 2016-12-30
    • status: open --> closed-invalid
    • assigned_to: Fred Toussi
     
  • Fred Toussi

    Fred Toussi - 2016-12-30

    "This kind of table definition is similar to a view definition" means the definition (syntax used in CREATE TABLE) is similar. I doesn't say the table itself is similar to a view.

    Please read the last section of the Support page http://hsqldb.org/support/index.html before you post bugs.

     
    • George Herson

      George Herson - 2016-12-30

      I read the support page.
      Ok, but by not being useful (the definition's already in view), "This kind of table definition is similar to a view definition." is misleading. Importantly, because I almost missed an easy way to load data into a traditional table (by using a text table as scaffolding).

       
  • Fred Toussi

    Fred Toussi - 2016-12-30

    The guide says :

    <table definition> ::= CREATE [ { <table scope> | <table type> } ] TABLE ...
    
    <view definition> ::= CREATE VIEW [ IF NOT EXISTS ] <table name>
    

    So it defines both "table definition" and "view definition" as some syntax. The sentence you quote is not misleading but its usefulness depends on the reader.

     

    Last edit: Fred Toussi 2016-12-30

Log in to post a comment.