Changeset: cad2b792e42b for MonetDB
URL: https://dev.monetdb.org/hg/MonetDB?cmd=changeset;node=cad2b792e42b
Modified Files:
        clients/mapiclient/mhelp.c
Branch: Apr2019
Log Message:

Improved and extended help text with "select_single_row", "select_no_parens" 
and "corresponding".
Corrected "partition_spec" which was missing the | signs between the three 
options.
Removed "[ AND search_condition ]" from "merge_clause" as it is not supported 
(it returns an error).


diffs (193 lines):

diff --git a/clients/mapiclient/mhelp.c b/clients/mapiclient/mhelp.c
--- a/clients/mapiclient/mhelp.c
+++ b/clients/mapiclient/mhelp.c
@@ -60,10 +60,10 @@ SQLhelp sqlhelp1[] = {
         "See also https://www.monetdb.org/Documentation/SQLreference/Alter"},
        {"ALTER MERGE TABLE",
         "",
-        "ALTER TABLE [ IF EXISTS ] qname ADD TABLE qname [ AS PARTITION 
opt_partition_spec ]\n"
+        "ALTER TABLE [ IF EXISTS ] qname ADD TABLE qname [ AS PARTITION 
partition_spec ]\n"
         "ALTER TABLE [ IF EXISTS ] qname DROP TABLE qname [ RESTRICT | CASCADE 
]\n"
-        "ALTER TABLE [ IF EXISTS ] qname SET TABLE qname AS PARTITION 
opt_partition_spec",
-        "qname,opt_partition_spec",
+        "ALTER TABLE [ IF EXISTS ] qname SET TABLE qname AS PARTITION 
partition_spec",
+        "qname,partition_spec",
         "See also 
