Skip to Main Content

SQL & PL/SQL

Announcement

For appeals, questions and feedback about Oracle Forums, please email oracle-forums-moderators_us@oracle.com. Technical questions should be asked in the appropriate category. Thank you!

Concatenate many rows into comma-separated list

jaijeevaMar 7 2017 — edited Mar 7 2017

Hi,

    Could you please help me out that i used  below query is not working in production environment but it's working fine in development environment.

UPDATE lf_miscellaneous

   SET card_type = (SELECT card_value

  FROM (SELECT rn, substr(sys_connect_by_path(card_value, ','), 2) card_value

           FROM (SELECT card_value, rownum rn  FROM (

                   SELECT DISTINCT card_value

                    FROM lf_cardtype_mapping t, lf_cardtype a

                   WHERE t.card_id = a.id

                         AND a.status = 'A'))

          START WITH rn = 1

         CONNECT BY PRIOR rn + 1 = rn

          ORDER BY rn DESC)

WHERE rownum = 1)

local development environment database details as below

---------------------------------------------------------------------------------

Oracle Database 10g Release 10.2.0.5.0 - 64bit Production

PL/SQL Release 10.2.0.5.0 - Production

CORE    10.2.0.5.0      Production

TNS for Linux: Version 10.2.0.5.0 - Production

NLSRTL Version 10.2.0.5.0 - Production

Production environment database details as below

---------------------------------------------------------------------------------

Oracle Database 10g Release 10.2.0.4.0 - 64bit Production

PL/SQL Release 10.2.0.4.0 - Production

CORE    10.2.0.4.0      Production

TNS for Linux: Version 10.2.0.4.0 - Production

NLSRTL Version 10.2.0.4.0 - Production

Comments
Locked Post
New comments cannot be posted to this locked post.
Post Details
Locked on Apr 4 2017
Added on Mar 7 2017
8 comments
612 views