【LISTAGG】 ORA-00904: "WM_CONCAT": invalid identifier (Doc
APPLIES TO:
Oracle Database - Enterprise Edition - Version 10.1.0.2 to 18.5.0.0.0 [Release 10.1 to 18]
Information in this document applies to any platform.
GOAL
From Oracle 12.1.0.1 onwards WM_CONCAT function is disabled. We need to use LISTAGG Function.
EXAMPLE:
Connected to:
Oracle Database 11g Enterprise Edition Release 11.2.0.4.0 - 64bit Production With the Partitioning, OLAP, Data Mining and Real Application Testing options SQL> SELECT WM_CONCAT(DISTINCT TYPE) from v$parameter; WM_CONCAT(DISTINCTTYPE)
SQL>
Connected to:
SQL> SELECT WM_CONCAT(DISTINCT TYPE) from v$parameter;
SQL> |
SOLUTION
Why LISTAGG?
LISTAGG is superior to WM_CONCAT. It is fewer latches than wm_concat, latches are lightweight locks that impact the scalability, the more latches we do, the less the scalability is.
LISTAGG does not support the "DISTINCT" option. But it does exclude null values. So, you need to take care of the distinct values yourself before applying LISTAGG.
EXAMPLE:
SQL> drop table t purge; Table dropped. SQL>
Table created. --
SQL>
1 row created. SQL> insert into t values (1,'Name2'); 1 row created. SQL> insert into t values (1,'Name3'); 1 row created. SQL>
SQL> insert into t values (2,'Name1'); 1 row created. SQL> insert into t values (2,'Name2'); 1 row created. SQL> insert into t values (2,'Name1');
SQL> insert into t values (2,'Name2'); 1 row created. SQL> insert into t values (2,'Name4'); 1 row created. SQL>
1 row selected. SQL>
1 row selected.
|
More Information:
From the doc: Oracle Database 12.2 New Features
"Enhanced LISTAGG Functionality
LISTAGG aggregates the values of a column by concatenating them into a single string. New functionality has been added for managing situations where the length of the concatenated string is too long.
Developers can now control the process for managing overflowing LISTAGG aggregates. This increases the productivity and flexibility of this aggregation function."
來自 “ ITPUB部落格 ” ,連結:http://blog.itpub.net/29487349/viewspace-2775435/,如需轉載,請註明出處,否則將追究法律責任。
相關文章
- ORA-00904: "wm_concat":invalid identifier錯誤如何解決?IDE
- [20200312]ORA-00904 POLTYP invalid identifier.txtIDE
- [20210420]ORA-00904 REF invalid identifier 19c dba_obj_audit_opts.txtIDEOBJ
- [20211022]ORA-00904 REF invalid identifier 19c dba_obj_audit_opts(補充).txtIDEOBJ
- Python 錯誤 SyntaxError: invalid character in identifierPythonErrorIDE
- wm_concat函式與oracle版本函式Oracle
- [20221227]19c LISTAGG Enhancements.txt
- sqlserver docSQLServer
- PostgreSQL DBA(80) - Object Identifier TypesSQLObjectIDE
- oracle中listagg()和wmsys.wm_concat()基本用法Oracle
- 用listagg函式分組實現列轉行函式
- 部署Onlyoffice Doc ServerServer
- JavaScript invalid 事件JavaScript事件
- found an invalid color
- [20210114]理解DBMS_SESSION.set_identifier.txtSessionIDE
- 關於hibernate的 No row with the given identifier existsIDE
- Uncaught SyntaxError: Identifier 'Geometry' has already been declaredErrorIDE
- Java Doc 生成文件Java
- DocTo convert doc(x) to pdf
- NLP ——Doc2vec
- 【函式】Oracle12c 列轉行函式使用listagg函式Oracle
- stm32 use of undeclared identifier GPIO_InitTypeDefIDE
- Invalid time zone indicator ‘ ‘Indicator
- StreamCorruptedException: invalid stream headerExceptionHeader
- doc轉docx(java-python)JavaPython
- Oracle 最新PSU (Doc ID 2118136.2)Oracle
- Doc2vec技術
- python: invalid value encountered in divide以及invalid value encountered in double_scalars報錯PythonIDE
- OSError: [Errno 22] Invalid argumentError
- expdp/impdp變慢 (Doc ID 2469587.1)
- Reading and Understanding Systemstate Dumps (Doc ID 423153.1)
- Android開發簡單教程.docAndroid
- Doc.MZ文件管理系統
- mybatis竟然報"Invalid value for getInt()"MyBatis
- SQLLoader ORA-01722 invalid numberSQL
- The Mac is invalid. 為什麼?Mac
- 重編譯 invalid 物件(轉)編譯物件
- ORA-00130: invalid listener address