A weird exception in 12 c (ORA-01461: can bind to a LONG value only for insert into a LONG column)

I have a Windows application that accesses a database of 12 c Oracle via ODBC (driver version is 12.01.00.01).

I have a table with a column of key named REGION_ID (NVARCHAR2 (9)) and a dozen other columns, of which three are named region1 and region.2 elle3, all of type NVARCHAR2 (40).

When I try to insert a string in the scope of the region1 is longer than 9 characters (length of REGION_ID), I get an error ORA-01461 (' can bind to a LONG value only for insert into a LONG column). If I set the length of REGION_ID be NVARCHAR2 (15), so I can add channels to the region1 in length up to 15 field until I get ORA-01461 exception again. Curiously, if I change the name of column region1 to REGIONONE, I don't get any errors, and everything works fine. It's almost as if the column name region1 is being confused with REGION_ID backstage.

Any ideas? I am using SQLBindParameter to bind the columns, and all calls are successful. I get the exception when I run the insert statement. This same code worked for previous versions of Oracle (9i, 10g and 11g). And if I use a driver of client 11g against the 12 c server, I do not receive the exception.

Thank you!

It is a component of ODBC driver bug in 12 c and it is fixed. You can download and install the fix for bug 18232462 or the last window for 12 c patch cumulative/bundle.

Thank you

Spengler

Tags: Database

Similar Questions

  • ORA-01461: can bind to a LONG value only for insert into a LONG column

    Hello

    Oracle XE on RHE dedicated server
    create table cvDetails(
    cd_id number(14) primary key,
    cv_id number(14) constraint education_fk references CvProperties(cv_id),
    nationality varchar2(230),
    objectives varchar2(3900),
    name varchar2(230),
    fatherName varchar2(230),
    motherName varchar2(230),
    dob varchar2(230),
    gender varchar2(230),
    mStatus varchar2(230),
    passportNo varchar2(110),
    email varchar2(230),
    phone varchar2(45),
    mobile varchar2(25),
    address varchar2(2500),
    state varchar2(230),
    zipCode varchar2(230),
    city varchar2(230),
    education clob,
    experience clob,
    skills clob,
    languages varchar2(1400),
    hobbies varchar2(3200),
    achievements varchar2(3900),
    references varchar2(3900)
    );
    
    create sequence cvDetails_seq
    start with 1 increment by 1;
    
    create or replace trigger cvDetails_trig
    before insert on cvDetails
    referencing new as new
    for each row
    begin 
    select cvDetails_seq.nextval into :new.cd_id from dual;
    end;
    /
    Why do I get the error of subject?

    Thank you in anticipation

    >
    in any case, I checked manually according to your instructions and found that this objective column is of character input more than specified.
    >
    Glad you found the problem, but I hope that you learned a lesson that is time consuming.

    It must be remembered that we have no access to your environment. If we do not know which servers, clients, tables and users that you use.
    It may seem simple to you but doesn't realize that you provide us with two slightly different versions of the cvDetails table.

    The original post had this
    >
    objectives varchar2 (3900).
    >
    But when you have provided your 'cvDetails desc' journal text has
    >
    OBJECTIVES VARCHAR2 (3950)
    >
    It is the same table that you started with how the column suddenly grow 50 bytes?
    This means that you did from different parts of the present in the two schemas or on two servers or you change the table between the two.

    You can't address properly when you do this. By chance it is the column that you said is now the problem.
    In SQL, the maximum length of a VARCHAR2 is 4000 bytes; no characters but bytes. Nothing more than 4000 bytes would probably be a LONG in the generic sense.

    If your error
    >
    Re: ORA-01461: can bind to a LONG value only for insert into a LONG column
    >
    means that you try to 'bind a LONG value' to a column VARCHAR2 and you can't you can 'bind a LONG value only for insert in a LONG column.

    In the proper context, the error makes sense.

    You probably have a problem with

     ps.setString(2,  objectives);
    

    because the 'objectives' has a length of more than 4000 bytes.

    Remember this answer from you?
    >
    I have read and found that there may be a problem with the driver JDBC or Characterset. Am I wrong?
    >
    The 'Hello' ASCII string is five characters and five bytes because the ASCII code is a set of characters in a single byte. The same string internally in Java is five characters but ten bytes because Java uses UTF16.

    So, if the character set of the data itself is double-byte character set then anything more than 2000 characters (4000 bytes) is a "LONG". And if your column is defined as VARCHAR2 (3950), which means bytes a doublel-byte character set which are characters of 1975.

    Then you said in a response later
    >
    I checked by the SNA Server and oracle that are both of the same but new thing I found is that oracle does not allow more than one clob column in a table. Is this true?
    >
    Somehow a hypothesis has crept it that the problem was not a driver JDBC or Charaterset, but because you can not have more than one clob column in a table.

    You could have easily tested for yourself by doing what P. Forstmann - tried to create a table and see.

    Then you completely ignored my advice
    >
    I suggest to you isolate the columns actually causing the problem.
    Change your code to insert only a few columns. When it works, add more than a few columns.
    This will then tell you which column or the columns are at the origin of the problem.
    Display the results once you determine a column that causes the error.
    >
    When you have finally made the simplest things, you have found what was causing the problem almost immediately.

    Many times you don't need 'experts' - you must use a rigorous, methodical, process step by step.

    ALWAYS, ALWAYS, ALWAYS reduce the simplest possible code example that illustrates the problem.
    If you had followed this a rule would have probably found you the problem and makes you look like the 'expert '.

    There are no shortcuts.

  • ORA-01461: can bind to a LONG value only for insert into a LONG column of dynamic Action

    I try to apply the condition to display items in a table with the following error code.its dynamic action when him save the day.

    event: click on

    Selection type: button

    name of the button: P23_ADD_MORE_ROW

    condition: no strings attached

    //P23_NAME_BY_CAT,P23_HOW_MANY as LOV  in apex form
    var l_no_rows;
    l_no_rows = apex.item("P23_HOW_MANY").getValue();
    for (var i=0; i<l_no_rows; i++){
      apex.widget.tabular.addRow();
    
    if  ($v("P23_NAME_BY_CAT")==1) {
    $("#WORK_QTY").show();
    $('td[headers=WORK_QTY]').show();
    $("#WORK_LOCTION").hide();
    $('td[headers=WORK_LOCTION]').hide();
    $("#MY_LOCTION").hide();
    $('td[headers=MY_LOCTION]').hide();
    //with morethan 25+ entry
    }
    else if ($v("P23_NAME_BY_CAT")==2) {
    $("#WORK_QTY").hide();
    $('td[headers=WORK_QTY]').hide();
    
    $("#WORK_LOCTION").show();
    $('td[headers=WORK_LOCTION]').show();
    
    $("#MY_LOCTION").hide();
    $('td[headers=MY_LOCTION]').hide();
    //with morethan 25+ entry
    }
    else if ($v("P23_NAME_BY_CAT")==2) {
    $("#WORK_QTY").hide();
    $('td[headers=WORK_QTY]').hide();
    $("#WORK_LOCTION").hide();
    $('td[headers=WORK_LOCTION]').hide();
    
    $("#MY_LOCTION").show();
    $('td[headers=MY_LOCTION]').show();
    //with morethan 25+ entry
    }
    else {
    alert("no  count");
    }
    };
    
    

    dynamic action above can ignite if you level column, it means when I choose LOV value so that specified columns will show only rest in a column will be hidden. up to 10 input works fine.

    Hi Ramani_apex,

    Is the action of javascript executed in the dynamic action of the code you posted above or more code?

    You seem to have exceeded a 4000 or 32 K bytes on a column of metadata for dynamic action when you set the dynamic action.

    function f_mybuttonAction () {
    //P23_NAME_BY_CAT,P23_HOW_MANY as LOV  in apex form
    var l_no_rows;
    l_no_rows = apex.item("P23_HOW_MANY").getValue();
    for (var i=0; i
    
    • Call the action javascript function run the dynamic action javascript code:
    //mybutton action
    f_mybuttonAction();
    

    Reference:

    I hope this helps!

    Kind regards

    Kiran

  • APex 4.1 error ORA-01461: can bind to a value of type LONG only to insert them into a LONG

    Hello

    Faced with a strange question.

    I have a regular cursor, and in this loop of cursor, I have a select statement in some variables based on cursor settings.

    I was getting the "ORA-01461: can bind to a LONG value only for insert into a LONG column" error so I started the individual verification of each of the columns. Now, it works fine for some columns, but the moment I add this numeric field. He began to throw this error. Now, the source of the database where the selection is triggered is of type number, the variable in which I select is number.

    Infact, I have not any column defined anywhere.

    The strange thing is that the block is running perfectly fine in SQl developer. So, looks like a specific problem of the Apex.

    I'm in 4.1 / 11g

    Any ideas?

    Thank you
    Sun

    I'm NOT aware of documentation showing HOW the APEX team have built APEX (database design wise), but this met enough to collect that they use with a near limit of the VARCHAR2 VARCHAR2 columns size limit...

    I'm NOT aware of a limit on the size of the service procedure in the database.

    The code that you add to a form or report is stored in tables oracle APEX uses its called metadata (data about data)... So it would make sense that there are limits to how much can be stored in the form elements when developing... Try this, on a form region, go to the comment section and try to add a ton of comments or lines of text and save... You will hit a point where long error will happen (I'm now hitting, trying to replace sql selects for reports in an application, old registration code in case of questions, can not post in the comments field..)

    I believe in a dynamic action, you can have the run of the pl/sql code, so if you have a procedure called RunMyCode you could do that

      begin
    
       RunMyCode(:P1_AL,:P1_B);
    
      end;
    

    Where you large PL/SQL block could be stored...

    Thank you

    Tony Miller
    Dallas, TX

  • ORA-01461: can bind to a value of type LONG only to insert them into a column error

    Oracle 11g R1 RHEL 5 64-bit (Apex 3.1)

    Hi all

    I will have a hard time with this error:

    ORA-01461: can bind to a LONG value only for insert into a LONG column
    ORA-06512: at "FPRCHR. PKG_TRIGGER_EMAIL', line 39
    ORA-06512: at "ISWRNEW. PKG_NOTIFICATION', line 310
    ORA-06512: at "ISWRNEW. PKG_NOTIFICATION', line 1745
    ORA-06512: at line 1

    The FPRCHR. PKG_TRIGGER_EMAIL is as follows:

    ...
    INSERT INTO fprchr.trigger_email
    (trigger_email_rid,
    email_to,
    email_from,
    email_body,
    objet_message_electronique,
    email_cc,
    email_bcc,
    mime_type,
    email_priority
    )
    VALUES (l_job,
    p_recipients,
    p_sender,
    p_message,
    p_subject,
    p_cc,
    p_bcc,
    p_mime_type,
    p_priority
    );
    run immediately 'alter session set events 'name context 10046 trace off'. "
    Send END;
    ...


    It seems that the characters have exceeded the capable of handling VARCHAR2 limit? What other data type can change the table of fprchr.trigger_email to? Is that all that is needed?

    Thank you.

    It seems that the characters have exceeded the capable of handling VARCHAR2 limit? What other data type can change the table of fprchr.trigger_email to? Is that all that is needed?

    Have you tried with the clob data type?

    Kind regards.

    LOULOU

  • ORA - 01461:can bind a LONG value only for insert in a LONG column. After upgrade to 11g

    After update, oracle 11g, we get the system error when you try to insert the text string in the NCLOB type column.

    ORA - 01461:can bind a LONG value only for insert in a LONG column.

    This has not happened on an earlier version of Oracle.

    I did some testing and found that, if a string more then 2000 we get this error.

    How to solve this problem?

    Thank you

    I found a solution. I had to update ODP.NET to 2.112.1.0 version.

  • ORA-06550: PLS-00394: wrong number of values in the list INTO a mesh FETCH

    Dear friends,
    I ask you a suggestion:

    The following code inserts a table errors (errori_work), the IDS of the records repeat (in the work of the table), but gives me this error:
    ORA-06550: PLS-00394: wrong number of values in the list of a FETCH statement INTO.

    The work of the table has the 78 columns: the problem of the fields used in the slider flew against the 78% ROWTYPE fields?
    I could use a record declared as the cursor (rec_tabwork cu_tabwork % ROWTYPE;), but in the MANUAL I need a field (ID_WORK) is not present in the cursor.

    declare
    CURSOR cu_tabwork IS
    SELECT CD_STRUTTURA, CD_SUB_STRUTTURA, NR_PRATICA, likelihood
    Work
    CD_STRUTTURA, CD_SUB_STRUTTURA, NR_PRATICA, applications GROUP
    HAVING COUNT (rowid) > 1
    UNION ALL
    SELECT CD_STRUTTURA, CD_SUB_STRUTTURA, NR_PRATICA, likelihood
    Work
    CD_STRUTTURA, CD_SUB_STRUTTURA, NR_PRATICA, applications GROUP
    After HAVING COUNT (rowid) > 2.
    rec_tabwork work % ROWTYPE;
    BEGIN
    Open cu_tabwork;
    loop
    extract the cu_tabwork in rec_tabwork;
    If FOUND then % cu_tabwork
    dbms_output.put_line (rec_tabwork. (ASL); -test
    INSERT INTO errori_work
    (cd_errore, note, ID_WORK)
    )
    VALUES ("ACC", "Record ripetuto nella table work", rec_tabwork.ID_WORK)
    );
    end if;
    EXIT WHEN cu_tabwork % NOTFOUND;
    end loop;
    close cu_tabwork;
    end;

    Can you help me?
    Thank you
    Leo

    Hello

    I loaded your data and ran the query. It's coz the NR_RICETTA contains a null value, so your State A.NR_RICETTA = B.NR_RICETTA will fail when it checks for NULL = NULL. Here is your output from the query

    PRAZY@orcl> select count(ID_AMBS) FROM WORK A
      2  WHERE A.ROWID > ANY (SELECT B.ROWID FROM WORK B
      3  WHERE A.CD_PRESIDIO        =B.CD_PRESIDIO
      4  AND A.GGMM_CONTATTO        =B.GGMM_CONTATTO
      5  AND A.NR_RICETTA   =B.NR_RICETTA
      6  AND A.CD_CONT_PRESCR       =B.CD_CONT_PRESCR
      7  AND A.NR_PROG_INT  =B.NR_PROG_INT
      8  AND A.DESTINAZIONE =B.DESTINAZIONE)
      9  /
    
    COUNT(ID_AMBS)
    --------------
                48
    
    Elapsed: 00:00:00.00
    

    Therefore, I have included NVL to A.NR_RICETTA, which will produce true when it finds null checking 0 = 0 and you will get your result. and this is what you are looking for

    PRAZY@orcl> select count(ID_AMBS) FROM WORK A
      2  WHERE A.ROWID > ANY (SELECT B.ROWID FROM WORK B
      3  WHERE A.CD_PRESIDIO        =B.CD_PRESIDIO
      4  AND A.GGMM_CONTATTO        =B.GGMM_CONTATTO
      5  AND NVL(A.NR_RICETTA,0)    =NVL(B.NR_RICETTA,0)
      6  AND A.CD_CONT_PRESCR       =B.CD_CONT_PRESCR
      7  AND A.NR_PROG_INT  =B.NR_PROG_INT
      8  AND A.DESTINAZIONE =B.DESTINAZIONE)
      9  /
    
    COUNT(ID_AMBS)
    --------------
                61
    
    Elapsed: 00:00:00.01
    

    If you want to insert the duplicate ID in a Table of errors, do an insert with the following select statement.

    INSERT INTO errori_work(cd_errore, note, ID_AMBS)
    SELECT 'CAC', 'Record ripetuto nella tabella Work',ID_AMBS FROM WORK A
    WHERE A.ROWID > ANY (SELECT B.ROWID FROM WORK B
    WHERE A.CD_PRESIDIO     =B.CD_PRESIDIO
    AND A.GGMM_CONTATTO     =B.GGMM_CONTATTO
    AND NVL(A.NR_RICETTA,0)     =NVL(B.NR_RICETTA,0)
    AND A.CD_CONT_PRESCR     =B.CD_CONT_PRESCR
    AND A.NR_PROG_INT     =B.NR_PROG_INT
    AND A.DESTINAZIONE     =B.DESTINAZIONE);
    

    Hope that solves your problem.

    See you soon!

  • Managed pilot throws ORA-01483 or ORA-01461 when inserting the CLOB

    I think I found a bug in the driver managed to ODAC 12 c Release 3 (12.1.0.2.1). It is similar to that examined in problem with Managed ODP.NET driver update nclob raises ORA-01483, but also happens with shorter CLOB. Maye added challenge is therefore necessary.

    I'm trying to insert two strings to the CLOB columns in addition to the other columns. Although I try to insert the same data, a different error is thrown depending on the order of the parameters.

    If I first bind the shorter string, the error is:

    ORA-01483: invalid length for the DATE or NUMBER variable binding

    If I bind the longer string first, the error is:

    ORA-01461: can bind to a LONG value only for insert into a LONG column

    Please see the archive attached to a solution of the sample that reproduces the two errors.

    The system environment:

    • The driver is fully managed from ODAC 12 c Release 3 (12.1.0.2.1) - the pilot who requires that the instant client does not show this problem.
    • .NET framework 4.5.2
    • Windows 7 SP1 x 64
    • Server: 11.2.0.4.0 running on Windows Server 2008 R2 x 64

    Unfortunately, this errors occur quite often in my application and prevent me to move to the managed pilot, so a bug in output or workaround would be greatly appreciated.

    Hello

    As I wrote above, 20361140 patch resolves the issue.

    Patch 20684004 (DB Windows Bundle Patch 12.1. 0.2.4) and hotfix 20684157 (Windows Bundle Patch 12.1.0.2.5 DB) does not contain the fix. They do not contain an updated ODP.NET file.

    The right patch 21020286 (DB Windows Bundle Patch 12.1. 0.2.6) once again does not contain the fix. This is the latest version of ODP.NET I know. His version of product is 4.121.2. 20150515

    I would also like to see a NuGet package update. Handling everything patches manually, it is really a pain.

    Edit: as written below, an updated NuGet package was released. There the 12.1.22 version

  • Help with the exception of Pl/SQL 'ora-3150 end of file on the communication channel.

    Hello.

    The code attached to this post opens a slider that load of 99 dblinks from different remote databases of different version.

    He captures the information from these databases and stores them locally on a central database (11.2.0.4.0 version) on different tables.

    The problem I have is that when a database is deleted, the dblink to this database show me the error 'ora-3150 end of file on communication channel' and that's right.

    But he's not going trough the exception that I created, the cursor is closed and does not continue with the cycle.

    The exception I created insert data on DBMONITOR error. DBMONITOR_LOG_ERROR_TABLE in order to catch the error (you'll be able to see all the code on the attachment)

    It's the exception:

    exception

    while others then

    INSERT IN DBMONITOR. DBMONITOR_LOG_ERROR_TABLE (NOMBRE_DBLINK, message, info, FECHA_ERROR, TIPO_PROCEDURE) VALUES (var, SUBSTR (DBMS_UTILITY. (FORMAT_ERROR_STACK, 1, 200), "CONNECTION ERROR", SYSDATE, 'CAPACITY');

    commit;

    end;

    Could help me please on how could intercept this exception?

    Thank you.

    Juan.

    You might have a problem with your connection or mishandling. The end of the file ora-3150, on channel of communication error means that there is a connection, but this link was broken somehow.

    If a database is not reachable, you should get other types of errors.

    For example judgment of the Kingdom or tns - memory could not resolve alias or simliar things.

    Here is a list of typical mistakes I have check and manage when accessing remote databases.

      e_db_link_broken EXCEPTION;  --ORA-02019 connection description for remote database not found
      PRAGMA EXCEPTION_INIT (e_db_link_broken, -02019);
      e_oracle_not_available EXCEPTION;  --ORA-01034 ORACLE not available
      PRAGMA EXCEPTION_INIT (e_oracle_not_available, -01034);
      e_oracle_down EXCEPTION;  --ORA-27101: shared memory realm does not exist
      PRAGMA EXCEPTION_INIT (e_oracle_down, -27101);
      e_no_listener EXCEPTION;  --ORA-12541: TNS:no listener
      PRAGMA EXCEPTION_INIT (e_no_listener, -12541);
      e_no_service EXCEPTION;  --ORA-12514: TNS:listener does not currently know of service requested in connect descriptor
      PRAGMA EXCEPTION_INIT (e_no_service, -12514);
      e_timeout EXCEPTION;  --ORA-12170: TNS:Connect timeout occurred
      PRAGMA EXCEPTION_INIT (e_timeout, -12170);
    

    If you have a long open session and fail to close the db links after recovered information from the remote site?

    In addition, I propose to change your dynamic insertion in a normal insert.

    First extract the data of the DB link dynamically, but just with a select statement. Then do the insertion with the result data.

    Improve your logging table to store messages up to 4000 char CHARACTER. 200 is really small for error messages.

    In addition to the DBMS_UTILITY. FORMAT_ERROR_STACK you must also connect DBMS_UTILITY. FORMAT_ERROR_BACKTRACE. Just to see if you get a better message there.

    WHEN e_db_link_broken or e_oracle_not_available or e_oracle_down or e_no_listener or e_no_service or e_timeout THEN
       INSERT INTO DBMONITOR.DBMONITOR_LOG_ERROR_TABLE (NOMBRE_DBLINK, message, info,FECHA_ERROR,TIPO_PROCEDURE) VALUES(var, 'Remote DB not accessible','ERROR DE CONEXION',SYSDATE,'CAPACITY');
                   -- commit;
    WHEN OTHERS THEN
    
                    INSERT INTO DBMONITOR.DBMONITOR_LOG_ERROR_TABLE (NOMBRE_DBLINK, message, info,FECHA_ERROR,TIPO_PROCEDURE) VALUES(var, SUBSTR(DBMS_UTILITY.FORMAT_ERROR_STACK||DBMS_UTILITY.FORMAT_ERROR_BACKTRACE, 1, 4000),'ERROR DE CONEXION',SYSDATE,'CAPACITY');
                    --commit;
                    end;
    
  • Application Builder (Bug) - change the comment area is ORA-01461

    When I change a region and saving it with a long comment (5366 characters) iam getting this error

    Fehler beim use von line.
    ORA-01461: Ein LONG-Wert kann nur zur Einfugung in eine LONG-column paperback werden

    We use the Application Express 4.1.0.00.32 in this specific project.

    On apex.oracle.com in Version Application Express 4.2.0.00.27 that this error also occurs.

    Hi Oliver,.

    Comment attributes normally only record up to 4000 characters. I will file a bug to limit text box to 4000 characters.

    Concerning
    Patrick
    -----------
    My Blog: http://www.inside-oracle-apex.com
    APEX Plug-Ins: http://apex.oracle.com/plugins
    Twitter: http://www.twitter.com/patrickwolf

  • FRM-40735: trigger for INSERTION after raised unhandled exception ORA-25207

    Hello
    I am trying to create custom applications. In that when creating custom responsibility I get the following error
    FRM-40735: trigger for INSERTION after raised unhandled exception ORA-25207

    I know ORA-25207 is related to the activation of the queues, but how do I find out which queue this error is ponting at.

    File alertlog Checked, $APPLCSF / $APPLLOG found nothing.

    Any help is appreciated

    Concerning
    Taher

    PL see if the steps described in MOS Doc 211095.1 (11, 5 - AP: Frm-40735: trigger of sur-Commit not triggered managed Ora - 25207 Exception on APXPAWKB) can help.

    It is an odd error and should not occur when you create custom responsibilities. You have customizations/triggers/customizations enabled on the form of accountability?

    HTH
    Srini

  • While the BLOB conversion of type CLOB error - ORA-06502: PL/SQL: digital error or value

    Passing data from attachment of DB (Blob data Type) after the CLOB data type conversion, giving the error "ORA-06502: PL/SQL: digital error or value" in the PL/SQL package. If the BLOB size 32K > it will give another error works great my procedure.

    For example, I enclose my code here.

    function get_base64 (p_blob_in in blob) return clob is

    CLOB v_clob;

    CLOB v_result;

    whole v_offset;

    v_chunk_size PLS_INTEGER: = 12288;

    v_buffer_varchar varchar2 (32767).

    v_buffer_raw raw (32767).

    Start

    fnd_file.put_line (fnd_file.log, 'here');

    If p_blob_in is null then

    Returns a null value.

    end if;

    DBMS_LOB.CREATETEMPORARY (v_clob, true);

    fnd_file.put_line (fnd_file.log, 'here1');

    v_offset: = 1;

    fnd_file.put_line (fnd_file.log, 'Loop value'-| ceil (DBMS_LOB.) GetLength (p_blob_in) / v_chunk_size));

    because me in 1... ceil (DBMS_LOB. GetLength (p_blob_in) / v_chunk_size) loop

    DBMS_LOB. Read (p_blob_in, v_chunk_size, v_offset, v_buffer_raw);

    v_buffer_raw: = utl_encode.base64_encode (v_buffer_raw);

    v_buffer_varchar: = utl_raw.cast_to_varchar2 (v_buffer_raw);

    DBMS_LOB. WriteAppend (v_clob, length (v_buffer_varchar), v_buffer_varchar);

    v_offset: = v_offset + v_chunk_size;

    end loop;

    fnd_file.put_line (fnd_file.log, 'Out of the loop');

    v_result: = v_clob;

    fnd_file.put_line (fnd_file.log, 'V_result length' - |) DBMS_LOB. GetLength (v_result));

    fnd_file.put_line (fnd_file.log, 'V_result' - | v_result);

    DBMS_LOB.freeTemporary (v_clob);

    Return v_result;

    exception

    while others then

    fnd_file.put_line (fnd_file.log, 'Error based on the encode_base64' - |) SQLERRM);

    Returns a null value.

    end;

    In my main program I call this function as below:

    Main proceedings...

    l_return_clob CLOB.

    Begin

    ....

    l_return_clob: = get_base64 (p_blob_in);

    -In returning it gives error - ORA-06502: PL/SQL: digital error or value

    end;

    Then, please mark the thread ANSWERED.

  • ORA-06503: PL/SQL: function returned no value ORA-06512:

    Hi all

    SQL > set serveroutput on

    SQL > CREATE OR replace FUNCTION qty_value (p_item_id number)

    2 RETURN NUMBER

    3 EAST

    4 v_qty_arrival NUMBER;

    5 BEGIN

    6. SELECT THE CASE SENSITIVE OPTION

    7. WHAT (SUM (b.quantity) - SUM (b.quantity_received)) < = 0 THEN 0

    8 ELSE (SUM (b.quantity) - SUM (b.quantity_received))

    9 END Qty_Arrival

    10 INTO v_qty_arrival

    Po_lines_all 11 a,

    po_line_locations_all 12 b

    13 WHERE a.po_line_id = b.po_line_id

    14 AND a.item_id = p_item_id;

    15 EXCEPTION

    16 THEN THAN OTHERS THEN

    17 v_qty_arrival: = NULL;

    18 RETURN v_qty_arrival;

    19 END qty_value;

    20.

    The function is created.

    SQL >

    SQL > select xxc_qty_arrivale (214960) double

    2.

    Select xxc_qty_arrivale (214960) double

    *

    ERROR on line 1:

    ORA-06503: PL/SQL: function returned no value

    ORA-06512: at the 'APPS '. XXC_QTY_ARRIVALE', line 19

    Back AFTER using the exception block is fine as long as your code actually REACHED the exception block.

    When there are no errors, then your code will not enter the exception block, but you still NEED to return a value, since it is what functions a function wants to return a value, that's what the functions are made for.

    Spot the differences between the following 3 functions. Understand how they work.

    The first function has only a return in the exception block but runs correctly. Result: error, because the back is missing in the code block.

    The second function has a return in the exception block and one in the block of code and runs correctly. Result: no error, because the return is not missing in the code block.

    The third function has a return in the exception block and one in the block of code and is forced into an error. Result: no error, because the return of the exception handler is used (instead of retriggering of the error, which you would normally do).

    SQL > create or replace function myfunc

    2 return number

    3 as

    4 start

    5 dbms_output.put_line ('in the section of code');

    6 null;

    7 exception

    8 then than others

    9. can

    10 dbms_output.put_line (' in the exception handler ' |) SQLERRM);

    11      --

    12 return 0;

    13      --

    14 end;

    15.

    The function is created.

    SQL > select double myfunc;

    Select double myfunc

    *

    ERROR on line 1:

    ORA-06503: PL/SQL: function returned no value

    ORA-06512: at "GHPLUS. MYFUNC", line 14

    In the section of code

    SQL > create or replace function myfunc

    2 return number

    3 as

    4 start

    5 dbms_output.put_line ('in the section of code');

    6 null;

    7    --

    8 return 1;

    9    --

    10 exceptional

    11 so that others

    12. can

    13 dbms_output.put_line (' in the exception handler ' |) SQLERRM);

    14      --

    15 return 0;

    16      --

    end 17;

    18.

    The function is created.

    SQL > select double myfunc;

    MYFUNC

    ----------

    1

    1 selected line.

    In the section of code

    SQL > create or replace function myfunc

    2 return number

    3 as

    n number 4;

    5. start

    6 dbms_output.put_line ('in the section of code');

    7 n: = 1/0; -force an error (zero divisor) to join the exception handler

    8    --

    9 return 1;

    10-

    exception 11

    12 so that others

    13. can

    14 dbms_output.put_line (' in the exception handler ' |) SQLERRM);

    15      --

    16 return 0;

    17      --

    18 end;

    19.

    The function is created.

    SQL > select double myfunc;

    MYFUNC

    ----------

    0

    1 selected line.

    In the section of code

    In the handler for exception ORA-01476: divisor is equal to zero

    SQL >

  • call a function inside a function to insert into a table and receiver error - ORA-14551: cannot perform a DML operation within a query.

    Hi all

    your help is greatly appreciated...

    Calling B.fucntion inside an A.fonctions to insert data into a table.


    Here when you call the B.fucntion to insert data in the table... receiver AM a mistake

    Omitted in B - SQL Error: ORA-14551: cannot perform a DML operation inside a query...


    Can someone please help me to clarify this...


    The FUNCTION A(varUPD_TYPE IN VARCHAR2) RETURN VARCHAR2 IS
    varRETURN_VALUE VARCHAR2 (25): = NULL;

    numALLOWED_COUNT PROD. PROCESS_COUNTER. TYPE % ALLOWED_COUNT;
    numLAST_COUNT_ADDED PROD. PROCESS_COUNTER. TYPE % LAST_COUNT_ADDED;
    dtCHANGE_DATE DATE: = NULL;
    varSTMT VARCHAR2 (2000);
    bln_Allowed BOOLEAN;
    myVar VARCHAR2 (32767).


    BEGIN

    IF varUPD_TYPE = "A" THEN

    BEGIN
    SELECT CH_DATE, LAST_COUNT_ADDED, ALLOWED_COUNT
    IN dtCH_DATE, numLAST_COUNT_ADDED, numALLOWED_COUNT
    PROD. PROCESS_COUNTER
    WHERE NOM_PROCESSUS = "DAILY".
    AND COUNTER_IND = A '

    IF dtCH_DATE < = trunc (sysdate) THEN
    numLAST_COUNT_ADDED: = 0;
    END IF;

    EXCEPTION
    WHILE OTHERS THEN
    numLAST_COUNT_ADDED: = 0;
    numALLOWED_COUNT: = 1;
    END;
    IF numALLOWED_COUNT > = numLAST_COUNT_ADDED + 1 THEN

    bln_Allowed: = True;

    varSTMT: = "UPDATE PROD. TMS_PROCESS_COUNTER ';
    varSTMT: = varSTMT | ' SET last_count_added = ' | (numLAST_COUNT_ADDED + 1);
    varSTMT: = varSTMT | "WHERE nom_processus =" DAILY "';
    varSTMT: = varSTMT | "AND COUNTER_IND ="D"';


    IF varSTMT IS NOT NULL
    THEN
    MyVar: = B(96,varSTMT);
    PROC_LOG (' CALL B ': myVar);
    IF myvar > 0 THEN
    NULL;
    END IF;
    END IF;
    On the other

    End if;

    END IF;

    EXCEPTION WHEN OTHERS THEN
    PROC_LOG ("A failed '");
    PROC_LOG (' SQL error: ' |) SUBSTR (SQLERRM, 1, 1000));
    RETURNS A NULL VALUE.
    PUT AN END TO;

    The FUNCTION B(numTABLE_ID IN NUMBER, varSQL_STATEMENT IN VARCHAR2) RETURNS NUMBER IS
    varINSERT_BATCH_STMT VARCHAR2 (32767): = NULL;
    varADD_REC_TYPE BATCH_TABLES. TYPE % ADD_REC_TYPE;

    BEGIN

    INSERT INTO BATCH_STATEMENT (ID, TABLE_ID, STATEMENT, QUEUE_SEQUENCE_ID)
    VALUES (Numidian, numTABLE_ID, varSQL_STATEMENT, 1);

    EXCEPTION WHEN OTHERS THEN
    PROC_LOG ('B failed');
    PROC_LOG (' SQL error: ' |) SUBSTR (SQLERRM, 1, 1000));
    RETURNS - 1;
    END B;


    Structure of the Batch_statement table:


    ID Number (15) not null
    number (2) not null table_id
    Statement varchar2 (4000) not null
    Queue_sequence_id number (5) not null


    Why do you do such coding mess full of bad practices.

    Remove the exceptions WHEN OTHERS, you're a turing a mistake in this way, they are bugs and (never) use functions to perform DML.

    Functions are not intended for DML. Period.

  • Question by adding the LOBs-ORA-06502: PL/SQL: digital error or value

    Hello

    I'm using Oracle 11 g.

    I have a requirement in which I need to add LOBs and I must insert the LOB in a table column. I am facing problem when the data exceeds certain limits. My program works like the following:

    (Please note that my program logic is given below, not the exact program)

    DECLARE

    final_html CLOB.
    int_html CLOB.
    v_str VARCHAR2 (32767).

    i the number: = 0;

    BEGIN


    DBMS_LOB.CREATETEMPORARY (lob_loc = > int_html, CACHE = > TRUE, hard = > dbms_lob.) CALL);
    DBMS_LOB.CREATETEMPORARY (lob_loc = > final_html, CACHE = > TRUE, hard = > dbms_lob.) CALL);
    DBMS_LOB. OPEN (int_html, DBMS_LOB. LOB_READWRITE);
    DBMS_LOB. OPEN (final_html, DBMS_LOB. LOB_READWRITE);
    dbms_output. ENABLE (1000000);


    FOR i 1,100 loop

    v_str: = "< b >" |
    "< style td =" "DRESSING: break-word" width = "50" > < font size = "2" > ' | "
    I have | ' < / police > < table > ' |
    "< /tr >";

    DBMS_LOB. WriteAppend (lob_loc = > int_html, amount = > LENGTH (v_str), BUFFER = > v_str);


    END LOOP;
    dbms_output.put_line (' the length of the int_html is :'||) DBMS_LOB. GetLength (int_html));

    dbms_output.put_line (' the int_html :'|| is int_html).

    final_html: = "< html >" | int_html | "< / html > ';
    dbms_output.put_line (' the final_html :'|| is final_html).



    EXCEPTION
    WHILE OTHERS THEN


    dbms_output.put_line(SQLCODE||) e -'|| SQLERRM);
    DBMS_LOB. CLOSE (int_html);
    DBMS_LOB. CLOSE (final_html);
    DBMS_LOB. FREETEMPORARY (int_html);
    DBMS_LOB. FREETEMPORARY (final_html);

    END;


    When the loop is made of lesser value, say FOR example, the loop i IN 1.10, the program works very well, but when the closure is done for values more I'm ' - 6502-ORA-06502: PL/SQL: digital error or value ' error message.

    Please help me solve this problem.

    Thanking you in advance.


    Kind regards
    Sri

    Can you please specify what environment you run this?

    I modified your code as follows

    The code executed successfully until the length has been<= 32767="" i.e="" (="" until="" for="" i="" in="">

    In addition, you must use the function APPEND to concatenate variables clob.

    Please check the maximum size by default for varchar2 or dbms_output in your server since you get the error for just the loop in the range (FOR i IN 1,100).

    And Yes, Siva comments are valid.

    DECLARE

    final_html CLOB.
    int_html CLOB.
    v_str VARCHAR2 (32767).

    i the number: = 0;

    BEGIN

    DBMS_LOB.CREATETEMPORARY (lob_loc-online int_html, CACHE-online TRUE, hard-online dbms_lob. CALL);
    DBMS_LOB.CREATETEMPORARY (lob_loc-online final_html, CACHE-online TRUE, hard-online dbms_lob. CALL);
    DBMS_LOB. OPEN (int_html, DBMS_LOB. LOB_READWRITE);
    DBMS_LOB. OPEN (final_html, DBMS_LOB. LOB_READWRITE);
    dbms_output. ENABLE (1000000);

    FOR i 1.1092 loop

    v_str: = '' ||
    '' ||
    I have | '' ||
    '';

    DBMS_LOB. WriteAppend (lob_loc-int_html, amount => (v_str), BUFFER LENGTH-online v_str online);

    END LOOP;

    dbms_output.put_line (' the length of the int_html is :'||) DBMS_LOB. GetLength (int_html));
    Start
    dbms_output.put_line (' the int_html :'|| is int_html).
    dbms_output.put_line (' the length of the int_html is :'||) DBMS_LOB. GetLength (int_html));
    exception when others then
    dbms_output.put_line(SQLCODE||) e -'|| SQLERRM);
    end;
    /*
    Start
    final_html: = ''|| int_html | »';
    dbms_output.put_line (' the final_html :'|| is final_html).
    exception when others then
    dbms_output.put_line(SQLCODE||) e -'|| SQLERRM);
    end; */

    EXCEPTION
    WHILE OTHERS THEN

    dbms_output.put_line(SQLCODE||) e -'|| SQLERRM);
    DBMS_LOB. CLOSE (int_html);
    DBMS_LOB. CLOSE (final_html);
    DBMS_LOB. FREETEMPORARY (int_html);
    DBMS_LOB. FREETEMPORARY (final_html);

    END;

    Published by: Gurnani houta July 29, 2011 03:11

    Published by: Gurnani houta July 29, 2011 03:14

