Oracle FAQ Your Portal to the Oracle Knowledge Grid
HOME | ASK QUESTION | ADD INFO | SEARCH | E-MAIL US
 

Home -> Community -> Usenet -> c.d.o.misc -> Oracle Internet Directory: DBMS_LDAP.GET_VALUES(..) does not return values

Oracle Internet Directory: DBMS_LDAP.GET_VALUES(..) does not return values

From: Philippe <philippe_vh2_at_email.com>
Date: 2 Jul 2002 00:52:58 -0700
Message-ID: <52a72267.0207012352.2f42ed64@posting.google.com>


When calling DBMS_LDAP.GET_VALUES(..) for an attribute with 1 string value, the returned STRING_COLLECTION is always empty (but NOT NULL) -see code and output attached.
Could anyone tell me what's going wrong?

Thanks,

Philippe

VERSION INFORMATION



Oracle9i Enterprise Edition Release 9.0.1.0.0 - Production PL/SQL Release 9.0.1.0.0 - Production
CORE 9.0.1.0.0 Production
TNS for Solaris: Version 9.0.1.0.0 - Production NLSRTL Version 9.0.1.0.0 - Production

CODE SNIPPET



DECLARE
ldap_session DBMS_LDAP.SESSION;
ldap_search DBMS_LDAP.MESSAGE;
ldap_attrs     DBMS_LDAP.string_collection;
ldap_entry DBMS_LDAP.message;
ldap_entries NUMBER;
ldap_values DBMS_LDAP.string_collection;
ldap_values_bin DBMS_LDAP.binval_collection;
ldap_ber_element DBMS_LDAP.ber_element;
ldap_attr_name VARCHAR2(32000);
ldap_dn VARCHAR2(256);

res PLS_INTEGER;
BEGIN
-- Init
ldap_session := DBMS_LDAP.INIT('xxxx:389', 389); DBMS_OUTPUT.PUT_LINE('Init succeeded');

ldap_entries := DBMS_LDAP.count_entries(ldap_session, ldap_search); DBMS_OUTPUT.PUT_LINE('Number of Entries : '

|| TO_CHAR(ldap_entries));

IF (ldap_entries > 0) THEN

ldap_entry := DBMS_LDAP.FIRST_ENTRY(ldap_session, ldap_search);
ldap_dn := DBMS_LDAP.GET_DN(ldap_session,ldap_entry);
DBMS_OUTPUT.PUT_LINE('DN = ' || ldap_dn);

ldap_attr_name := DBMS_LDAP.first_attribute(ldap_session,ldap_entry,ldap_ber_element); WHILE ldap_attr_name IS NOT NULL LOOP
DBMS_OUTPUT.PUT_LINE(ldap_attr_name);

ldap_values := DBMS_LDAP.GET_VALUES(ldap_session,ldap_entry,ldap_attr_name); DBMS_OUTPUT.PUT_LINE('Number of values : '

|| TO_CHAR(DBMS_LDAP.count_values(ldap_values)));

DBMS_OUTPUT.PUT_LINE('Number of values : '

|| TO_CHAR(ldap_values.count()));

IF ldap_values IS NULL THEN
DBMS_OUTPUT.PUT_LINE('ldap_values is NULL'); END IF; ldap_values_bin := DBMS_LDAP.GET_VALUES_LEN(ldap_session,ldap_entry,ldap_attr_name);

DBMS_OUTPUT.PUT_LINE('Number of values bin: '

|| TO_CHAR(DBMS_LDAP.count_values_len(ldap_values_bin)));

IF (DBMS_LDAP.count_values(ldap_values) > 0 AND ldap_values IS NOT NULL)THEN

FOR inx in ldap_values.first .. ldap_values.last LOOP
DBMS_OUTPUT.PUT_LINE(ldap_attr_name || ' : '

|| TO_CHAR(ldap_values(inx)));
END LOOP;

END IF; ldap_attr_name := DBMS_LDAP.next_attribute(ldap_session,ldap_search,ldap_ber_element); END LOOP; END IF; --close
res := DBMS_LDAP.unbind_s(ldap_session); END; SAMPLE OUTPUT

Init succeeded
Simple bind succeeded
Search done
Number of Entries : 1
DN = cn=000000033,cn=000,cn=000,cn=AA,cn=People,cn=Global Address Book,dc=xxxxx,dc=be,o=internet
mail
Number of values : 0
Number of values : 0
Number of values bin: 0
preferredRfc822Originator
Number of values : 0
Number of values : 0
Number of values bin: 0
uid
Number of values : 0
..... Received on Tue Jul 02 2002 - 02:52:58 CDT

Original text of this message

HOME | ASK QUESTION | ADD INFO | SEARCH | E-MAIL US