Unit test: disassembly of the table or restore the line failed: ORA-06502: PL/SQL: digital error or value: string buffer too small ORA-06512: at line 22

Is any idea available in the process of disassembly of the table or restore the line to line 22?

I see a bunch of discussions on the subject, but no clear solution/answer...

What could be the causes of this error?

I had two process of disassembly on the level now, and one of them had failed with this error. Displacement of the failure of the process of disassembly compared to the level of the suite for the level of performance of test unit solved the error for a while, but after some more dragging the process of disassembly of the table (with about 500 cases) is permanent.

Please advise...

Thank you

Val

Well, had to create a bug officially... I hope this helps...

Bug 19696042 : UNIT TEST: disassembly of THE TABLE or LINE RESTORE failed: ORA-06502: STRING BUFFER TOO SMA

Thank you

Val

Tags: Database

Similar Questions

  • 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

  • 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-06502: PL/SQL: digital error or value: the value of key NULL index table?

    Hello

    Can someone let me know what is the problem the code below and how can we avoid this? I get the error message as below

    ORA-06502: PL/SQL: digital or value error: NULL index key value table

                        v_while_loop := 1;
                        v_delete_char_id := v_tabtype_result_values.FIRST;
                        WHILE v_while_loop <> v_tabtype_result_values.COUNT 
                        LOOP
                            IF check_duplicate_nc_data (v_result_view, 
                                                        v_tabtype_result_values(v_delete_char_id).value,
                                                        v_collection_id,
                                                        v_occurrence,
                                                        v_plan_id,
                                                        v_delete_char_id
                                                        )
                            THEN
                                DBMS_OUTPUT.PUT_LINE(v_delete_char_id);
                                v_tabtype_result_values.DELETE(v_delete_char_id);
                            ELSE
                                DBMS_OUTPUT.PUT_LINE(v_delete_char_id||','||v_tabtype_result_values(v_delete_char_id).id||','
                                                        ||v_tabtype_result_values(v_delete_char_id).value||','
                                                        ||v_tabtype_result_values(v_delete_char_id).validation_flag
                                                        );
                            END IF;
    
                            v_while_loop := v_while_loop + 1;
                            v_delete_char_id := v_tabtype_result_values.NEXT(v_delete_char_id);
                        END LOOP;

    Change:

    WHILE v_while_loop <> v_tabtype_result_values.COUNT 
    

    TO

    WHILE v_while_loop <= v_tabtype_result_values.LAST
    

    SY.

  • Validation of the APEX: ORA-06502: PL/SQL: digital error or value:

    Hello

    I need help for validation. The user set to ' field minutes'(besoin d'un nombre compris entre 0 et 59).

    My solution is to do two commits:

    1 - no number:
    Name: P1_MINUTES
    Type: Regular Expression
    Validation expression 1: P1_MINUTES
    ({Validation expression 2: ^ \d{1,5}(\.\d{1,2})? $

    2. more high level then 59:
    Name: P1_MINUTES
    Type: Function return Boolean
    1 validation expression:
    If: P10_TOT_MINUTEN < 60 then
    Returns true;
    on the other
    Returns false;
    end if;
    Validation expression 2: -.

    2 validation gives this error (for example a = m value):
    ORA-06502: PL/SQL: digital or value error: character number conversion error - the reason is clear m value is not numeric

    How this problem can be solved!

    Condition 2 validation by using a condition of PL/SQL Expression:

    regexp_like(:p1_minutes, '^\d{1,5}(\.\d{1,2})?$')
    
  • ORA-06502: PL/SQL: digital error or the value in the conversion for a long TIME on the CLOB type

    Hello

    I have an EA of RDBMS Oracle 11.2.0.4.

    I ger the following error when I try to convert a data type LONG to type CLOB data thanks to a PL/SQL procedure:

    declare
    v_prefix varchar2 (20): = null;
    v_text_view_clob clob: = null;
    long v_text_view_long: = null;

    cursor c_v
    is
    Select
    a.view_name as view_name
    Of
    USER_VIEWS one;

    Start
    for r_v in c_v
    loop
    Start
    v_text_view_clob: = null;
    v_text_view_long: = null;

    -Do the SQL code of the view
    Select
    a.Text text
    in
    v_text_view_long
    Of
    USER_VIEWS one
    where
    a.view_name = r_v.view_name;

    v_text_view_clob: = v_text_view_long;

    update of ohibo_views one
    set
    a.view_text = v_text_view_clob
    where
    a.view_name = r_v.view_name;
    exception
    while others then
    dbms_output.put_line ('View =' | r_v.view_name |) "kan niet worden geconverteerd!");
    dbms_output.put_line (substr (sqlerrm, 1, 60));
    end;
    end loop;
    -commit;
    exception
    while others then
    lift;
    end;
    /

    I get the error a specific record:

    View = VER_POLISMUTATIES_VW kan niet worden geconverteerd!

    ORA-06502: PL/SQL: digital error or value

    At looked the origina; Value of type LONG and it is indeed a "long" piece of text.

    However, CLOB has a restriction about 4G * db_block_size and LONG 2 G - 1 according to the documentation.

    I should be able with the method above to convert a LONG in CLOB.

    Anyone had a similar situation?

    Thanks in advance for advice how to solve.

    Kind regards

    PS: my apologies, I didn't know which group to post this discussion: database or PL/SQL.

    Good indeed, a link with the right explanation.

    I didn't know that there was such a function.

    Thank you!

    Kind regards

  • Select this OPTION to generate XML data from the table using XMLELEMENT, XMLAGG gives error ORA-19011 string buffer too small

    My select statement fails with the error:


    The ORA-19011 string buffer too small


    The select statement looks like:


    SELECT TO_CLOB)

    XMLELEMENT ("accounts",

    XMLELEMENT ("count",

    XMLATTRIBUTES)

    rownum AS "recordId."

    To_date('20130520','YYYYMMDD') AS "datestarted."

    123456 AS "previousBatchId."

    56789 AS 'previousRecordId '.

    ),

    ....

    .... .

    .....

    XMLFOREST)

    SIG_ROLE AS "SignatoryRole."

    To_char(TRANSFER_DATE,'YYYY-mm-DD') AS "TransferDate."

    NVL(Reason,0) AS 'reason '.

    ) AS the 'transfer '.

    )

    ()) AS CRDTRPT

    OF ANY_TABLE;

    • It looks like I can choose only 4000 characters using the SELECT statement (please, correct me if I'm wrong)

    I'd use the XMLGEN package. But the environment team says no mounted drives in the future with the arrival of the EXADATA.

    NO HARD DRIVE MOUNTED, NO ACCESS TO THE DATABASE DIRECTORIES

    No UTL_FILE

    I need to use the REEL spool the resulting XML data of the SELECT query.

    SQL is a standard in my org, but I can do with a PL/SQL solution also to load data into a table (cannot use a COIL with PL/SQL)

    What I do is:

    1. a column of type CLOB to a xml_report of the loading of the above SELECT query table
    2. Then using SELECT * FROM xml_report to SPOOL the data to a file report.xml

    No need of XMLTYPE data behind. Xml data stream is fine for me.

    In addition, I need to validate the XML file, also using XSD.

    Problem is that the resulting lines of the select query are supposed to be from 15000 to 20000 bytes long.

    Oracle database version: Oracle Database 11g Enterprise Edition Release 11.2.0.3.0 - 64 bit Production

    A Suggestion or a solution to this problem would be appreciated.

    (Sorry for the use of "BOLD", just to make it more readable and highlight the imp points)

    Bravo!

    Rahul

    It looks like I can choose only 4000 characters using the SELECT statement (please, correct me if I'm wrong)

    You use the right method.

    There is an implicit conversion from XMLType to the data type VARCHAR2 as expected by the function TO_CLOB, where the limitation, and the error.

    To serialize XMLType to CLOB, use the XMLSerialize function:

    SELECT XMLSerialize (DOCUMENT

    XMLELEMENT ("accounts",

    ...

    )

    )

    OF ANY_TABLE;

    For the rest of the requirement, I wish you good luck trying to spool the XML correctly.

    You may need to play around with the SET LONG and SET LONGCHUNKSIZE commands to operate.

  • ORA-06502: PL/SQL: digital error: error in the conversion of char to number

    Hello world.

    I have a strange problem here. I'll try to explain better. I work with APEX 4.2 and of Oracle Database 11 g Enterprise Edition Release 11.2.0.3.0 - 64 bit Production.

    Here are my parameters NLS_SESSION_PARAMETER and NLS_DATABASE_PARAMETER: NLS_NUMERIC_CHARACTERS,.


    I have a table with a lot of body numbers, and when I imported a MS Access application data, all fields were imported with the comma as decimal separator.


    Now, I have a form with several fields of number and when I leave a numeric field, a body of numbers of amount total is calculated and automatically filled with a bit of javascript.


    Now the problem: calculating fields (sum) succeeds only when I use the decimal as the delimiter. If I use the comma, I get a NaN value in the total amount field. I managed to convert all commas in points with javascript, so the total amount is calculated.

    When I try to save the record, I get the error: ORA-06502: PL/SQL: digital error: error in the conversion of char to number because I'm trying to save the separator point in my number fields.


    I tried to use REPLACE function to replace the. by one, before winning but does not solve the problem.


    This sounds familiar to anyone?


    Thanks in advance.



    OK, the problem is solved people.

    Somehow, the registration procedure had an influence on another calculation of my form and the error came from this process. So I put a to_number and replace stated in the calculation and all records very well and it shows my total.

  • character string buffer too small error in table form

    Hi people,

    One of my tabular forms suddenly stopped working suddenly after 3 months of work perfectly. Then I ran into debugging and looks like something bad went my LOV like below:
         0.16968     0.00328     ...Execute Statement: begin begin SELECT TIME_DISPLAY D, TIME_RETURN R bulk collect into wwv_flow_utilities.g_display,wwv_flow_utilities.g_value FROM TS_HOURS ORDER BY 2; end; end;     4     
    8
         0.17292     0.03912     ...Execute Statement: begin begin select /*+ cardinality(t 10) */ disp, val bulk collect into wwv_flow_utilities.g_display,wwv_flow_utilities.g_value from table(wwv_flow_utilities.get_temp_lov_data(2)) t order by insert_order, disp; end; end;     4     
    100
         0.21211     0.00224     report error: ORA-06502: PL/SQL: numeric or value error: character string buffer too small
    I have looked around and I saw a few others with the same problems but nothing that has like mine. Could someone please help me to find what is the problem? Thank you.

    I use Apex 4.1.1

    Hello

    the LOVs are displayed as a row okay? I wonder if it's some kind of a problem with the tabular forms?

    Concerning
    André

  • ORA-06502: PL/SQL: digital or value error: character string buffer too small in the functions

    Hi all

    FUNCTION to CREATE or REPLACE fnc_two (p_in_job IN VARCHAR2)

    RETURN VARCHAR2

    AS

    CUR CURSOR

    IS

    SELECT ename

    WCP

    WHERE job = p_in_job;

    v_first_name emp.ename%TYPE;

    BEGIN

    FOR my heart IN rec

    LOOP

    IF v_first_name IS NULL

    THEN

    v_first_name: = rec.ename;

    ON THE OTHER

    v_first_name: = v_first_name | ',' || Rec.Ename;

    END IF;

    END LOOP;

    RETURN v_first_name;

    END;

    SQL > SELECT fnc_two ('CLERK')

    2 FROM dual;

    SELECT fnc_two ('CLERK')

    *

    ERROR on line 1:

    ORA-06502: PL/SQL: digital or value error: character string buffer too small

    ORA-06512: at the 'APPS '. FNC_TWO', line 17

    SQL > select distinct work of emp

    2.

    JOB

    ---------

    CLERK

    SELLER

    PRESIDENT

    MANAGER

    ANALYST

    v_first_name: = v_first_name | ',' || Rec.Ename;

    The above statement is the original error. The value has been assinged to v_first_name is larger than the computer can handle.

    Increase the size of the variable v_first_name to avoid the error example

    v_first_name varchar2 (100);

  • Ideas for work around ORA-06502: character string buffer too small on the interactive report

    Hello

    It comes to Apex 4.2.  We try to create an interactive report.  The report is for something similar at a follow-up time.  We try to concat a comments column as the sum of the hours.  For example,.

    Select TASK_NAME, sum (HOURS), to_char (XMLAGG (XMLELEMENT(E,E.COMMENTS ||) ' : ')). Extract ('//Text ()'). GETSTRINGVAL()) USER_COMMENTS of...

    This query works fine if we seek only to a window of 1 week.  The question that we live, when we expand the scope of the query to include data from 3 months, we hit ORA-06502 interactive report.  If we remove this column from the interactive report, then the report works very well.

    Anyone has any ideas on how we might be able to work around this problem?  I'm guessing we're reached the limit of 32 k on the report.  Ideally, we would show just the last X number of comments and then have a link to show all comments

    Any help would be appreciated

    Thank you

    Mike

    ListAGG raises an ORA-01489 for varchar2 > 4000 bytes

    OP has an ORA - 06502--> IR is running within a limit of 4 k / 32 k.

    quick fix: wrap USER_COMMENTS ListAGG in a substr (..., 1, 4000)

    Longer solution, use a subquery to modify comments based on ROW_NUMBER() (IE after the nth line, change the null)

    with
    -- simulating data
    t as (select task_id, sysdate - lv as date_entered
      ,round(dbms_random.value(1,24)) hours
      , '-*' || lv || '.' || task_id || '*-' as user_comments
    from ( select level as task_id from dual connect by level <=10 ), (select level lv from dual connect by level < 1000)
    ),
    -- modify data
    modified_data as (
      select task_id, hours, date_entered
        ,case
          when row_number() over (partition by task_id order by date_entered desc) < 5
            then user_comments
          else null
         end USER_COMMENTS
        from t)
    select task_id, sum(hours) total_hours,
      listagg( user_comments  ) within group (order by date_entered desc)
      || case when count(*) >= 5 then '! MORE COMMENTS !' else null end
        as user_comments
    from modified_data
    group by task_id;
    
  • Download of the slightest error of file system on mime_header w "digital error or value".

    I am trying to download a pdf (and xls) file from the linux file system by using this procedure. I have a directory defined for "OFFICIAL REPORTS" in Oracle, and I can verify that the file exists in this directory. The length of the queue is returned, but we get an error on the statement of owa_util.mime_header. Here is the procedure:

    CREATE or REPLACE procedure Web_Download (file_in IN VARCHAR2)
    AS
    l_filename BFILE.
    V_LENGTH NUMBER;

    BEGIN

    l_filename: = BFILENAME ("OFFICIAL_REPORTS", file_in);
    V_LENGTH: = DBMS_LOB.getlength (l_filename);

    dbms_output.put_line (' length of file: ' | v_length);
    --
    BEGIN
    -implement the HTTP header-

    -dbms_lob.open (l_filename, dbms_lob.lob_readonly);

    sys. HTP.init;

    OWA_UTIL.mime_header ("application/octet", FALSE);

    sys. HTP.p ("Content-length: ' |") v_length);

    sys. HTP.p (' Content-Disposition: attachment; filename = "" | ") file_in | '"' );

    OWA_UTIL.http_header_close;

    WPG_DOCLOAD.download_file (l_filename);

    exception
    WHEN no_data_found
    THEN
    BEGIN
    dbms_output.put_line (' end of file reached.) Closing file ');
    END;

    WHILE others
    THEN
    dbms_output.put_line (' error num: ' |) SQLCODE. "message: ' |" SUBSTR (SQLERRM, 1, 64));
    dbms_output.put_line (' another error has occurred.) Closing file ');
    -DBMS_LOB. Close (lob_loc);
    END;
    DBMS_LOB. Close (l_filename);

    END web_rs_download;
    /

    When we run the package in Oracle, we get this dbms_output:
    file length: 2819089
    error num:-6502 message: ORA-06502: PL/SQL: digital error or value
    Another error has occurred. Closing file

    In APEX, we see a download dialog box to open or save the file, but the download is 0 (empty) bytes. We checked the network ACLs, we checked the APEX body for print server settings, we are at a loss. Help, please.

    Not sure what your question is, but it works fine for me view the PDF in a page.

    html text area
    -------------
    < object data = "f? p = & APP_ID.: 1: & APP_SESSION. ": APPLICATION_PROCESS = DO_SHO_PDF:P1_FNAME:test.pdf ' type = ' application/pdf' width ="500"height ="500"> alt: < a href =" f? " p = & APP_ID.: 1: & APP_SESSION. : APPLICATION_PROCESS = DO_SHO_PDF:P1_FNAME:test.pdf "> test.pdf < / a > < / object >"

    Anonymous application, pl/sql block: DO_SHO_PDF

    DECLARE
       l_blob    BLOB;
       l_bfile   BFILE;
    BEGIN
       DBMS_LOB.createtemporary (l_blob, TRUE, DBMS_LOB.SESSION);
       --l_bfile := BFILENAME ('MY_DIR', 'test.pdf');
       l_bfile := BFILENAME ('MY_DIR', v('P1_FNAME'));
       DBMS_LOB.fileopen (l_bfile);
       DBMS_LOB.loadfromfile (l_blob, l_bfile, DBMS_LOB.getlength (l_bfile));
       DBMS_LOB.fileclose (l_bfile);
       OWA_UTIL.mime_header ('application/pdf', FALSE);
       HTP.p ('Content-length: ' || DBMS_LOB.getlength (l_blob));
       OWA_UTIL.http_header_close;
       WPG_DOCLOAD.download_file (l_blob);
    EXCEPTION
       WHEN NO_DATA_FOUND
       THEN
          NULL;
    END;
    

    The file download is similar:
    HTP.p (' download the bin file < a href = "f?) p ='|| v ('APP_ID') | » : 20 :'|| v ('SESSION'): ': APPLICATION_PROCESS = DOWNLOAD_FILE:P20_BINFILE :'|| v ('P20_BINFILE'). ("" "> Download < / a > ');

    Anonymous application, pl/sql block: DOWNLOAD_FILE

    pkg_name. SAVE_FILE;

    -- snippet of pkg
       PROCEDURE save_file is
           l_blob    BLOB;
           l_bfile   BFILE;
        BEGIN
             DBMS_LOB.createtemporary (l_blob, TRUE, DBMS_LOB.SESSION);
             l_bfile := BFILENAME (g_tmp_dir, v('P20_BINFILE'));
             DBMS_LOB.fileopen (l_bfile);
             DBMS_LOB.loadfromfile (l_blob, l_bfile, DBMS_LOB.getlength (l_bfile));
             DBMS_LOB.fileclose (l_bfile);
             owa_util.mime_header('application/octet', False);
             HTP.p ('Content-length: ' || DBMS_LOB.getlength (l_blob));
             htp.p('Content-Disposition: attachment; filename="'||v('P20_DISPLAYNAME')||'"');
             OWA_UTIL.http_header_close;
             WPG_DOCLOAD.download_file (l_blob);
        exception
          when others then htp.p(SQLERRM);
        END;
    

    Published by: maceyah on March 9, 2012 15:03

  • Unit Testing Unit Test Framework when the expected production is just a table of NaNs to report a fake PASS

    It is a cross-post of the Unit Testing Group:

    https://decibel.NI.com/content/message/121915#121915

    I remember having this problem with the old version of the unit testing framework, but alas, it is still present in the new version.

    To do this, I use LabVIEW 2015.

    A customer contacted ask me what to do, because the expected output was table of NaNs and the VI under test returns an array of numbers and yet, the test was passing!

    My suggestion to use as a solution was to create a defined trial user who would test for the table of NaNs. I was wondering if someone here had found this problem and if you have further suggestions other than user defined Test.

    Until someone suggests we turn to JKI VI tester for this project, I can tell you that we use UTF and tester of JKI VI not because the client is in a regulated industry.

    A video describing the problem and the workaround (via user defined Tests) is here: https://youtu.be/AoBe-Gw2Nzo

    Question: Is using a user defined Test is the best approach? We missing something in the way that the Unit Test is defined which translates the fake of the Test infrastructure Unit reports that the test successful?

    Thank you

    Fab

    Hey Fab,

    I was able to reproduce the problem on my machine and I have observed the same results. What I see in the video, it looks that you are setting the unit test. I think that this is a bug rather than your test configuration, so I presented a report on this issue will have to be reviewed by the R & D.

    Go ahead, I agree that a user defined Test is the best solution in this case. If it meets the needs of your clients, I recommend you take this option.

  • Unit test: calculation of the length of the different columns in recordsets provided and received led to false a test failure

    Dear team of SQL Developer,

    It seems that the calculation of the length of the column in the expected and received recordsets behaves differently in some cases (when stored proc variables are used in the generation of the REF CURSOR, despite the explicit definition of the type of record): the length of the header and the length of the value in the set of records received are truncated to arbitrary length based on the returned value which leads to a false failure of a unit test. I.e. registries are the same in both sets of records, but the test run fails to the comparison of the recordsets because of different length. Please see the screenshot below:

    Expected_and_Received_RecordSets.jpg

    Here's the test case if you need to reproduce the problem/bug in your environment:

    1. use the default schema of HR of the Oracle examples package that comes with an 11 g database.

    2. change the HR. Table EMPLOYEES with the addition of a new column VARCHAR2 (4000) LONG_LAST_NAME:

    ALTER TABLE HR. EMPLOYEES

    ADD (LONG_LAST_NAME VARCHAR2 (4000));

    Update hr.employees set long_last_name = last_name;

    commit;

    3. create a PKG_TEST2 package with the source code below in the HR schema:

    ----------------------------------------------------------------------------------------------------------------------

    create or replace PACKAGE PKG_TEST2 AS

    TYPE EmployeeInfoRec IS RECORD

    (

    long_last_name employees.long_last_name%TYPE,

    first name employees.first_name%TYPE,

    E-mail employees.email%TYPE

    );

    TYPE EmployeeInfoRecCur IS REF CURSOR RETURN EmployeeInfoRec;

    FUNCTION getEmployeeInfo (p_Emp_Id employees.employee_id%TYPE)

    RETURN EmployeeInfoRecCur;

    END PKG_TEST2;

    ----------------------------------------------------------------------------------------------------------------------

    CREATE OR REPLACE PACKAGE BODY PKG_TEST2 AS

    FUNCTION getEmployeeInfo (p_Emp_Id employees.employee_id%TYPE)

    RETURN EmployeeInfoRecCur AS

    v_EmployeeInfoRecCur EmployeeInfoRecCur;

    v_LongLastName varchar2 (4000);

    BEGIN

    Select long_last_name from v_LongLastName

    employees

    where employee_id = p_Emp_Id;

    --

    OPEN FOR V_EmployeeInfoRecCur

    V_LongLastName SELECT long_last_name,

    first name,

    E-mail

    This_is_very_long_table_alias employees

    WHERE employee_id = p_Emp_Id

    order by 1 CSA;

    --

    RETURN v_EmployeeInfoRecCur;

    EXCEPTION

    WHILE OTHERS THEN

    LIFT;

    END getEmployeeInfo;

    END PKG_TEST2;


    ----------------------------------------------------------------------------------------------------------------------

    4. create a unit test for the PKG_TEST2.getEmployeeInfo stored procedure: (click the command create Test, select the stored procedure, click Ok for the pop-up message, click Next, click Finish).

    5. update the default value of dynamic query of value with the one below and save/post changes.

    Select the cursor)

    SELECT long_last_name,

    first name,

    E-mail

    Employees

    WHERE employee_id = idqry.employee_id

    order of the 1 CAD

    ) RETURNS $,.

    idqry.employee_id as P_EMP_ID

    from (select employee_id

    employees

    where rownum < = 5) idqry

    6. run the unit test newly created in the debug mode to display the shot.

    Thus, the record type 'EmployeeInfoRec' in the package clearly defines the LONG_LAST_NAME as VARCHAR2 (4000) through reference for the data type of column in the referenced table.

    But for some reason, the SQL Developer does not calculate correctly its length in the recordset "Receipts" If a variable is used (could be one as variable simple varchar2 in this reproducible test or complex variable of type of the object).

    Any ideas on that? Looks like another bug...

    Thank you

    Val

    The bug has been reproduced by the SRB and documented within the system of Support of Oracle SQL Developer team to pick it up:

    Bug 19943948 - TEST UNIT RETURNS EXPECTED ERROR: [LONG_LAST_NAME

    Hope the bug name can later be changed to something more descriptive, but it is not really... my only concern is the speed at which the known bugs would be fixed...

    Thank you

    Val

  • Error-200609 occurred in the DAQmx write: selected buffer too small

    Hello, I write a few VI simple test that I will build finally to call external analogue output VI. I started with a very simple program to produce samples finished using the clock on board with DAQmx Timing.VI. When I run the program, I almost immediately get an error. The error message is below.

    Error-200609 occurred at writing DAQmx (Analog DBL 1Chan 1Samp) .vi:1

    Possible reasons:

    Generation cannot be started because the size of the selected buffer is too small.

    Increase the size of the buffer.

    Contradictory property
    Property: Output.BufSize
    Corresponding value: 1
    Minimum supported value: 2

    Task name: _unnamedTask<1C>

    I used the VI DAQmx before in similar applications and never encountered this error. In addition, I read the link below which DAQmx Timing.VI should automatically generate the buffer. Any ideas what could be the cause?

    Data sheet:

    Windows 7

    LabVIEW 2012

    PCIe-6353 as DAQ card

    Here is a picture of my diagram and the VI is attached.

    Oops. Just realized my very stupid mistake: I forgot to add the VI of task start. I did and it works as expected.

Maybe you are looking for

  • White tabs of Firefox 31.0, then no fields to twitter and Google maps!

    I'm on Firefox beta update, 30 and 31 now view files for a millisecond and then white - so far making google maps and twitter unusable (both great on Safari and Chrome). Firefox itsself blanks to tabs if I hit an arrow key < or > in the toolbar. Rend

  • Where can I buy HP Mini SAS 4i adapter cable?

    Specifically, the cable NQ097AA? Is there a part 3 equivalients? I have a LSI 9260-4i and blindmate Sata cables in my HpZ800.

  • HP Officejet Pro 8610: Blue/gray violet and pink print

    I've been printing for centuries with new cartridges and now all of a sudden the printer prints my blue/black purple and pink when I print in color.  Only one scale or gray black is always very good.  Help, please.

  • BOM of MyRIO Starter kit, Kit and Kit car Mechatronics

    Here can someone let me know where I can get a list of parts/components included in the kits of myRIO for dish, Mechateonics and Embedded? Thanks in advance!

  • photo Photosmart 7510 xl ink

    I am ordering new ink for my Photosmart 7510.  I've had the printer for about 18 months.  I just noticed on the website of the Office depot HP did a black XL Photo as well as the ordinary XL Black.  I usually use the regular size photo black.  Black