wm-concat

Convert WM_CONCAT to Listagg

社会主义新天地 提交于 2019-12-23 14:57:55
问题 My DBA is upgrading my oracle db from v10 to v12. I have some old SP's that uses wm_concat and I need to change it to listagg . The problematic code is this: Select registration_id,package_set_id, REPLACE(REPLACE(WM_CONCAT(REPLACE( (case when ROW_NUMBER() over (partition by product_id,product_detail_set_id,registration_id,product_family_id,application_id,package_Set_id, legal_status order by packset_country)=1 then legal_status else null end), ',' , '#')) OVER (PARTITION BY PRODUCT_ID,

How to concatenate multiple rows order by sequence in Oracle10g

你。 提交于 2019-12-20 02:50:17
问题 If I have a data like this: GROUP | SEQUENCE | COMMAND ------------------------------ ONE | 3 | <message2>MESSAGE</message2> ONE | 1 | <?xml version="1.0" encoding="UTF-8"?> ONE | 2 | <message1>MESSAGE</message1> TWO | 2 | <message2>MESSAGE</message2> TWO | 1 | <?xml version="1.0" encoding="UTF-8"?> ........ TWO | 10 | <message9>MESSAGE</message9> How can I concatenate the command to be like this: GROUP | COMMAND ----------------- ONE | <?xml version="1.0" encoding="UTF-8"?>,<message1>MESSAGE

ORACLE/SQL: wm_concat & order by

眉间皱痕 提交于 2019-12-18 06:58:13
问题 I'm using oracle 11 (not sure about the exact version, but since LISTAGG doesn't work, I suppose it's not release 2) through ODBC and crystal reports 2008. Here is the problem I have: Here's a table: TABLE ODB.TASK_CARD_CONTROL ------------------------------------------ task_card control_category code ------------------------------------------ 1 zone 17 1 zone 33 1 zone 21 2 zone 18 2 zone 05 3 zone 55 3 zone 32 3 zone 72 I'm using the WM_CONCAT function to obtain something like this: task

Why does the wm_concat not work here?

老子叫甜甜 提交于 2019-12-17 10:06:16
问题 I have this query : (SELECT OBJECT_ID from cr_object_group_entries_vw where object_group_id IN (SELECT ITEM FROM TABLE(CR_FN_SPLIT_STRING('28,56',',')))) that returns : But when I do : SELECT wm_concat(object_id) FROM (SELECT OBJECT_ID from cr_object_group_entries_vw where object_group_id IN (SELECT ITEM FROM TABLE(CR_FN_SPLIT_STRING('28,56',',')))) I get a blank result... what am I doing wrong? 回答1: You must avoid wm_concat function because it is undocumented and discovered as workaround at

Using WMSYS.WM_CONCAT with Oracle XE 10g

给你一囗甜甜゛ 提交于 2019-12-07 15:53:36
问题 When I try to use WMSYS.WM_CONCAT with Oracle XE 10g, I receive a compilation error: ORA-00904: "WMSYS"."WM_CONCAT": invalid identifier . Can anyone verify that this is indeed due to XE lacking this (undocumented) feature? If so, is there anyway to enable it in XE? 回答1: I had found a couple reference sites, but had no luck enabling it. I ended up writing my own function to handle the concatenation. CREATE or replace FUNCTION CONCAT_LIST( cur SYS_REFCURSOR, sep Varchar2 ) RETURN VARCHAR2 IS

Oracle Function: Replicate wm_concat

前提是你 提交于 2019-12-05 11:57:19
I currently am working on a project within Crystal Reports that refuses to use the undocumented function WM_CONCAT, which is allowable within Oracle 10g. Here is the WM_CONCAT header information WM_CONCAT(p1 IN VARCHAR2) RETURN VARCHAR2 To use WM_CONCAT I pass it the following: WM_CONCAT(column1); This function seems to accept a column of type varchar2, and returns a comma delimited list of values from the column. I currently have a custom version of this function that works (on my work computer), but it is not optimal and lacks re-usability. Could anyone provide a good, re-usable function

How to concatenate multiple rows order by sequence in Oracle10g

妖精的绣舞 提交于 2019-12-01 23:38:45
If I have a data like this: GROUP | SEQUENCE | COMMAND ------------------------------ ONE | 3 | <message2>MESSAGE</message2> ONE | 1 | <?xml version="1.0" encoding="UTF-8"?> ONE | 2 | <message1>MESSAGE</message1> TWO | 2 | <message2>MESSAGE</message2> TWO | 1 | <?xml version="1.0" encoding="UTF-8"?> ........ TWO | 10 | <message9>MESSAGE</message9> How can I concatenate the command to be like this: GROUP | COMMAND ----------------- ONE | <?xml version="1.0" encoding="UTF-8"?>,<message1>MESSAGE</message1>,<message2>MESSAGE</message2> TWO | <?xml version="1.0" encoding="UTF-8"?>,<message1>MESSAGE

Getting ORA-22922 (nonexistent LOB value) or no result at all with wm_concat()

你说的曾经没有我的故事 提交于 2019-11-28 13:12:33
(Using Oracle 11.2) I have a rather complicated SQL with something like wm_concat( distinct abc ) that is expected to return some varchar2(4000) compatible result . It causes ORA-00932: inconsistent datatypes in my select used in some coalesce( some_varchar_col, wm_concat( ... ) ) . So I tried casting it via two different methods: dbms_lob.substr( ..., 4000 ) -- L) tried even with 3000 in case of "unicode byte blow-up" cast( ... as varchar2(4000)) -- C) tried even with 3000 in case of "unicode byte blow-up" (The are used in a view, but playing around with it suggests, it is not related to the

Why does the wm_concat not work here?

孤街浪徒 提交于 2019-11-27 09:46:29
I have this query : (SELECT OBJECT_ID from cr_object_group_entries_vw where object_group_id IN (SELECT ITEM FROM TABLE(CR_FN_SPLIT_STRING('28,56',',')))) that returns : But when I do : SELECT wm_concat(object_id) FROM (SELECT OBJECT_ID from cr_object_group_entries_vw where object_group_id IN (SELECT ITEM FROM TABLE(CR_FN_SPLIT_STRING('28,56',',')))) I get a blank result... what am I doing wrong? You must avoid wm_concat function because it is undocumented and discovered as workaround at Oracle 8i times. Since times of old method with custom aggregate function as discovered by Tom Kyte here

Getting ORA-22922 (nonexistent LOB value) or no result at all with wm_concat()

时光怂恿深爱的人放手 提交于 2019-11-27 07:31:23
问题 (Using Oracle 11.2) I have a rather complicated SQL with something like wm_concat( distinct abc ) that is expected to return some varchar2(4000) compatible result . It causes ORA-00932: inconsistent datatypes in my select used in some coalesce( some_varchar_col, wm_concat( ... ) ) . So I tried casting it via two different methods: dbms_lob.substr( ..., 4000 ) -- L) tried even with 3000 in case of "unicode byte blow-up" cast( ... as varchar2(4000)) -- C) tried even with 3000 in case of