https://www.monetdb.org/Documentation/Cookbooks/SQLrecipes/DataPartitioning"},
        {"ALTER SCHEMA",
         "",
@@ -183,8 +183,8 @@ SQLhelp sqlhelp1[] = {
         "See also 
https://www.monetdb.org/blog/monetdbpython-loader-functions"},
        {"CREATE MERGE TABLE",
         "",
-        "CREATE MERGE TABLE [ IF NOT EXISTS ] qname table_source [ 
opt_partition_by ];",
-        "table_source,opt_partition_by",
+        "CREATE MERGE TABLE [ IF NOT EXISTS ] qname table_source [ 
partition_by ]",
+        "table_source,partition_by",
         "See also 
https://www.monetdb.org/Documentation/Cookbooks/SQLrecipes/DataPartitioning"},
        {"CREATE REMOTE TABLE",
         "",
@@ -193,7 +193,7 @@ SQLhelp sqlhelp1[] = {
         "remote name should match 
mapi:monetdb://host:port/database[/schema[/table]]"},
        {"CREATE REPLICA TABLE",
         "",
-        "CREATE REPLICA TABLE [ IF NOT EXISTS ] qname table_source;",
+        "CREATE REPLICA TABLE [ IF NOT EXISTS ] qname table_source",
         NULL,
         "See also 
https://www.monetdb.org/Documentation/Cookbooks/SQLrecipes/TransactionReplication"},
        {"CREATE ROLE",
@@ -304,8 +304,8 @@ SQLhelp sqlhelp1[] = {
         NULL},
        {"DELETE",
         "",
-        "[ WITH with_list ] DELETE FROM qname [ [AS] ident ] [ WHERE 
search_condition ]",
-        "with_list,search_condition",
+        "[ WITH cte_list ] DELETE FROM qname [ [AS] ident ] [ WHERE 
search_condition ]",
+        "cte_list,search_condition",
         NULL},
        {"DROP AGGREGATE",
         "",
@@ -385,8 +385,8 @@ SQLhelp sqlhelp1[] = {
         "See also 
https://www.monetdb.org/Documentation/SQLreference/Flowofcontrol"},
        {"INSERT",
         "",
-        "[ WITH with_list ] INSERT INTO qname [ column_list ] [ { DEFAULT 
VALUES | VALUES row_values | query_expression } ]",
-        "with_list,column_list,row_values,query_expression",
+        "[ WITH cte_list ] INSERT INTO qname [ column_list ] [ { DEFAULT 
VALUES | VALUES row_values | query_expression } ]",
+        "cte_list,column_list,row_values,query_expression",
         "See also https://www.monetdb.org/Documentation/SQLreference/Updates"},
        {"GRANT",
         "Define access privileges",
@@ -396,9 +396,9 @@ SQLhelp sqlhelp1[] = {
         "See also 
https://www.monetdb.org/Documentation/SQLreference/Permissions"},
        {"MERGE",
         "",
-        "[ WITH with_list ] MERGE INTO qname [ [AS] ident ] USING table_ref [ 
[AS] ident ] ON search_condition merge_list",
-        "with_list,table_ref,search_condition,merge_list",
-        NULL},
+        "[ WITH cte_list ] MERGE INTO qname [ [AS] ident ] USING table_ref [ 
[AS] ident ] ON search_condition merge_list",
+        "cte_list,table_ref,search_condition,merge_list",
+        "See also: 
https://www.monetdb.org/blog/sql2003_merge_statements_now_supported"},
        {"RELEASE SAVEPOINT",
         "",
         "RELEASE SAVEPOINT ident",
@@ -427,7 +427,7 @@ SQLhelp sqlhelp1[] = {
         NULL},
        {"SELECT",
         "",
-        "[ WITH with_list ]\n"
+        "[ WITH cte_list ]\n"
         "SELECT [ ALL | DISTINCT [ ON { expression [',' ...] } ] ]\n"
         "[ '*' | expression [ [ AS ] output_name ] [',' ...] ]\n"
         "[ FROM from_item [',' ...] ]\n"
@@ -440,7 +440,7 @@ SQLhelp sqlhelp1[] = {
         "[ LIMIT { count | param } ]\n"
         "[ OFFSET { count | param } ]\n"
         "[ SAMPLE size [ SEED size ] ]",
-        "with_list,expression,window_definition",
+        "cte_list,expression,window_definition",
         "See also 
https://www.monetdb.org/Documentation/SQLreference/TableExpressions"},
        {"SET",
         "Assign a value to a variable or column",
@@ -513,8 +513,8 @@ SQLhelp sqlhelp1[] = {
         NULL},
        {"UPDATE",
         "",
-        "[ WITH with_list ] UPDATE qname [ [AS] ident ] SET assignment_list [ 
WHERE search_condition ]",
-        "with_list,assignment_list,search_condition",
+        "[ WITH cte_list ] UPDATE qname [ [AS] ident ] SET assignment_list [ 
WHERE search_condition ]",
+        "cte_list,assignment_list,search_condition",
         NULL},
        {"WHILE",
         "",
@@ -670,16 +670,16 @@ SQLhelp sqlhelp2[] = {
         "MATCH { FULL | PARTIAL | SIMPLE }",
         NULL,
         NULL},
+       {"merge_list",
+        NULL,
+        "merge_clause [ merge_clause ]",
+        "merge_clause",
+        NULL},
        {"merge_clause",
         NULL,
-        "{ WHEN MATCHED [ AND search_condition ] THEN { UPDATE SET 
assignment_list | DELETE } } |\n"
-        "{ WHEN NOT MATCHED [ AND search_condition ] THEN INSERT [ column_list 
] [ { DEFAULT VALUES | VALUES row_values } ] }",
-        "search_condition,assignment_list,column_list,row_values",
-        NULL},
-       {"merge_list",
-        NULL,
-        "merge_clause [ ... ]",
-        "merge_clause",
+        "{ WHEN NOT MATCHED THEN INSERT [ column_list ] [ { VALUES row_values 
| DEFAULT VALUES } ]\n"
+        "| WHEN MATCHED THEN { UPDATE SET assignment_list | DELETE } }",
+        "column_list,row_values,assignment_list",
         NULL},
        {"nrofrecords",
         "",
@@ -691,18 +691,18 @@ SQLhelp sqlhelp2[] = {
         "ON COMMIT { DELETE ROWS | PRESERVE ROWS | DROP }",
         NULL,
         NULL},
-       {"opt_partition_by",
+       {"partition_by",
         NULL,
         "PARTITION BY { RANGE | VALUES } { ON '(' ident ')' | USING '(' 
query_expression ')' }",
         "query_expression",
-        NULL},
-       {"opt_partition_spec",
+        "See also: https://www.monetdb.org/blog/updatable-merge-tables"},
+       {"partition_spec",
         NULL,
-        "IN '(' partition_list ')' [ WITH NULL VALUES ]\n"
-        "FROM partition_range_from TO partition_range_to [ WITH NULL VALUES 
]\n"
-        "FOR NULL VALUES",
+        "{ IN '(' partition_list ')' [ WITH NULL VALUES ]\n"
+        "| FROM partition_range_from TO partition_range_to [ WITH NULL VALUES 
]\n"
+        "| FOR NULL VALUES }",
         "partition_list,partition_range_from,partition_range_to",
