diff --git a/product/en/docs-mogdb/v5.0/characteristic-description/compatibility/add-rowtype-attribute-to-the-view.md b/product/en/docs-mogdb/v5.0/characteristic-description/compatibility/add-rowtype-attribute-to-the-view.md index 9d6655ff5250220d2ac6cef71e5041cf3472ae7e..f9a8ebad7ae9d0a1672f51342b12047410823a97 100644 --- a/product/en/docs-mogdb/v5.0/characteristic-description/compatibility/add-rowtype-attribute-to-the-view.md +++ b/product/en/docs-mogdb/v5.0/characteristic-description/compatibility/add-rowtype-attribute-to-the-view.md @@ -13,7 +13,7 @@ This feature is available since MogDB 5.0.0. ## Introduction -This feature adds the %rowtype attribute to the view, which is supported as a parameter or variable. +This feature adds the %rowtype attribute to the view, which is supported as a parameter or variable. When you use %ROWTYPE to declare a variable that matches a view, the variable will have the same structure as the view row. ## Benefits @@ -31,26 +31,35 @@ END; ## Example ```sql -DROP SCHEMA IF EXISTS test_view_sch; +MogDB=# DROP SCHEMA IF EXISTS test_view_sch; NOTICE: SCHEMA "test_view_sch" does NOT exist, skipping -CREATE SCHEMA test_view_sch; -CREATE TABLE test_view_sch.tb_test (c1 INT, c2 varchar2); -CREATE VIEW test_view_sch.v_terst AS SELECT c1, c2 FROM test_view_sch.tb_test; -CREATE OR REPLACE PROCEDURE sp_p1 (i_proname IN test_view_sch.v_terst%rowtype) IS + +MogDB=# CREATE SCHEMA test_view_sch; + +MogDB=# CREATE TABLE test_view_sch.tb_test (c1 INT, c2 varchar2); + +MogDB=# CREATE VIEW test_view_sch.v_terst AS SELECT c1, c2 FROM test_view_sch.tb_test; + +MogDB=# CREATE OR REPLACE PROCEDURE sp_p1 (i_proname IN test_view_sch.v_terst%rowtype) IS BEGIN RAISE NOTICE 'i_proname.c1 is %, i_proname.c2 is %', i_proname.c1, i_proname.c2; END; / -DECLARE -var1 test_view_sch.v_terst %rowtype: = (1111, 'xxxx'); +CREATE PROCEDURE + +MogDB=# DECLARE +var1 test_view_sch.v_terst%rowtype := (1111, 'xxxx'); BEGIN -sp_p1(i_proname = > var1); +sp_p1(i_proname => var1); END; / -NOTICE: i_proname.c1 IS 1111, i_proname.c2 IS xxxx -DROP SCHEMA test_view_sch CASCADE; -NOTICE:DROP cascades TO 3 other objects -DETAIL:DROP cascades TO TABLE test_view_sch.tb_test -DROP cascades TO VIEW test_view_sch.v_terst -DROP cascades TO FUNCTION sp_p1(test_view_sch.v_terst) +NOTICE: i_proname.c1 is 1111, i_proname.c2 is xxxx +ANONYMOUS BLOCK EXECUTE + +MogDB=# DROP SCHEMA test_view_sch CASCADE; +NOTICE: drop cascades to 3 other objects +DETAIL: drop cascades to table test_view_sch.tb_test +drop cascades to view test_view_sch.v_terst +drop cascades to function sp_p1(test_view_sch.v_terst) +DROP SCHEMA ``` \ No newline at end of file diff --git a/product/en/docs-mogdb/v5.0/characteristic-description/compatibility/aggregate-functions-support-keep-clause.md b/product/en/docs-mogdb/v5.0/characteristic-description/compatibility/aggregate-functions-support-keep-clause.md index 77127c30d08b07e78f40ba5cc7127e6dab16e211..8c077ffb904f9393aa40c217ab327deb670d17fd 100644 --- a/product/en/docs-mogdb/v5.0/characteristic-description/compatibility/aggregate-functions-support-keep-clause.md +++ b/product/en/docs-mogdb/v5.0/characteristic-description/compatibility/aggregate-functions-support-keep-clause.md @@ -42,8 +42,7 @@ The syntax rules of MogDB are basically the same as those of Oracle described ab ```sql -- Create table tab_keep -DROP TABLE -IF EXISTS tab_keep; +DROP TABLE IF EXISTS tab_keep; CREATE TABLE tab_keep (a INT, b INT, c INT, d INT, e INT, f INT, g INT); -- Insert data INSERT INTO tab_keep VALUES (1, 1, 1, 1, 10, 100, 1000); @@ -93,10 +92,10 @@ SELECT a, b, c, MAX(g) KEEP(DENSE_RANK FIRST ORDER BY d), FROM tab_keep GROUP BY GROUPING SETS((a),(b), (c), (a, b), (a, b, c)) ORDER BY a, b, c; -- Order by clause contains nulls first -SELECT a, MAX(c) KEEP(DENSE_RANK FIRST ORDER BY b nulls FIRST) FROM tt02 GROUP BY a ORDER BY 1, 2; -SELECT a, MAX(c) KEEP(DENSE_RANK LAST ORDER BY b nulls FIRST) FROM tt02 GROUP BY a ORDER BY 1, 2; +SELECT a, MAX(c) KEEP(DENSE_RANK FIRST ORDER BY b nulls FIRST) FROM tab_keep GROUP BY a ORDER BY 1, 2; +SELECT a, MAX(c) KEEP(DENSE_RANK LAST ORDER BY b nulls FIRST) FROM tab_keep GROUP BY a ORDER BY 1, 2; -- Order by clause contains nulls last -SELECT a, MAX(c) KEEP(DENSE_RANK FIRST ORDER BY b nulls LAST) FROM tt02 GROUP BY a ORDER BY 1, 2; -SELECT a, MAX(c) KEEP(DENSE_RANK LAST ORDER BY b nulls LAST) FROM tt02 GROUP BY a ORDER BY 1, 2; +SELECT a, MAX(c) KEEP(DENSE_RANK FIRST ORDER BY b nulls LAST) FROM tab_keep GROUP BY a ORDER BY 1, 2; +SELECT a, MAX(c) KEEP(DENSE_RANK LAST ORDER BY b nulls LAST) FROM tab_keep GROUP BY a ORDER BY 1, 2; ``` \ No newline at end of file diff --git a/product/en/docs-mogdb/v5.0/characteristic-description/maintainability/pageinspect-pagehack.md b/product/en/docs-mogdb/v5.0/characteristic-description/maintainability/pageinspect-pagehack.md index 4884d41b86c0f18240786cba9b0b03b5c43393ec..fb7e0012828713f5e798aa02304536050631fc5e 100644 --- a/product/en/docs-mogdb/v5.0/characteristic-description/maintainability/pageinspect-pagehack.md +++ b/product/en/docs-mogdb/v5.0/characteristic-description/maintainability/pageinspect-pagehack.md @@ -53,7 +53,7 @@ The extension provides several system functions to query using a fixed format wi ```sql # View the contents of the heap data table -SELECT * FROM heap_page_iteme(get_raw_page('table_name','main',page_no)); +SELECT * FROM heap_page_items(get_raw_page('table_name','main',page_no)); # View header information on a heap page SELECT * FROM page_header(get_raw_page('table_name','main',page_no)); # View meta page information diff --git a/product/en/docs-mogdb/v5.1/characteristic-description/compatibility/add-rowtype-attribute-to-the-view.md b/product/en/docs-mogdb/v5.1/characteristic-description/compatibility/add-rowtype-attribute-to-the-view.md index 9d6655ff5250220d2ac6cef71e5041cf3472ae7e..f9a8ebad7ae9d0a1672f51342b12047410823a97 100644 --- a/product/en/docs-mogdb/v5.1/characteristic-description/compatibility/add-rowtype-attribute-to-the-view.md +++ b/product/en/docs-mogdb/v5.1/characteristic-description/compatibility/add-rowtype-attribute-to-the-view.md @@ -13,7 +13,7 @@ This feature is available since MogDB 5.0.0. ## Introduction -This feature adds the %rowtype attribute to the view, which is supported as a parameter or variable. +This feature adds the %rowtype attribute to the view, which is supported as a parameter or variable. When you use %ROWTYPE to declare a variable that matches a view, the variable will have the same structure as the view row. ## Benefits @@ -31,26 +31,35 @@ END; ## Example ```sql -DROP SCHEMA IF EXISTS test_view_sch; +MogDB=# DROP SCHEMA IF EXISTS test_view_sch; NOTICE: SCHEMA "test_view_sch" does NOT exist, skipping -CREATE SCHEMA test_view_sch; -CREATE TABLE test_view_sch.tb_test (c1 INT, c2 varchar2); -CREATE VIEW test_view_sch.v_terst AS SELECT c1, c2 FROM test_view_sch.tb_test; -CREATE OR REPLACE PROCEDURE sp_p1 (i_proname IN test_view_sch.v_terst%rowtype) IS + +MogDB=# CREATE SCHEMA test_view_sch; + +MogDB=# CREATE TABLE test_view_sch.tb_test (c1 INT, c2 varchar2); + +MogDB=# CREATE VIEW test_view_sch.v_terst AS SELECT c1, c2 FROM test_view_sch.tb_test; + +MogDB=# CREATE OR REPLACE PROCEDURE sp_p1 (i_proname IN test_view_sch.v_terst%rowtype) IS BEGIN RAISE NOTICE 'i_proname.c1 is %, i_proname.c2 is %', i_proname.c1, i_proname.c2; END; / -DECLARE -var1 test_view_sch.v_terst %rowtype: = (1111, 'xxxx'); +CREATE PROCEDURE + +MogDB=# DECLARE +var1 test_view_sch.v_terst%rowtype := (1111, 'xxxx'); BEGIN -sp_p1(i_proname = > var1); +sp_p1(i_proname => var1); END; / -NOTICE: i_proname.c1 IS 1111, i_proname.c2 IS xxxx -DROP SCHEMA test_view_sch CASCADE; -NOTICE:DROP cascades TO 3 other objects -DETAIL:DROP cascades TO TABLE test_view_sch.tb_test -DROP cascades TO VIEW test_view_sch.v_terst -DROP cascades TO FUNCTION sp_p1(test_view_sch.v_terst) +NOTICE: i_proname.c1 is 1111, i_proname.c2 is xxxx +ANONYMOUS BLOCK EXECUTE + +MogDB=# DROP SCHEMA test_view_sch CASCADE; +NOTICE: drop cascades to 3 other objects +DETAIL: drop cascades to table test_view_sch.tb_test +drop cascades to view test_view_sch.v_terst +drop cascades to function sp_p1(test_view_sch.v_terst) +DROP SCHEMA ``` \ No newline at end of file diff --git a/product/en/docs-mogdb/v5.1/characteristic-description/compatibility/aggregate-functions-support-keep-clause.md b/product/en/docs-mogdb/v5.1/characteristic-description/compatibility/aggregate-functions-support-keep-clause.md index 77127c30d08b07e78f40ba5cc7127e6dab16e211..8c077ffb904f9393aa40c217ab327deb670d17fd 100644 --- a/product/en/docs-mogdb/v5.1/characteristic-description/compatibility/aggregate-functions-support-keep-clause.md +++ b/product/en/docs-mogdb/v5.1/characteristic-description/compatibility/aggregate-functions-support-keep-clause.md @@ -42,8 +42,7 @@ The syntax rules of MogDB are basically the same as those of Oracle described ab ```sql -- Create table tab_keep -DROP TABLE -IF EXISTS tab_keep; +DROP TABLE IF EXISTS tab_keep; CREATE TABLE tab_keep (a INT, b INT, c INT, d INT, e INT, f INT, g INT); -- Insert data INSERT INTO tab_keep VALUES (1, 1, 1, 1, 10, 100, 1000); @@ -93,10 +92,10 @@ SELECT a, b, c, MAX(g) KEEP(DENSE_RANK FIRST ORDER BY d), FROM tab_keep GROUP BY GROUPING SETS((a),(b), (c), (a, b), (a, b, c)) ORDER BY a, b, c; -- Order by clause contains nulls first -SELECT a, MAX(c) KEEP(DENSE_RANK FIRST ORDER BY b nulls FIRST) FROM tt02 GROUP BY a ORDER BY 1, 2; -SELECT a, MAX(c) KEEP(DENSE_RANK LAST ORDER BY b nulls FIRST) FROM tt02 GROUP BY a ORDER BY 1, 2; +SELECT a, MAX(c) KEEP(DENSE_RANK FIRST ORDER BY b nulls FIRST) FROM tab_keep GROUP BY a ORDER BY 1, 2; +SELECT a, MAX(c) KEEP(DENSE_RANK LAST ORDER BY b nulls FIRST) FROM tab_keep GROUP BY a ORDER BY 1, 2; -- Order by clause contains nulls last -SELECT a, MAX(c) KEEP(DENSE_RANK FIRST ORDER BY b nulls LAST) FROM tt02 GROUP BY a ORDER BY 1, 2; -SELECT a, MAX(c) KEEP(DENSE_RANK LAST ORDER BY b nulls LAST) FROM tt02 GROUP BY a ORDER BY 1, 2; +SELECT a, MAX(c) KEEP(DENSE_RANK FIRST ORDER BY b nulls LAST) FROM tab_keep GROUP BY a ORDER BY 1, 2; +SELECT a, MAX(c) KEEP(DENSE_RANK LAST ORDER BY b nulls LAST) FROM tab_keep GROUP BY a ORDER BY 1, 2; ``` \ No newline at end of file diff --git a/product/en/docs-mogdb/v5.1/characteristic-description/maintainability/pageinspect-pagehack.md b/product/en/docs-mogdb/v5.1/characteristic-description/maintainability/pageinspect-pagehack.md index 4884d41b86c0f18240786cba9b0b03b5c43393ec..fb7e0012828713f5e798aa02304536050631fc5e 100644 --- a/product/en/docs-mogdb/v5.1/characteristic-description/maintainability/pageinspect-pagehack.md +++ b/product/en/docs-mogdb/v5.1/characteristic-description/maintainability/pageinspect-pagehack.md @@ -53,7 +53,7 @@ The extension provides several system functions to query using a fixed format wi ```sql # View the contents of the heap data table -SELECT * FROM heap_page_iteme(get_raw_page('table_name','main',page_no)); +SELECT * FROM heap_page_items(get_raw_page('table_name','main',page_no)); # View header information on a heap page SELECT * FROM page_header(get_raw_page('table_name','main',page_no)); # View meta page information diff --git a/product/zh/docs-mogdb/v5.0/characteristic-description/compatibility/add-rowtype-attribute-to-the-view.md b/product/zh/docs-mogdb/v5.0/characteristic-description/compatibility/add-rowtype-attribute-to-the-view.md index 1467a22d79b9c6bb298c175062c70cb8665c3aaf..d9165d9f02d51aca160d95beb75511103e01e5a8 100644 --- a/product/zh/docs-mogdb/v5.0/characteristic-description/compatibility/add-rowtype-attribute-to-the-view.md +++ b/product/zh/docs-mogdb/v5.0/characteristic-description/compatibility/add-rowtype-attribute-to-the-view.md @@ -13,7 +13,7 @@ date: 2023-06-14 ## 特性简介 -本特性为视图增加%rowtype属性,支持作为参数或变量。 +本特性为视图增加%rowtype属性,支持作为参数或变量。使用%ROWTYPE来声明一个与视图相匹配的变量时,该变量将拥有与视图行相同的结构。 ## 客户价值 @@ -31,26 +31,35 @@ END; ## 示例 ```sql -DROP SCHEMA IF EXISTS test_view_sch; +MogDB=# DROP SCHEMA IF EXISTS test_view_sch; NOTICE: SCHEMA "test_view_sch" does NOT exist, skipping -CREATE SCHEMA test_view_sch; -CREATE TABLE test_view_sch.tb_test (c1 INT, c2 varchar2); -CREATE VIEW test_view_sch.v_terst AS SELECT c1, c2 FROM test_view_sch.tb_test; -CREATE OR REPLACE PROCEDURE sp_p1 (i_proname IN test_view_sch.v_terst%rowtype) IS + +MogDB=# CREATE SCHEMA test_view_sch; + +MogDB=# CREATE TABLE test_view_sch.tb_test (c1 INT, c2 varchar2); + +MogDB=# CREATE VIEW test_view_sch.v_terst AS SELECT c1, c2 FROM test_view_sch.tb_test; + +MogDB=# CREATE OR REPLACE PROCEDURE sp_p1 (i_proname IN test_view_sch.v_terst%rowtype) IS BEGIN RAISE NOTICE 'i_proname.c1 is %, i_proname.c2 is %', i_proname.c1, i_proname.c2; END; / -DECLARE -var1 test_view_sch.v_terst %rowtype: = (1111, 'xxxx'); +CREATE PROCEDURE + +MogDB=# DECLARE +var1 test_view_sch.v_terst%rowtype := (1111, 'xxxx'); BEGIN -sp_p1(i_proname = > var1); +sp_p1(i_proname => var1); END; / -NOTICE: i_proname.c1 IS 1111, i_proname.c2 IS xxxx -DROP SCHEMA test_view_sch CASCADE; -NOTICE:DROP cascades TO 3 other objects -DETAIL:DROP cascades TO TABLE test_view_sch.tb_test -DROP cascades TO VIEW test_view_sch.v_terst -DROP cascades TO FUNCTION sp_p1(test_view_sch.v_terst) +NOTICE: i_proname.c1 is 1111, i_proname.c2 is xxxx +ANONYMOUS BLOCK EXECUTE + +MogDB=# DROP SCHEMA test_view_sch CASCADE; +NOTICE: drop cascades to 3 other objects +DETAIL: drop cascades to table test_view_sch.tb_test +drop cascades to view test_view_sch.v_terst +drop cascades to function sp_p1(test_view_sch.v_terst) +DROP SCHEMA ``` \ No newline at end of file diff --git a/product/zh/docs-mogdb/v5.0/characteristic-description/compatibility/aggregate-functions-support-keep-clause.md b/product/zh/docs-mogdb/v5.0/characteristic-description/compatibility/aggregate-functions-support-keep-clause.md index 9ca1b084152344b28680a6c4017a67e9e9fcf696..6d7ed4009bbc134bc69d17a680adc8ff721fbca0 100644 --- a/product/zh/docs-mogdb/v5.0/characteristic-description/compatibility/aggregate-functions-support-keep-clause.md +++ b/product/zh/docs-mogdb/v5.0/characteristic-description/compatibility/aggregate-functions-support-keep-clause.md @@ -44,8 +44,7 @@ MogDB的语法规则与上述Oracle的语法规则基本一致,唯一区别是 ```sql -- 创建表tab_keep -DROP TABLE -IF EXISTS tab_keep; +DROP TABLE IF EXISTS tab_keep; CREATE TABLE tab_keep (a INT, b INT, c INT, d INT, e INT, f INT, g INT); -- 插入数据 INSERT INTO tab_keep VALUES (1, 1, 1, 1, 10, 100, 1000); @@ -95,10 +94,10 @@ SELECT a, b, c, MAX(g) KEEP(DENSE_RANK FIRST ORDER BY d), FROM tab_keep GROUP BY GROUPING SETS((a),(b), (c), (a, b), (a, b, c)) ORDER BY a, b, c; -- Order by子句中包含nulls first -SELECT a, MAX(c) KEEP(DENSE_RANK FIRST ORDER BY b nulls FIRST) FROM tt02 GROUP BY a ORDER BY 1, 2; -SELECT a, MAX(c) KEEP(DENSE_RANK LAST ORDER BY b nulls FIRST) FROM tt02 GROUP BY a ORDER BY 1, 2; +SELECT a, MAX(c) KEEP(DENSE_RANK FIRST ORDER BY b nulls FIRST) FROM tab_keep GROUP BY a ORDER BY 1, 2; +SELECT a, MAX(c) KEEP(DENSE_RANK LAST ORDER BY b nulls FIRST) FROM tab_keep GROUP BY a ORDER BY 1, 2; -- Order by子句中包含nulls last -SELECT a, MAX(c) KEEP(DENSE_RANK FIRST ORDER BY b nulls LAST) FROM tt02 GROUP BY a ORDER BY 1, 2; -SELECT a, MAX(c) KEEP(DENSE_RANK LAST ORDER BY b nulls LAST) FROM tt02 GROUP BY a ORDER BY 1, 2; +SELECT a, MAX(c) KEEP(DENSE_RANK FIRST ORDER BY b nulls LAST) FROM tab_keep GROUP BY a ORDER BY 1, 2; +SELECT a, MAX(c) KEEP(DENSE_RANK LAST ORDER BY b nulls LAST) FROM tab_keep GROUP BY a ORDER BY 1, 2; ``` \ No newline at end of file diff --git a/product/zh/docs-mogdb/v5.0/characteristic-description/compatibility/pivot-and-unpivot.md b/product/zh/docs-mogdb/v5.0/characteristic-description/compatibility/pivot-and-unpivot.md index 3d4d7afe6399fc70eb6659c2d3be52aeb0014aa3..b6bb29785065cf26334508fc4168331348025743 100644 --- a/product/zh/docs-mogdb/v5.0/characteristic-description/compatibility/pivot-and-unpivot.md +++ b/product/zh/docs-mogdb/v5.0/characteristic-description/compatibility/pivot-and-unpivot.md @@ -432,7 +432,7 @@ MogDB=# insert into emp_phone1 values('ddd','6837-2745','','2649-5820'); INSERT 0 1 MogDB=# insert into emp_phone1 values('eee','','','2649-5820'); INSERT 0 1 -# pivot_in中,in类型的隐私转换使用默认list的隐私类型转换 +# unpivot_in中,in类型的隐私转换使用默认list的隐私类型转换 MogDB=# select * from emp_phone1 unpivot(phone for type in (home as 1, office as 2, mobile as 3)); name | type | phone ------+------+----------- diff --git a/product/zh/docs-mogdb/v5.0/characteristic-description/maintainability/pageinspect-pagehack.md b/product/zh/docs-mogdb/v5.0/characteristic-description/maintainability/pageinspect-pagehack.md index a2465f64c5aac65594afe4495dfaa1a17a390eb3..566f7afe14358ba84eca391634abae020fdbb2f3 100644 --- a/product/zh/docs-mogdb/v5.0/characteristic-description/maintainability/pageinspect-pagehack.md +++ b/product/zh/docs-mogdb/v5.0/characteristic-description/maintainability/pageinspect-pagehack.md @@ -53,7 +53,7 @@ CREATE EXTENSION pageinspect; ```sql # 查看heap数据表中内容 -SELECT * FROM heap_page_iteme(get_raw_page('table_name','main',page_no)); +SELECT * FROM heap_page_items(get_raw_page('table_name','main',page_no)); # 查看heap页面的header信息 SELECT * FROM page_header(get_raw_page('table_name','main',page_no)); # 查看meta page信息 diff --git a/product/zh/docs-mogdb/v5.1/characteristic-description/compatibility/add-rowtype-attribute-to-the-view.md b/product/zh/docs-mogdb/v5.1/characteristic-description/compatibility/add-rowtype-attribute-to-the-view.md index 1467a22d79b9c6bb298c175062c70cb8665c3aaf..d9165d9f02d51aca160d95beb75511103e01e5a8 100644 --- a/product/zh/docs-mogdb/v5.1/characteristic-description/compatibility/add-rowtype-attribute-to-the-view.md +++ b/product/zh/docs-mogdb/v5.1/characteristic-description/compatibility/add-rowtype-attribute-to-the-view.md @@ -13,7 +13,7 @@ date: 2023-06-14 ## 特性简介 -本特性为视图增加%rowtype属性,支持作为参数或变量。 +本特性为视图增加%rowtype属性,支持作为参数或变量。使用%ROWTYPE来声明一个与视图相匹配的变量时,该变量将拥有与视图行相同的结构。 ## 客户价值 @@ -31,26 +31,35 @@ END; ## 示例 ```sql -DROP SCHEMA IF EXISTS test_view_sch; +MogDB=# DROP SCHEMA IF EXISTS test_view_sch; NOTICE: SCHEMA "test_view_sch" does NOT exist, skipping -CREATE SCHEMA test_view_sch; -CREATE TABLE test_view_sch.tb_test (c1 INT, c2 varchar2); -CREATE VIEW test_view_sch.v_terst AS SELECT c1, c2 FROM test_view_sch.tb_test; -CREATE OR REPLACE PROCEDURE sp_p1 (i_proname IN test_view_sch.v_terst%rowtype) IS + +MogDB=# CREATE SCHEMA test_view_sch; + +MogDB=# CREATE TABLE test_view_sch.tb_test (c1 INT, c2 varchar2); + +MogDB=# CREATE VIEW test_view_sch.v_terst AS SELECT c1, c2 FROM test_view_sch.tb_test; + +MogDB=# CREATE OR REPLACE PROCEDURE sp_p1 (i_proname IN test_view_sch.v_terst%rowtype) IS BEGIN RAISE NOTICE 'i_proname.c1 is %, i_proname.c2 is %', i_proname.c1, i_proname.c2; END; / -DECLARE -var1 test_view_sch.v_terst %rowtype: = (1111, 'xxxx'); +CREATE PROCEDURE + +MogDB=# DECLARE +var1 test_view_sch.v_terst%rowtype := (1111, 'xxxx'); BEGIN -sp_p1(i_proname = > var1); +sp_p1(i_proname => var1); END; / -NOTICE: i_proname.c1 IS 1111, i_proname.c2 IS xxxx -DROP SCHEMA test_view_sch CASCADE; -NOTICE:DROP cascades TO 3 other objects -DETAIL:DROP cascades TO TABLE test_view_sch.tb_test -DROP cascades TO VIEW test_view_sch.v_terst -DROP cascades TO FUNCTION sp_p1(test_view_sch.v_terst) +NOTICE: i_proname.c1 is 1111, i_proname.c2 is xxxx +ANONYMOUS BLOCK EXECUTE + +MogDB=# DROP SCHEMA test_view_sch CASCADE; +NOTICE: drop cascades to 3 other objects +DETAIL: drop cascades to table test_view_sch.tb_test +drop cascades to view test_view_sch.v_terst +drop cascades to function sp_p1(test_view_sch.v_terst) +DROP SCHEMA ``` \ No newline at end of file diff --git a/product/zh/docs-mogdb/v5.1/characteristic-description/compatibility/aggregate-functions-support-keep-clause.md b/product/zh/docs-mogdb/v5.1/characteristic-description/compatibility/aggregate-functions-support-keep-clause.md index 9ca1b084152344b28680a6c4017a67e9e9fcf696..6d7ed4009bbc134bc69d17a680adc8ff721fbca0 100644 --- a/product/zh/docs-mogdb/v5.1/characteristic-description/compatibility/aggregate-functions-support-keep-clause.md +++ b/product/zh/docs-mogdb/v5.1/characteristic-description/compatibility/aggregate-functions-support-keep-clause.md @@ -44,8 +44,7 @@ MogDB的语法规则与上述Oracle的语法规则基本一致,唯一区别是 ```sql -- 创建表tab_keep -DROP TABLE -IF EXISTS tab_keep; +DROP TABLE IF EXISTS tab_keep; CREATE TABLE tab_keep (a INT, b INT, c INT, d INT, e INT, f INT, g INT); -- 插入数据 INSERT INTO tab_keep VALUES (1, 1, 1, 1, 10, 100, 1000); @@ -95,10 +94,10 @@ SELECT a, b, c, MAX(g) KEEP(DENSE_RANK FIRST ORDER BY d), FROM tab_keep GROUP BY GROUPING SETS((a),(b), (c), (a, b), (a, b, c)) ORDER BY a, b, c; -- Order by子句中包含nulls first -SELECT a, MAX(c) KEEP(DENSE_RANK FIRST ORDER BY b nulls FIRST) FROM tt02 GROUP BY a ORDER BY 1, 2; -SELECT a, MAX(c) KEEP(DENSE_RANK LAST ORDER BY b nulls FIRST) FROM tt02 GROUP BY a ORDER BY 1, 2; +SELECT a, MAX(c) KEEP(DENSE_RANK FIRST ORDER BY b nulls FIRST) FROM tab_keep GROUP BY a ORDER BY 1, 2; +SELECT a, MAX(c) KEEP(DENSE_RANK LAST ORDER BY b nulls FIRST) FROM tab_keep GROUP BY a ORDER BY 1, 2; -- Order by子句中包含nulls last -SELECT a, MAX(c) KEEP(DENSE_RANK FIRST ORDER BY b nulls LAST) FROM tt02 GROUP BY a ORDER BY 1, 2; -SELECT a, MAX(c) KEEP(DENSE_RANK LAST ORDER BY b nulls LAST) FROM tt02 GROUP BY a ORDER BY 1, 2; +SELECT a, MAX(c) KEEP(DENSE_RANK FIRST ORDER BY b nulls LAST) FROM tab_keep GROUP BY a ORDER BY 1, 2; +SELECT a, MAX(c) KEEP(DENSE_RANK LAST ORDER BY b nulls LAST) FROM tab_keep GROUP BY a ORDER BY 1, 2; ``` \ No newline at end of file diff --git a/product/zh/docs-mogdb/v5.1/characteristic-description/compatibility/pivot-and-unpivot.md b/product/zh/docs-mogdb/v5.1/characteristic-description/compatibility/pivot-and-unpivot.md index 9652ff71ce9ec0d79ea3a96403508b99c6be5530..6f5e6ec282fdf9868b96a0630304dce0952e664f 100644 --- a/product/zh/docs-mogdb/v5.1/characteristic-description/compatibility/pivot-and-unpivot.md +++ b/product/zh/docs-mogdb/v5.1/characteristic-description/compatibility/pivot-and-unpivot.md @@ -432,7 +432,7 @@ MogDB=# insert into emp_phone1 values('ddd','6837-2745','','2649-5820'); INSERT 0 1 MogDB=# insert into emp_phone1 values('eee','','','2649-5820'); INSERT 0 1 -# pivot_in中,in类型的隐私转换使用默认list的隐私类型转换 +# unpivot_in中,in类型的隐私转换使用默认list的隐私类型转换 MogDB=# select * from emp_phone1 unpivot(phone for type in (home as 1, office as 2, mobile as 3)); name | type | phone ------+------+----------- diff --git a/product/zh/docs-mogdb/v5.1/characteristic-description/maintainability/pageinspect-pagehack.md b/product/zh/docs-mogdb/v5.1/characteristic-description/maintainability/pageinspect-pagehack.md index a2465f64c5aac65594afe4495dfaa1a17a390eb3..566f7afe14358ba84eca391634abae020fdbb2f3 100644 --- a/product/zh/docs-mogdb/v5.1/characteristic-description/maintainability/pageinspect-pagehack.md +++ b/product/zh/docs-mogdb/v5.1/characteristic-description/maintainability/pageinspect-pagehack.md @@ -53,7 +53,7 @@ CREATE EXTENSION pageinspect; ```sql # 查看heap数据表中内容 -SELECT * FROM heap_page_iteme(get_raw_page('table_name','main',page_no)); +SELECT * FROM heap_page_items(get_raw_page('table_name','main',page_no)); # 查看heap页面的header信息 SELECT * FROM page_header(get_raw_page('table_name','main',page_no)); # 查看meta page信息