Call to ldap server fails ORA-06521: PL/SQL: Error mapping function

I am getting this error(s)
ORA-06521: PL/SQL: Error mapping function
ORA-06512: at "SYS.DBMS_LDAP_API_FFI", line 0
ORA-06512: at "SYS.DBMS_LDAP", line 1338
ORA-06512: at "SYS.DBMS_LDAP", line 1273
ORA-06512: at "SYS.DBMS_LDAP", line 529
ORA-06512: at line 127
after binding and searching an ldap directory.
Line 127 is:
my_dn := DBMS_LDAP.get_dn(my_session, my_entry);
Both of the 'my_xx' parameters have been successfully set earlier in the script I believe as they produce no errors and DBMS_LDAP.count_entries(my_session, my_message) returns = 1.
I am following the example at:
http://download-west.oracle.com/docs/cd/B10501_01/network.920/a96577/smplcode.htm#636994
In fact any of the functions used in the 'while loop' in the above example give a similar error.
Apparently SYS.DBMS_LDAP_API_FFI is a call to an external C program, but this would be a standard Oracle one, not one I have written.
I am connecting to a non-Oracle ldap server, and have tried several (OpenLDAP 2.X, & Windows 2000 AD), with same results.
Any suggestions gratefully received.
Cheers
KIM

Fixed by running the catldap.sql script (ORACLE_HOME/rdbms/admin/catldap.sql) as SYS user and recreated the dbms_ldap packages. I am not sure why some of the functions worked OK and others did not.
KIM

