title: PLS-00306: wrong number or types of arguments in call to 'select_s'
body: <p>Just calling this directly from the editor (Toad). No idea why getting the above error having checked the function definition and variable types repeatedly. All of the information available online seems to be for stored procedures - which I don't believe are used here</p>
  
  <pre><code>DECLARE
  TYPE attrs_type is VARRAY(10) of STRING(10);
  l_ldap_host VARCHAR(255) := 'SERVERNAME';
  l_ldap_port INT := 389;
  l_ldap_user VARCHAR(255) := 'USERNAME';
  l_ldap_passwd VARCHAR(255) := 'PASSWORD';
  l_ldap_base VARCHAR(255) := 'l=something,dc=something';
  l_session DBMS_LDAP.session;
  l_retval NUMBER;
  l_entry VARCHAR(255);
  l_attrs attrs_type;
  l_message VARCHAR(255) := null;
  l_filter VARCHAR(255) := 'objectclass=*';
  
  BEGIN
  l_session := DBMS_LDAP.init(hostname =&gt; l_ldap_host,
                               portnum =&gt; l_ldap_port);
  l_retval := DBMS_LDAP.simple_bind_s(ld =&gt; l_session,
                                      dn =&gt; l_ldap_user,
                                  passwd =&gt; l_ldap_passwd);
  l_attrs(1) := '*'; -- retrieve all attributes                      
  l_retval := DBMS_LDAP.search_s(
                               ld =&gt; l_session,
                               base =&gt; l_ldap_base,
                               scope =&gt; DBMS_LDAP.SCOPE_SUBTREE,
                               filter =&gt; l_filter,
                               attrs =&gt; l_attrs,
                               attronly =&gt; 0,
                               res =&gt; l_message);  
  DBMS_OUTPUT.put_line(l_message);
  -- code to do stuff                   
  EXCEPTION
      WHEN OTHERS THEN DBMS_OUTPUT.put_line (SQLERRM);
  END
  </code></pre>