Maybe you are looking for

  • Code of FaceTime activation condition

    I'm deaf and I'm frustrated by Apple. I am trying to use Facetime on my MacBook, but it keeps saying "you cannot connect to FaceTime on the Mac at this time. To use FaceTime with the Mac, contact the Apple Support and provide the code below. [code re

  • The laptop monitor goes black after the external vga connection screen

    Hey,. I have a Qosmio G50 - 10H, Windows 7 32-bit. After connecting to an external monitor, the internal laptop display becomes almost black. It is possible to see some items on the screen, but it is dark gray to work on. It does not much adjustment

  • CD recovery required for Satellite A110-173

    Goodevening, I'm desperately looking for my laptop recovery cd. (unfortunately lost the original one)Toshiba satellite A110-173 (purchased in 2006)OS: Windows XPLanguage: Dutch The site toshiba.be sent to the Toshiba support site shop online media.Th

  • Window 7

    I have two computers using Vista a 32 and 64-bit; the 32-bit use Vista Buisness and the other a Vista Home PremiunCan I install Window 7 64 bit in my 32-bit computer or do I have to buy (32 and 64-bit Windows 7)

  • DISABLE PS/2 DEVICES IN THE BIOS

    Is it possible to go into the BIOS and disable the PS/2 Ports for keyboard and mouse. I use USB connection for these devices and Device Manager is showing the exclamation points under see hidden devices. I tried uninstalling and deleting, but they ke