DBMS_LDAP in a function
387453Feb 16 2003 — edited Feb 20 2003hi,
i am trying to use dbms_ldap to retrieve email info by modifying the sample codes provided by oracle. previously, i have use the oroginal sample codes and execute it by using sqlplus & it works.
then i have modified the codes and put it in a function. however, when i try to compile, it shows this error:
PLS-00201: identifier 'DBMS_LDAP.SESSION' must be declared
my questions:
1) why must i declare the identifier above as i have already run the catldap.sql script (in sqlplus)?
2) what does the catldap.sql does?
3) currently i am using toad to do the pl/sql scripts. do i have to do something so that i can get this code works?
here's my function script:
CREATE OR REPLACE FUNCTION get_emailid (
user_id VARCHAR
)
RETURN VARCHAR IS
emailid qa_messages.recipient_to%TYPE;
retval PLS_INTEGER;
my_session DBMS_LDAP.session;
my_attrs DBMS_LDAP.string_collection;
my_message DBMS_LDAP.message;
my_entry DBMS_LDAP.message;
entry_index PLS_INTEGER;
my_dn VARCHAR2(256);
my_attr_name VARCHAR2(256);
search_uid VARCHAR2(10);
my_ber_elmt DBMS_LDAP.ber_element;
attr_index PLS_INTEGER;
i PLS_INTEGER;
my_vals DBMS_LDAP.STRING_COLLECTION ;
ldap_host VARCHAR2(256);
ldap_port VARCHAR2(256);
ldap_user VARCHAR2(256);
ldap_passwd VARCHAR2(256);
ldap_base VARCHAR2(256);
BEGIN
--my search code here
END;