{"id":529,"date":"2017-05-18T17:53:22","date_gmt":"2017-05-18T22:53:22","guid":{"rendered":"https:\/\/linux.asberry.org\/blog_tech\/?p=529"},"modified":"2024-12-10T15:32:20","modified_gmt":"2024-12-10T21:32:20","slug":"tcc-custom-function-wm_concat","status":"publish","type":"post","link":"https:\/\/asberry.org\/blog_tech\/?p=529","title":{"rendered":"TCC &#8211; Custom Function WM_CONCAT"},"content":{"rendered":"<p>***NOTE: wm_concat failed to function after the application of a patch in the 12c Oracle database. You can more or less use LISTAGG to replace this deprecated function for string aggregation.<\/p>\n<p>We&#8217;ve all had those times when we want to export the user types or groups and return the selections on the same line as opposed to each type and group on a different line. Yes you could use csv-entity export but that&#8217;s never a sure thing.\u00a0 You can use WM_CONCAT to pull the elements and stick them in the same column as comma separated value. This is a bit limited because you have include a grouping for every value not using WM_CONCAT.<\/p>\n<p>Here is a functional demonstration:<\/p>\n<p>Create an empty file named: UserExport-WM_CONCAT_sq.xml<\/p>\n<p>Add this code to the file:<\/p>\n<pre>\u00a0<\/pre>\n\n<div class=\"wp-block-syntaxhighlighter-code \"><pre class=\"brush: xml; light: false; title: ; toolbar: true; notranslate\" title=\"\">\n&lt;?xml version=&quot;1.0&quot; encoding=&quot;UTF-8&quot;?&gt;\n&lt;quer:query productCode=&quot;SO1704&quot; model=&quot;http:\/\/www.taleo.com\/ws\/so800\/2009\/01&quot; projectedClass=&quot;User&quot; locale=&quot;en&quot; mode=&quot;CSV&quot; csvheader=&quot;true&quot; largegraph=&quot;true&quot; preventDuplicates=&quot;false&quot; xmlns:quer=&quot;http:\/\/www.taleo.com\/ws\/integration\/query&quot;&gt;\n\t&lt;quer:subQueries\/&gt;\n\t&lt;quer:projections&gt;\n\t\t&lt;quer:projection&gt;\n            &lt;quer:field path=&quot;UserAccount,Loginname&quot;\/&gt;\n        &lt;\/quer:projection&gt;\n\t\t&lt;quer:projection&gt;\n            &lt;quer:field path=&quot;FirstName&quot;\/&gt;\n        &lt;\/quer:projection&gt;\n\t\t&lt;quer:projection&gt;\n            &lt;quer:field path=&quot;LastName&quot;\/&gt;\n        &lt;\/quer:projection&gt;\n\t\t&lt;quer:projection&gt;\n            &lt;quer:field path=&quot;CorrespondenceEmail&quot;\/&gt;\n        &lt;\/quer:projection&gt;\n\t\t&lt;quer:projection alias=&quot;UserTypeCode&quot; projectedValueType=&quot;&#x5B;C&quot;&gt;\n  &lt;quer:customFunction name=&quot;wm_concat&quot;&gt;\n    &lt;quer:field path=&quot;UserTypes,Code&quot;\/&gt;\n  &lt;\/quer:customFunction&gt;\n&lt;\/quer:projection&gt;\n\t&lt;\/quer:projections&gt;\n\t&lt;quer:projectionFilterings\/&gt;\n\t&lt;quer:filterings\/&gt;\n\t&lt;quer:sortings&gt;\n\t\t&lt;quer:sorting ascending=&quot;true&quot;&gt;\n\t\t\t&lt;quer:field path=&quot;LastName&quot;\/&gt;\n\t\t&lt;\/quer:sorting&gt;\n\t\t&lt;quer:sorting ascending=&quot;true&quot;&gt;\n\t\t\t&lt;quer:field path=&quot;FirstName&quot;\/&gt;\n\t\t&lt;\/quer:sorting&gt;\n\t&lt;\/quer:sortings&gt;\n\t&lt;quer:sortingFilterings\/&gt;\n\t&lt;quer:groupings&gt;\n\t\t&lt;quer:grouping&gt;\n            &lt;quer:field path=&quot;UserAccount,Loginname&quot;\/&gt;\n        &lt;\/quer:grouping&gt;\n\t\t&lt;quer:grouping&gt;\n            &lt;quer:field path=&quot;FirstName&quot;\/&gt;\n        &lt;\/quer:grouping&gt;\n\t\t&lt;quer:grouping&gt;\n            &lt;quer:field path=&quot;LastName&quot;\/&gt;\n        &lt;\/quer:grouping&gt;\n\t\t&lt;quer:grouping&gt;\n            &lt;quer:field path=&quot;CorrespondenceEmail&quot;\/&gt;\n        &lt;\/quer:grouping&gt;\n\t&lt;\/quer:groupings&gt;\n\t&lt;quer:joinings\/&gt;\n&lt;\/quer:query&gt;\n<\/pre><\/div>","protected":false},"excerpt":{"rendered":"<p>***NOTE: wm_concat failed to function after the application of a patch in the 12c Oracle database. You can more or less use LISTAGG to replace this deprecated function for string aggregation. We&#8217;ve all had those times when we want to export the user types or groups and return the selections on the same line as [&hellip;]<\/p>\n","protected":false},"author":2,"featured_media":0,"comment_status":"closed","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"_jetpack_newsletter_access":"","_jetpack_dont_email_post_to_subs":false,"_jetpack_newsletter_tier_id":0,"_jetpack_memberships_contains_paywalled_content":false,"_jetpack_memberships_contains_paid_content":false,"footnotes":"","jetpack_publicize_message":"","jetpack_publicize_feature_enabled":true,"jetpack_social_post_already_shared":true,"jetpack_social_options":{"image_generator_settings":{"template":"highway","default_image_id":0,"font":"","enabled":false},"version":2},"jetpack_post_was_ever_published":false},"categories":[13],"tags":[],"class_list":["post-529","post","type-post","status-publish","format-standard","hentry","category-tcc","author-aron"],"jetpack_publicize_connections":[],"jetpack_featured_media_url":"","jetpack_shortlink":"https:\/\/wp.me\/p4bBkH-8x","jetpack_sharing_enabled":true,"_links":{"self":[{"href":"https:\/\/asberry.org\/blog_tech\/index.php?rest_route=\/wp\/v2\/posts\/529","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/asberry.org\/blog_tech\/index.php?rest_route=\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/asberry.org\/blog_tech\/index.php?rest_route=\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/asberry.org\/blog_tech\/index.php?rest_route=\/wp\/v2\/users\/2"}],"replies":[{"embeddable":true,"href":"https:\/\/asberry.org\/blog_tech\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=529"}],"version-history":[{"count":8,"href":"https:\/\/asberry.org\/blog_tech\/index.php?rest_route=\/wp\/v2\/posts\/529\/revisions"}],"predecessor-version":[{"id":1152,"href":"https:\/\/asberry.org\/blog_tech\/index.php?rest_route=\/wp\/v2\/posts\/529\/revisions\/1152"}],"wp:attachment":[{"href":"https:\/\/asberry.org\/blog_tech\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=529"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/asberry.org\/blog_tech\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=529"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/asberry.org\/blog_tech\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=529"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}