Similar Messages

  • Ldap problem, ORA-06521: PL/SQL: Error mapping function

    I am getting this error(s)
    ORA-06521: PL/SQL: Error mapping function
    ORA-06512: at "SYS.DBMS_LDAP_API_FFI", line 0
    ORA-06512: at "SYS.DBMS_LDAP", line 1338
    ORA-06512: at "SYS.DBMS_LDAP", line 1273
    ORA-06512: at "SYS.DBMS_LDAP", line 529
    ORA-06512: at line 127
    after binding and searching an ldap directory.
    Line 127 is:
    my_dn := DBMS_LDAP.get_dn(my_session, my_entry);
    Both of the 'my_xx' parameters have been successfully set earlier in the script I believe as they produce no errors and DBMS_LDAP.count_entries(my_session, my_message) returns = 1.
    I am following the example at:
    http://download-west.oracle.com/docs/cd/B10501_01/network.920/a96577/smplcode.htm#636994
    In fact any of the functions used in the 'while loop' in the above example give a similar error.
    Apparently SYS.DBMS_LDAP_API_FFI is a call to an external C program, but this would be a standard Oracle one, not one I have written.
    I am connecting to a non-Oracle ldap server, and have tried several (OpenLDAP 2.X, & Windows 2000 AD), with same results.
    Any suggestions gratefully received.
    Cheers
    KIM

    Scott,
    Thanks for your concern. I should have explained. I am working in HTMLdb, successfully using ldap to authenticate, but now need to get the logged-in user's name and other details. All my attemps to use the wwv_flow_ldap functions have failed, and I am no resorting to DBMS_LDAP to get what I want. I am hoping thatsome helpful person can shed some light on this problem
    Cheers
    KIM

  • ORA-06521: PL/SQL: Error mapping function :ORA-06522:undefined :ODCIAggre

    Hi,
    I am getting the following error :
    SQL> select MinDistance(TT) from egg1;
    select MinDistance(TT) from egg1
    ERROR at line 1:
    ORA-06521: PL/SQL: Error mapping function
    ORA-06522: /usr/lib/oracle/xe/app/oracle/product/10.2.0/server/lib/custagg.so:
    undefined symbol: ODCIAggregateInitialize
    I am compiling my C program with OCI using the following command :
    g++ -Wall -c custagg.c -o custagg.o -I$ORACLE_HOME/rdbms/public -I/usr/lib
    I am linking to get a shared library custagg.so file with following command :
    ld -shared -o custagg.so custagg.o $ORACLE_HOME/lib/l*.so ../../usr/lib/libstdc++.s*
    I am not getting any errors during these two phases.
    And when i am calling the extproc custagg(Mindistance) which i implemented using ODCI(oracle data catridge interface) ...I am getting the error undefined symbol : ODCIAggregateInitialize
    So can any one please let me know what shared libraries are required to access the ODCI services and also am I compiling and linking it the right way or am I missing any libraries.
    I have the oci.h & odci.h and several other header files in my :
    $ORACLE_HOME/rdbms/public
    And while linking i am using : $ORACLE_HOME/lib/*.so files.
    So I don't know whether my directory is missing some shared files related to ODCI : can any one please let me know which files or shared libraries I am missing :
    Below are list of files in my : $ORACLE_HOME/lib :
    custagg123.o libclntsh.so libdbcfg10.so libjox10.so libocci.so.10.1 liborasdkbase.so libskgxpd.so libunwind.so.5
    custagg.so libclntsh.so.10.1 libemmas10.so libldapjclnt10.so libocijdbc10.so liborasdkbase.so.10.2 libskgxpu.so libxdb.so
    facility.lis libclsra10.so libhasgen10.so libnjni10.so libocr10.so liborasdk.so libsqlplus.so shell.so
    hsdb_odbc.so libcorejava.so libheteroxa10.so libnjssl10.so libocrb10.so liborasdk.so.10.2 libsqora.so.10.1 sysliblist
    hsdb_ora.so libcoresh10.so libhsbase.so libnnz10.so libocrutl10.so libqsmashr.so libsrvm10.so
    lclasses12.zip libcprts.so.5 libhsnav.so libnque10.so libodm10.so libskgxn2.so libsrvmhas10.so
    libagtsh.so libcxa.so.3 libimf.so libntcpaio10.so libodmd10.so libskgxns.so libsrvmocr10.so
    libagtsh.so.1.0 libcxa.so.5 libirc.a libocci.so libons.so libskgxp10.so libuini10.so
    Please reply to my queries.
    Please let me know if you want to have a look at the symbols of my object file
    Thanks & Regards,
    -NN

    Your issue may relate to XE and it may relate to OCI but it does not relate to SQL and PL/SQL. Consider posting your question in a forum where it will be on topic.
    When you do include full version information (3 decimal places) and the code that is generating the exception.

  • ORA-06521:PL/SQL:Error mapping function :ORA-06522:undefined :ODCIAggregate

    Hi,
    I am getting the following error :
    SQL> select MinDistance(TT) from egg1;
    select MinDistance(TT) from egg1
    ERROR at line 1:
    ORA-06521: PL/SQL: Error mapping function
    ORA-06522: /usr/lib/oracle/xe/app/oracle/product/10.2.0/server/lib/custagg.so:
    undefined symbol: ODCIAggregateInitialize
    I am compiling my C program with OCI using the following command :
    g++ -Wall -c custagg.c -o custagg.o -I$ORACLE_HOME/rdbms/public -I/usr/lib
    I am linking to get a shared library custagg.so file with following command :
    ld -shared -o custagg.so custagg.o $ORACLE_HOME/lib/l*.so ../../usr/lib/libstdc++.s*
    I am not getting any errors during these two phases.
    And when i am calling the extproc custagg(Mindistance) which i implemented using ODCI(oracle data catridge interface) ...I am getting the error undefined symbol : ODCIAggregateInitialize
    So can any one please let me know what shared libraries are required to access the ODCI services and also am I compiling and linking it the right way or am I missing any libraries.
    I have the oci.h & odci.h and several other header files in my :
    $ORACLE_HOME/rdbms/public
    And while linking i am using : $ORACLE_HOME/lib/*.so files.
    So I don't know whether my directory is missing some shared files related to ODCI : can any one please let me know which files or shared libraries I am missing :
    Below are list of files in my : $ORACLE_HOME/lib :
    custagg123.o libclntsh.so libdbcfg10.so libjox10.so libocci.so.10.1 liborasdkbase.so libskgxpd.so libunwind.so.5
    custagg.so libclntsh.so.10.1 libemmas10.so libldapjclnt10.so libocijdbc10.so liborasdkbase.so.10.2 libskgxpu.so libxdb.so
    facility.lis libclsra10.so libhasgen10.so libnjni10.so libocr10.so liborasdk.so libsqlplus.so shell.so
    hsdb_odbc.so libcorejava.so libheteroxa10.so libnjssl10.so libocrb10.so liborasdk.so.10.2 libsqora.so.10.1 sysliblist
    hsdb_ora.so libcoresh10.so libhsbase.so libnnz10.so libocrutl10.so libqsmashr.so libsrvm10.so
    lclasses12.zip libcprts.so.5 libhsnav.so libnque10.so libodm10.so libskgxn2.so libsrvmhas10.so
    libagtsh.so libcxa.so.3 libimf.so libntcpaio10.so libodmd10.so libskgxns.so libsrvmocr10.so
    libagtsh.so.1.0 libcxa.so.5 libirc.a libocci.so libons.so libskgxp10.so libuini10.so
    Please reply to my queries.
    Please let me know if you want to have a look at the symbols of my object file
    Thanks & Regards,
    -NN

    It's only a quick guess but have you checked your tnsnames.ora file to ensure you've opened the environment to find the libraries? If you set the EXTPROC_DLLS=ANY, you open the database to security issues but it should tell you if this cause because you can't access the library that contains the symbol.
    SID_LIST_CALLOUT_LISTENER =
    (SID_LIST =
    (SID_DESC =
    (SID_NAME = PLSExtProc)
    (ORACLE_HOME = <oracle_home_directory>)
    (PROGRAM = extproc)
    (ENV = "EXTPROC_DLLS=ONLY:
    <oracle_home_directory>/customlib/writestr1.so
    ,LD_LIBRARY_PATH=<oracle_home_directory>/lib")
    )

  • ORA-06521: PL/SQL: Error mapping function with 10.1.0 external procedure

    We have an external procedure running fine on 8.1.7 on VMS. After compiling and linking succesfully under 10.1.0, I get ORA-06521 PL/SQL: Error mapping function and ORA-06522: ERROR - vms_dlsym for file x, where x in the filename of the linked executable. Another external procedure that does not connect to the 10.1.0 database runs fine. What could be causing this error in Server 10.1.0 on VMS?
    Thanks,
    Dave

    Here is the code to create the function:
    CREATE OR REPLACE FUNCTION f1
    (h_file_name IN VARCHAR2)
    RETURN BINARY_INTEGER
    IS EXTERNAL
    LIBRARY l1
    NAME "f1"
    LANGUAGE C
    WITH CONTEXT
    PARAMETERS
    (CONTEST,
    h_file_name string);
    Here is the beginning of the Pro*C:
    int f1(epctx, h_file_name)
    OCIExtProcContext *epctx;
    char h_file_name[70];
    char h_line_txt [251];
    int lineno;
    FILE *fptr;
    /* register the connection context ... */
    EXEC SQL REGISTER CONNECT USING :epctx;
    The function loads a flat file into the database. It is probably not related but are unable to SQLPLUS/ or SQLLDR/ into the database from an OS autheniticated account (get ORA-12547: TNS:lost contact.) Thanks for taking the time to look at this. There aren't many people trying this on VMS, I'd bet.

  • ORA-06521: PL/SQL: Error mapping function

    Hi folks,
    I am trying to run gather_table_stats for a particular table but am getting the below error. Any ideas?
    SQL> execute DBMS_STATS.gather_table_stats( ownname=>'DBO',tabname=>'CD_JOURNAL_CHANGE_REG',method_opt=>'FOR ALL INDEXED COLUMNS',cascade=>TRUE);
    BEGIN DBMS_STATS.gather_table_stats( ownname=>'DBO',tabname=>'CD_JOURNAL_CHANGE_REG',method_opt=>'FOR ALL INDEXED COLUMNS',cascade=>TRUE); END;
    ERROR at line 1:
    ORA-06521: PL/SQL: Error mapping function
    ORA-06512: at "SYS.DBMS_STATS", line 10301
    ORA-06512: at "SYS.DBMS_STATS", line 10315
    ORA-06512: at line 1
    I have runt utlrp.sql as sys but with no avail.
    Kindest Regards,
    Will

    You did not mention if the applicable table contains an ADT columns, nested tables and so on.
    You can also do a basic test to determine if the problem is potentially with the table, or with dbms_stats itself. Create a plain table, e.g.
    create table foo( id number, foo_char varchar2(100), constraint pk_foo primary key( id ) using index );
    Using the exact same dbms_stats parameters, do this table. If it works, it points to a potential problem with the other table - some data structure/data type issue maybe. If it does not, then you have a problem with dbms_stats itself.
    You can also drop the indexes on the DBO table and try dbms_stats with different parameters. I.e. change the conditions to see if the error still occur in order to isolate the problem.
    You also could log an iTar/SR for this with Oracle Support.

  • ORA-06521: PL/SQL: Error mapping function while writting into a text file

    Hi,
    I'm getting an errror ORA-06521: PL/SQL: Error mapping function while trying to write data into a text file.
    I'm using the following code:
    --To create a new directory
    create or replace directory temp as 'C:/temp';
    declare
                    l_str varchar2(1000);
                    output_file utl_file.file_type;
                    cursor test_write_cur is
                         select EMPNO,ENAME,JOB,SAL,HIREDATE
                           from EMP
                         where DEPTNO=30;
    begin
               output_file := utl_file.fopen('TEMP','TESTFILE.txt','w');
               for test_write_rec IN test_write_cur
               loop          
                l_str :=     test_write_rec.EMPNO||'^'||test_write_rec.ENAME||'^'||test_write_rec.JOB||'^'||
                         test_write_rec.HIREDATE||'^'||test_write_rec.SAL||chr(10);
                utl_file.put_line(output_file,l_str);
                     end loop;                                                                           
               utl_file.fclose(output_file);
    end;Please suggest me if i'm wrong.
    Thanks & Regards,
    Sanket Mishra

    Dear Sanket,
    I think you are need use TO_CHAR() function
      to_char(test_write_rec.EMPNO) ,
      to_char(test_write_rec.HIREDATE,'DD.MM.YYYY')
      to_char(test_write_rec.SAL)

  • DBMS_LDAP call fails with ORA-06512 Error Mapping function

    Hi,
    I am facing a problem with workflow integration with LDAP.
    I receive
    ORA-6512 Error Mapping Function on one particular line within the WF_LDAP.get_cfg_val procedure.
    WHILE my_entry IS NOT NULL
    LOOP
    my_vals := DBMS_LDAP.get_values (p_session,
    my_entry,
    p_name);
    The documentation says:
    ORA-06521 PL/SQL: Error mapping function
    Cause: An error was detected by PL/SQL trying to map the mentioned
    function dynamically.
    Action: Check the stacked error (if any) for more details.
    This is the trace of the error:
    ORA-06521 PL/SQL Error mapping Function
    ORA-06512 at SYS.DBMS_LDAP_API_FFI line 0
    ORA-06512 at SYS.DBMS_LDAP line 1332
    ORA-06512 at SYS.DBMS_LDAP line 1302
    ORA-06512 at SYS.DBMS_LDAP line 582
    This is the header of the catldap.sql file
    Rem
    Rem $Header: catldap.sql 07-jan-2000.19:15:20 akolli Exp $
    Rem
    Rem catldap.sql
    Rem
    Rem $Header: dbmsldap.sql 14-dec-2001.23:25:22 rbollu Exp $
    Rem
    Rem dbmsldap.sql
    Rem
    This is the output while running it (No errors):
    Library created.
    Package created.
    Package created.
    Package created.
    Package body created.
    Package body created.
    Package body created.
    Synonym created.
    Grant succeeded.
    Synonym created.
    Grant succeeded.
    Database is :
    compatible 9.2.0.0.0
    Am I missing something?
    I have searched all the forums and although there are many references to "Error Mapping Function", noone has reported it in the context of WF - LDAP Integration. So I am not sure how to proceed.
    Please help.
    thanks in advance,
    Libin

    Hi Libin,
    Can you please explain to me the parameters that you put in the Global Preferences, the LDAP_port,LDAP_user,and the others, because I don�t know where I need to search in the server this parameters and I don�t understand su much of OID.
    if you can give to me and little description of that parameters,this would thank for much.
    anticipated thanks
    Arlet

  • How to resolve "Connection to LDAP server failed." error?

    Hello,
    I have installed Coldfusion8 on one of my server that was having ColdFusionMX earlier.
    The ColdFusionMX admin settings are automatically transferred to the new Coldfusion8 admin page after installation.
    Also I have configured all my websites at the time of installation.
    After all when I am trying to login into one of my website system is throwing the below error.
    "Connection to LDAP server failed."
    Prevously it was working well with coldfusionMX. After installed Coldfusion8 I am facing this problem.
    Is there anything to do more with cf admin settings page or is this problem is with the code? (Infact I havent modified my cfm code)
    Please find the piece of code that I am using.
    <cfldap action="QUERY" server="#application.LDAPServer#" port="#application.LDAPPort#" start="#application.LDAPBase#" name="search" attributes="alias, dn, uid, technicalCareerLevel, locationorgunit, givenName, sn" filter="#filter#" scope="SUBTREE" maxRows="2">
    Anybody can assist me on this?
    Thanks in advance.
    Manoz.

    I have fixed this problem successfully.
    The problem was with the referral attribute of the cfldap tag.
    After adding this (referral="yes") attribute to my code I am able to login into my website.
    <cfldap action="QUERY" server="#application.LDAPServer#" port="#application.LDAPPort#" start="#application.LDAPBase#" name="search" attributes="alias, dn, uid, technicalCareerLevel, locationorgunit, givenName, sn" filter="#filter#" scope="SUBTREE" maxRows="2" referral="yes">
    Any way thanks for your assistance!!!!!

  • Connection to LDAP Server failed

    OK, I have an application that has been working for years.
    Yesterday it stopped working and my error trapping started sending
    me messages with the cfcatch.message of " Connection to LDAP Server
    failed" The code hasn't been touch in over three years. Any ideas
    what is going on? I have attached the code but changed some
    information for security reasons.

    CF_contractor wrote:
    > OK, I have an application that has been working for
    years. Yesterday it
    > stopped working and my error trapping started sending me
    messages with the
    > cfcatch.message of " Connection to LDAP Server failed"
    The code hasn't been
    > touch in over three years. Any ideas what is going on? I
    have attached the
    > code but changed some information for security reasons.
    >
    > <cfldap
    > action="QUERY"
    > name="qryResults"
    > attributes="distinguishedname"
    > start=""
    > scope="SUBTREE"
    > filter = "(cn=#txtxNO#)"
    > username="testuser"
    > password="test"
    > server="server.com"
    > >
    >
    An LDAP administrator change the password for or removed the
    'testuser'
    account? Happened to me last week.

  • ORA-06502: PL/SQL: error TABLE OF BOOLEAN INDEX BY BINARY_INTEGER;

    Hi,
    I've a Compiled Body Package which code I described below:
    create or replace
    PACKAGE body emp_pkg
    IS
    TYPE boolean_tabtype2
    IS
      TABLE OF BOOLEAN INDEX BY BINARY_INTEGER;
      valid_jobs boolean_tabtype2; 
    PROCEDURE add_employee(
        first_name employees.first_name%TYPE,
        last_name employees.last_name%TYPE,
        deptid employees.department_id%TYPE,
        jobid employees.job_id%type)
    IS
    BEGIN
      IF valid_deptid(deptid) THEN
      if valid_jobid(jobid) then
                  INSERT
                  INTO employees
                      employee_id,
                      first_name,
                      last_name,
                      email,
                      hire_date,
                      job_id,
                      department_id
                    VALUES
                      employees_seq.NEXTVAL,
                      first_name,
                      last_name,
                      SUBSTR(first_name,1,1)
                      ||SUBSTR(last_name,1,7)
                      ||'@buongio.com',
                      sysdate,
                      'SA_REP',
                      deptid
         ELSE
            RAISE_APPLICATION_ERROR (-20204, 'Invalid job ID. Try again.');
          END IF;
    END add_employee;
    PROCEDURE init_jobs
    is
    begin
    FOR rec IN
      (SELECT job_id FROM jobs
      LOOP
        valid_jobs(rec.job_id):=true;
      END LOOP;
    END init_jobs;
    function valid_jobid(
        jobid employees.job_id%type)
      return boolean
    is
    BEGIN
    return valid_jobs.exists(jobid);
    EXCEPTION
    WHEN no_data_found THEN
    dbms_output.put_line('no valid');
      RETURN FALSE;
    END valid_jobid ;
    BEGIN
      init_jobs;
    END emp_pkg;and the server gives me the next output
    ORA-06502: PL/SQL: error : error de conversión de carácter a número numérico o de valorI suspect that the problem is the procedure init_jobs but I don't Know what could I do to resolve it.
    Thanks in advance...

    sorry
    I forget to remove it,
    the code:
    create or replace
    PACKAGE body emp_pkg
    IS
    TYPE boolean_tabtype2
    IS
      TABLE OF BOOLEAN INDEX BY BINARY_INTEGER;
      valid_jobs boolean_tabtype2; 
    PROCEDURE add_employee(
        first_name employees.first_name%TYPE,
        last_name employees.last_name%TYPE,
        deptid employees.department_id%TYPE,
        jobid employees.job_id%type)
    IS
    BEGIN
      if valid_jobid(jobid) then
                  INSERT
                  INTO employees
                      employee_id,
                      first_name,
                      last_name,
                      email,
                      hire_date,
                      job_id,
                      department_id
                    VALUES
                      employees_seq.NEXTVAL,
                      first_name,
                      last_name,
                      SUBSTR(first_name,1,1)
                      ||SUBSTR(last_name,1,7)
                      ||'@buongio.com',
                      sysdate,
                      'SA_REP',
                      deptid
         ELSE
            RAISE_APPLICATION_ERROR (-20204, 'Invalid job ID. Try again.');
          END IF;
    END add_employee;
    PROCEDURE init_jobs
    is
    begin
    FOR rec IN
      (SELECT job_id FROM jobs
      LOOP
        valid_jobs(rec.job_id):=true;
      END LOOP;
    END init_jobs;
    function valid_jobid(
        jobid employees.job_id%type)
      return boolean
    is
    BEGIN
    return valid_jobs.exists(jobid);
    EXCEPTION
    WHEN no_data_found THEN
    dbms_output.put_line('no valid');
      RETURN FALSE;
    END valid_jobid ;
    BEGIN
      init_jobs;
    END emp_pkg;

  • ORA-06520: PL/SQL: Error loading external library

    Hi
    I am trying to use an external C program from sql using following steps.
    copy the dll in dir ORACLE/806/BIN
    create or replace library outs as
    'e$/ORACLE/806/BIN/SmlCrcChecking.dll'
    create or replace FUNCTION plsCheck_File_CRC (fname Varchar2)
    return boolean
    AS LANGUAGE C
    library outs
    name "Check_File_CRC";
    and call the dll using
    select plsCheck_File_CRC('c:\mttest.txt') from dual;
    The dll is notc alled the message is
    ERROR at line 1:
    ORA-06520: PL/SQL: Error loading external library
    ORA-06522: Unable to load DLL
    Please help
    Prashant

    I am trying to create a Pl/SQL test env using
    create or replace procedure file_test
    (fname in varchar2,
    status out number)
    is
    begin
    If Check_File_CRC (fname) then
    status:=0;
    else
    status:=1;
    end if;
    end;
    However the following errros are displayed
    Errors for PROCEDURE FILE_TEST
    6/1 PL/SQL: Statement ignored
    6/4 PLS-00382: expression is of wrong type
    mY TNSNAMES.ORA contains following
    additions
    EXTPROC_CONNECTION_DATA =
    (DESCRIPTION =
    (ADDRESS_LIST =
    (ADDRESS = (PROTOCOL = IPC)(KEY = EXTPROC0))
    (CONNECT_DATA = (SID = PLSExtProc)(PRESENTATION = RO))
    extproc_connection_data.world =
    (DESCRIPTION =
    (ADDRESS =
    (PROTOCOL = IPC)
    (KEY = extproc))
    (CONNECT_DATA =
    (SID = extproc)
    AND LISTNER.ORA
    SID_LIST_LISTENER =
    (SID_LIST =
    (SID_DESC =
    (SID_NAME = PLSExtProc)
    (ORACLE_HOME = D:\oracle\ora81)
    (PROGRAM = extproc)
    Message was edited by:
    prashant13

  • ORA-06502: PL/SQL error with dimensions and roles

    Hi everyone,
    When executing a mapping that loads a cube we are always getting that ORA-06502: PL/SQL error character string buffer too small
    The cube contains a number of dimensions, some of them with roles. We've checked that the error appears when we use two different lookup operators to fill dimension atributtes in the cube and its correspondent role. If we map dimension attributes with lookup operator, and the role attributes with constants, the mapping executes without any error. Moreover, even thought it doesnt make any sense, if we map the role dimension attributes with a lookup operator linked to a different dimension, it works too.
    We think that this could be due to attributes names, maybe they are too long, but we have tried to make them shorter and still getting the same error.
    Any ideas of what could be happening?
    Thank you so much in advance.

    The return datatype in a PLSQL function is unconstrained. Which means it does not have a size.
    The size is declared on the receiving end.
    What size variable are you trying to return your value into?
    Here is an example...
    SQL>create or replace function my_func
      2  return varchar2
      3  is
      4  begin
      5    return USER;
      6  end;
      7  /
    Function created.
    SQL>declare
      2    my_string varchar2(30);
      3  begin
      4    my_string := my_func;
      5  end;
      6  /
    PL/SQL procedure successfully completed.
    SQL>declare
      2    my_string varchar2(3);
      3  begin
      4    my_string := my_func;
      5  end;
      6  /
    declare
    ERROR at line 1:
    ORA-06502: PL/SQL: numeric or value error: character string buffer too small
    ORA-06512: at line 4

  • ORA 60502 :PL/SQL Error

    ORA 60502 :PL/SQL Error: numeric or value error : character to numeric
    conversion error is displayed at the following line, all the variables are varchar2
    rno :='XYZ-'+ substr(n1,1,15)
    any solution ??
    thanks
    DSD

    Maybe change it to
    rno := 'XYZ-' || substr(n1,1,15);?
    C.

  • ORA-28547: connection to server failed, probable Oracle Net admin error

    Hi Gurus
    I can't get the gateway to work? I'm running on AIX. Any suggestions are appreciated.
    listener.ora
    LISTENER =
    (DESCRIPTION_LIST =
    (DESCRIPTION =
    (ADDRESS = (PROTOCOL = TCP)(HOST = localhost)(PORT = 1522))
    # (ADDRESS = (PROTOCOL = IPC)(KEY = EXTPROC1522))
    SID_LIST_LISTENER=
    (SID_LIST=
    (SID_DESC=
    (SID_NAME=dg4msql)
    (ORACLE_HOME=/oracle/rcsr/base/product/11.2.0/gateway)
    (PROGRAM=dg4msql)
    tnsnames.ora
    dg4msql =
    (DESCRIPTION=
    (ADDRESS=(PROTOCOL=tcp)(HOST=localhost)(PORT=1522))
    (CONNECT_DATA=(SID=dg4msql))
    (HS=OK)
    sqlnet.ora
    SQL_AUTHENTICATION_SERVICES = (NONE)
    NAMES.DIRECTORY_PATH= (TNSNAMES)
    ADR_BASE = /oracle/rcsr/base
    initdg4msql.ora
    HS_FDS_CONNECT_INFO=142.178.205.42:1433//komodo
    # alternate connect format is hostname/serverinstance/databasename
    HS_FDS_TRACE_LEVEL=debug
    HS_FDS_RECOVERY_ACCOUNT=RECOVER
    HS_FDS_RECOVERY_PWD=RECOVER
    $ lsnrctl status
    LSNRCTL for IBM/AIX RISC System/6000: Version 11.2.0.1.0 - Production on 03-MAY-2013 13:48:01
    Copyright (c) 1991, 2009, Oracle. All rights reserved.
    Connecting to (DESCRIPTION=(ADDRESS=(PROTOCOL=TCP)(HOST=localhost)(PORT=1522)))
    STATUS of the LISTENER
    Alias LISTENER
    Version TNSLSNR for IBM/AIX RISC System/6000: Version 11.2.0.1.0 - Production
    Start Date 03-MAY-2013 13:38:14
    Uptime 0 days 0 hr. 9 min. 47 sec
    Trace Level off
    Security ON: Local OS Authentication
    SNMP ON
    Listener Parameter File /oracle/rcsr/base/product/11.2.0/gateway/network/admin/listener.ora
    Listener Log File /oracle/rcsr/base/diag/tnslsnr/abe-rcsr-01/listener/alert/log.xml
    Listening Endpoints Summary...
    (DESCRIPTION=(ADDRESS=(PROTOCOL=tcp)(HOST=127.0.0.1)(PORT=1522)))
    Services Summary...
    Service "dg4msql" has 1 instance(s).
    Instance "dg4msql", status UNKNOWN, has 1 handler(s) for this service...
    The command completed successfully
    $ tnsping dg4msql
    TNS Ping Utility for IBM/AIX RISC System/6000: Version 11.2.0.1.0 - Production on 03-MAY-2013 13:48:53
    Copyright (c) 1997, 2009, Oracle. All rights reserved.
    Used parameter files:
    /oracle/rcsr/base/product/11.2.0/gateway/network/admin/sqlnet.ora
    Used TNSNAMES adapter to resolve the alias
    Attempting to contact (DESCRIPTION= (ADDRESS=(PROTOCOL=tcp)(HOST=localhost)(PORT=1522)) (CONNECT_DATA=(SID=dg4msql)) (HS=OK))
    OK (0 msec)
    $ sqlplus aa/aa@dg4msql
    SQL*Plus: Release 11.2.0.1.0 Production on Fri May 3 13:49:52 2013
    Copyright (c) 1982, 2009, Oracle. All rights reserved.
    ERROR:
    ORA-28547: connection to server failed, probable Oracle Net admin error

    You can't directly use the gateway - you can only access a gateway using a database link.
    So this won't work:
    $ sqlplus aa/aa@dg4msql
    You need to connect to your Oracle database (for example as sysdba) and create a (public) database link:
    create [public] database link dg4msql connect to "<MS SQl Server username! identified by "<MS SQl Server password>" using 'dg4msql;
    Once you create the database link you can now access the MS SQl Server tables:
    select * from "your MS SQL Server table"@dg4msql;

Maybe you are looking for