-        NULL},
+        "See also: https://www.monetdb.org/blog/updatable-merge-tables"},
        {"param",
         NULL,
         "ident data_type",
@@ -734,10 +734,27 @@ SQLhelp sqlhelp2[] = {
         "  declare | set_statement | control_statement | select_single_row } 
';'",
         
"transaction_statement,update_statement,grant,revoke,declare,set_statement,control_statement,select_single_row",
         NULL},
+       {"select_single_row",
+        NULL,
+        "SELECT [ ALL | DISTINCT ] column_exp_commalist INTO 
select_target_list [ from_clause ] [ window_clause ] [ where_clause ] [ 
group_by_clause ] [ having_clause ]",
+        
"column_exp_commalist,select_target_list,from_clause,window_clause,where_clause,group_by_clause,having_clause",
+        NULL},
        {"query_expression",
         NULL,
-        "with_query | select_no_parens_orderby",
+        "select_no_parens [ order_by_clause ] [ limit_clause ] [ offset_clause 
] [ sample_clause ]",
+        
"select_no_parens,order_by_clause,limit_clause,offset_clause,sample_clause",
+        NULL},
+       {"select_no_parens",
         NULL,
+        "{ SELECT [ ALL | DISTINCT ] column_exp_commalist [ from_clause ] [ 
window_clause ] [ where_clause ] [ group_by_clause ] [ having_clause ]\n"
+        "| select_no_parens { UNION | EXCEPT | INTERSECT } [ ALL | DISTINCT ] 
[ corresponding ] select_no_parens\n"
+        "| '(' select_no_parens ')' }",
+        
"column_exp_commalist,from_clause,window_clause,where_clause,group_by_clause,having_clause,corresponding",
+        NULL},
+       {"corresponding",
+        NULL,
+        "{ CORRESPONDING | CORRESPONDING BY '(' column_ref_commalist ')' }",
+        "column_ref_commalist",
         NULL},
        {"qname",
         NULL,
@@ -892,9 +909,9 @@ SQLhelp sqlhelp2[] = {
         "  [ EXCLUDING { CURRENT ROW | GROUP | TIES | NO OTHERS } ] ]",
         "window_bound,window_frame_start",
         NULL},
-       {"with_list",
+       {"cte_list",
         NULL,
-        "ident [ column_list ] AS query_expression [ ',' with_list ] ...",
+        "ident [ column_list ] AS query_expression [ ',' cte_list ] ...",
         "column_list,query_expression",
         NULL},
        {NULL, NULL, NULL, NULL, NULL}  /* End of list marker */
_______________________________________________
checkin-list mailing list
[email protected]
https://www.monetdb.org/mailman/listinfo/checkin-list

Reply via email to