Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • Home
  • SEARCH
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 8204541
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 7, 20262026-06-07T07:55:50+00:00 2026-06-07T07:55:50+00:00

Using Oracle 11g, I have the following LDAP string which is only a subset

  • 0

Using Oracle 11g, I have the following LDAP string which is only a subset of what I am trying to demonstrate here.

Basically I have a very long string that is causing me ‘string literal too long’ issues and basically within this string, I want to be able to either strip out the bits I don’t want or even better, strip out the only bits that I need.

This is only a short version of the string contents/length:

Member of = CN=aTIGERAdmin-Admin, CN=D0902498, CN=ea90045052, CN=aTIGERCall-Admin, CN=DAaTIGERCall-Admin, CN=DAaTIGERCall-Admin, CN=DAaTIGERCall-Admin, CN=DAaTIGERCall-Admin, CN=DAaTIGERCall-Admin, CN=DAaTIGERCall-Admin, CN=DAaTIGERCall-Admin, CN=DAaTIGERCall-Admin, CN=DAaTIGERCall-Admin, CN=aTIGERAdmin-Admin, CN=ea90045052, CN=DAaTIGERCall-Admin, CN=DAaTIGERCall-Admin, CN=DAaTIGERCall-Admin, CN=DAaTIGERCall-Admin, CN=DAaTIGERCall-Admin, CN=DAaTIGERCall-Admin, CN=DAaTIGERCall-Admin, CN=DAaTIGERCall-Admin, CN=aTIGERCall-Admin, CN=aTIGERAdmin-Admin, CN=D0902498, CN=ea90045052, CN=aTIGERCall-Admin, CN=DAaTIGERCall-Admin, CN=DAaTIGERCall-Admin, CN=DAaTIGERCall-Admin, CN=DAaTIGERCall-Admin, CN=DAaTIGERCall-Admin, CN=DAaTIGERCall-Admin, CN=DAaTIGERCall-Admin, CN=DAaTIGERCall-Admin, CN=DAaTIGERCall-Admin, CN=aTIGERAdmin-Admin, CN=ea90045052, CN=DAaTIGERCall-Admin, CN=DAaTIGERCall-Admin, CN=DAaTIGERCall-Admin, CN=DAaTIGERCall-Admin, CN=DAaTIGERCall-Admin, CN=DAaTIGERCall-Admin, CN=DAaTIGERCall-Admin, CN=DAaTIGERCall-Admin, CN=aTIGERCall-Admin,

Assume the above is greater than 4000 characters long.

My issue is, using Oracle SQL and PL/SQL and the above “member of” string, I need to somehow filter out only the bits that look like ‘CN=aTIGER%’ and completely ignore entries that look like ‘CN=DAaTIGER%’ which I believe, we solve my string literal issues but I am unable to filter this out first as my original string is already greater than 4000 chars long.

Using pl/sql, I am seeking an approach that will only return the entries inside “member of” that look like ‘CN=aTIGER%’ and completely ignore entries that look like ‘CN=DAaTIGER%’ at the same time, ensure that there is also a comma at the end of the result.

Do I need to assign this to a CLOB and then process the entries I need?

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-07T07:55:51+00:00Added an answer on June 7, 2026 at 7:55 am

    In the following code, I prepopulated a CLOB “c” with a bunch of data like your sample. I’m not sure what you want to do with each qualifying entry; I just DBMS_OUTPUT it.

    Given all that, here’s a stab at it:

    SET SERVEROUTPUT ON
    DECLARE
        c                   CLOB;
        l_offset            POSITIVE := 1;
        l_ldap_component    LONG;
        l_counter           NATURAL := 0;
    BEGIN
        -- Set up the CLOB.  In real life, this data will come
        -- from some other source.
        c := 'Member of = CN=aTIGERAdmin-Admin'
          || ', CN=D0902498'
          || ', CN=ea90045052'
          || ', CN=aTIGERCall-Admin'
          || ', CN=DAaTIGERCall-Admin'
    --- Lots of additional data excised for the sake of brevity....
          || ', CN=aTIGERCall-Admin,';
        DBMS_OUTPUT.PUT_LINE('Length of CLOB = ' || TO_CHAR(DBMS_LOB.GETLENGTH(c)));
    
        -- Search for commas within the CLOB, and extract each subsequent
        -- inter-comma string, including the trailing comma.
        WHILE (DBMS_LOB.INSTR(c,',',l_offset) > 0)
        LOOP
            l_ldap_component :=
                TRIM (
                    DBMS_LOB.SUBSTR(c
                    ,               DBMS_LOB.INSTR(c
                                    ,              ','
                                    ,              l_offset) - l_offset + 1
                    ,               l_offset)
            );
            IF (l_ldap_component LIKE 'CN=aTIGER%,') THEN
                -- I'm printing the qualified entries to the screen, but you
                -- can add them to a collection or whatever....
                DBMS_OUTPUT.PUT_LINE(l_ldap_component);
            END IF;
            l_offset := DBMS_LOB.INSTR(c,',',l_offset) + 1;
        END LOOP;    
    END;
    /
    

    With the data I used, this code produced the output:

    Length of CLOB = 5127
    CN=aTIGERCall-Admin,
    CN=aTIGERAdmin-Admin,
    CN=aTIGERCall-Admin,
    CN=aTIGERAdmin-Admin,
    CN=aTIGERCall-Admin,
    CN=aTIGERAdmin-Admin,
    CN=aTIGERCall-Admin,
    CN=aTIGERCall-Admin,
    CN=aTIGERAdmin-Admin,
    CN=aTIGERCall-Admin,
    CN=aTIGERAdmin-Admin,
    CN=aTIGERCall-Admin,
    CN=aTIGERAdmin-Admin,
    CN=aTIGERCall-Admin,
    CN=aTIGERCall-Admin,
    CN=aTIGERAdmin-Admin,
    CN=aTIGERCall-Admin,
    CN=aTIGERAdmin-Admin,
    CN=aTIGERCall-Admin,
    CN=aTIGERAdmin-Admin,
    CN=aTIGERCall-Admin,
    CN=aTIGERCall-Admin,
    CN=aTIGERAdmin-Admin,
    CN=aTIGERCall-Admin,
    CN=aTIGERAdmin-Admin,
    CN=aTIGERCall-Admin,
    CN=aTIGERAdmin-Admin,
    CN=aTIGERCall-Admin,
    CN=aTIGERCall-Admin,
    CN=aTIGERAdmin-Admin,
    CN=aTIGERCall-Admin,
    CN=aTIGERAdmin-Admin,
    CN=aTIGERCall-Admin,
    CN=aTIGERAdmin-Admin,
    CN=aTIGERCall-Admin,
    
    PL/SQL procedure successfully completed.
    
    SQL>
    

    I hope this helps.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

Using Oracle 11g release 2, the following query gives an ORA-01790: expression must have
I am using oracle 11g and have written a stored procedure which stores values
I'm using oracle 11g sql developer I have a varchar2 column with dates as
I am using Oracle 11g client, with ODP.NET. I am trying to add conditional
I am using REGEXP_SUBSTR in Oracle 11g and I am having difficulty trying to
Using oracle database. Here's how i think the SQLException happens... Say i have two
I am using oracle 11g and have a table with an XMLType. There are
I am connecting C# with Oracle 11g. I have a DataTable which i fill
I am developing an application using oracle 11g, Java(struts2) and Hibernate. I have table
I am using Oracle 11g, and I have a lot of stored procedure code

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.