30EA2 - UNIT TESTING - value dynamic query truncating dates time.

So I use the installation of SQL Developer Unit Testing (very nice by the by) for a bit now and just recently upgraded to the latest beta version (3.0.02.83). Looks like a bug has been introduced by which the dynamic query of value are truncate all time of all DATE data type information.

This causes sadness serious for my current test cases and for me since I have to go back to the previous beta version :)

I noticed that, in the new 30EA2 parameter:

AddVMOption - Doracle.jdbc.mapDateToTimestamp = false

has been introduced by default in

[SQLDEveloper_install_dir]/sqldeveloper/bin/sqldeveloper.conf

Perhaps it has something to do with the behavior of incorrect date, try to remove the parameter and check again.

Tags: Database

Similar Questions

  • SQL query for date/time

    Hi all

    I have a table that contains data like this


    Person_name Time_spent Date/time
    5.5 ABC 16-seven.-10 12:00
    ABC 3 16 - seven.-10 05:30
    ABC 2.5 17-seven.-10 12:00
    ABC.5 16 - seven.-10 09:00

    What I want is to get data like this

    Person_name Time_spent Date/time
    ABC 9 16 - seven.-10
    ABC 2.5 17-seven.-10

    which application should I run?
    Thanx
    OMy

    a query like this...

    Select sum (time_spent), person_name, trunc (date_time) of
    Person_name group, trunc (date_time);

    HTH.

  • Query by date & time

    Hello
    I'm inserting line in the remote table using the link to the DB. date is one of the column in the remote table. I'm inserting date as sysdate in the remote table.

    For example:
    insert into a values (sysdate) remote_table;

    But some times hours and seconds are missing from the remote table. Its stored as in bold below (2nd and 3rd rows in below)

    create_dt
    25/06/2010-12:47:34 AM
    * 06-25-2010 *.
    * 06-25-2010 *.
    25/06/2010-12:49:34 AM

    can someone let me know the reason of it?

    Thank you
    Khaldi

    Aye, and what that means is your application does not store the time part or time happens at midnight.

    If this is the first, it's a problem with your application, if it is the latter, it is not a problem.

  • Unit test: is there a way to make the dynamic query of the value of running after the boot process?

    I wonder why the dynamic value query is executed before the boot process? Logically, it makes sense to run after them.

    For example, I test a stored procedure that is supposed to delete a record, and I'd like to create this test report should be deleted as part of the startup process before execution of the stored procedure call to delete this test record. Apparently the dynamic query of value not returns not the test report in as long as the query parameter to call the stored procedure under test, which makes me think that is executed before the startup process of design...

    Please advise...

    Thank you

    Val

    As this thread does no traction/attention of the team of SQL Developer for a while, I had to submit a request for formal improvement on metalink:

    RE: 19834977 - IN THE UNIT TEST REQUEST TO ALLOW TO CHANGE THE ORDER OF EXECUTION OF THE START OF THE PROCESS

    Thank you

    Val

  • SQL Developer 3.0 EA 1 Advanced support for the type of data in the unit tests

    Hello

    According to SQL Developer 3.0 EA 1 New Feature List (http://www.oracle.com/technetwork/developer-tools/sql-developer/rel3-featurelist-ea1-166831.html#ut)
    the EA 1 version 3.0 supported advanced data types in the unit tests. This means support the ANYDATA and RECORD types? I installed version 3.0 of EA 1 to CentOS linux, but it seems that those advanced types are not supported yet. When I try to add a unit test for a function that returns the record type, I get quick error: "the return of PL/SQL RECORD type is not supported. Cannot test (function_name) because 1 arguments have not supported for types". Also if I try to unit test procedure which parameter is of type ANYDATA, I get quick error: "the type UNDEFINED P_DATA argument is not supported. Cannot test (procedure_name) because 1 arguments have not supported for types". Are those advanced data types supported in SQL Developer 3.0 FINAL version?

    Thank you
    Miikka L

    Edited by: user12844253 the 27.10.2010 16:31

    Hi Mikka,

    Only simple PL/SQL records are currently supported i.e. those containing no optional or repeating components and where all components are themselves supported. This restriction is in place, due to the fact that we are using JDBC as a parameter mechanism which does not directly support the passage the PL/SQL record type.

    ANYTYPE and ANYDATA are currently not supported because they have a dynamic value type and must be set programmatically. In the future, it would be possible to support these via the dynamic value and and validation features.

    This will remain for the final version.

    Kind regards
    Richard

  • dynamic query send multiple values dynamically

    Hi all

    I'm trying to run a dynamic query. Is it possible to send dynamically deptno and ename?

    declare
    v_sql varchar2 (4000);
    v_resultCol varchar2 (100): = 'ename ';
    v_col varchar2 (100): = "deptno";
    number of v_num: = 30;
    number of v_count;
    Start
    -v_sql: = 'select'. : v_resultCol |' from emp where ' | : v_col | '= '|| : v_num;

    v_sql: = ' select count (ename) from emp where deptno =: a ';

    run immediately v_sql in v_count using v_num;
    dbms_output.put_line (v_count);
    end;
    /

    Thank you

    You can not choose a column dynamically by passing as a bind value because the binding for the name of the column would be simply considered as a string, in this case a count of the a non-empty string would be the same as count (*), a separate of a non-empty string account would be 1, and an empty string County 0 , which is not a lot get you if you try to count the number of records with non-null to a column values.

    As a dynamically selected column you must can dynamicaly would build the SQL, but opens you up to SQL Injection attacks:

    DECLARE
      v_col varchar2(100) := 'null)+max((select empno from emp where ename=''CLARK'')';
      v_sql VARCHAR2(4000);
      v_count number;
    begin
      v_sql := 'select count('||v_col||') from emp where deptno = :a';
      execute immediate v_sql into v_count using 30;
      dbms_output.put_line(v_count);
    end;
    /
    

    a better approach would be to first make sure that the value of v_col is actually a column in the table:

    DECLARE
      v_col varchar2(100) := 'null)+max((select empno from emp where ename=''CLARK'')';
      v_sql VARCHAR2(4000);
      v_count number;
    begin
      begin
        select column_name into v_col from all_tab_cols
         where owner = 'SCOTT' and table_name='EMP' and column_name = v_col;
      exception when NO_DATA_FOUND then
        v_col := '*';
      end;
      v_sql := 'select count('||v_col||') from scott.emp where deptno = :a';
      execute immediate v_sql into v_count using 30;
      dbms_output.put_line(v_count);
    end;
    / 
    

    Use a box or decode statement in your selection to determine which column to use based on a variable binding:

    DECLARE
      v_col varchar2(100) := 'COMM';
      v_sql VARCHAR2(4000);
      v_count number;
    begin
      v_sql := 'select count(case :col_name '||
                            'when ''ENAME'' then ename '||
                            'when ''COMM'' then to_char(COMM) '||
                            'end) '||
                 'from scott.emp where deptno = :a';
      execute immediate v_sql into v_count using v_col, 30;
      dbms_output.put_line(v_count);
    end;
    /
    

    Published by: Sentinel on October 16, 2008 14:48

  • 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

  • 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

  • Unit test: behavior another header in recordsets provided and received led to false a test failure

    Dear team of SQL Developer,

    It seems that the headers in the expected and received Recordset behaves differently: the headers of expression in the expected Recordset are truncated to 30 characters and the same expression in the set of records received headers are not truncated, which leads to a false failure of a unit test. That is that the records are the same in both sets of records, but the test run fails to comparison of sets of records due to the different headings. Please see the screenshot below:

    Expected_and_Received_Headers.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 create a PKG_TEST package with the source code below in the HR schema:

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

    create or replace PACKAGE PKG_TEST AS

    TYPE EmployeeInfoRec IS RECORD

    (

    employees.last_name%type last_name,

    first name employees.first_name%TYPE,

    E-mail employees.email%TYPE

    );

    TYPE EmployeeInfoRecCur IS REF CURSOR RETURN EmployeeInfoRec;

    FUNCTION upperCaseLastName (p_Last_Name employees.last_name%TYPE)

    RETURN varchar2;

    FUNCTION getEmployeeInfo (p_Emp_Id employees.employee_id%TYPE)

    RETURN EmployeeInfoRecCur;

    END PKG_TEST;

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

    CREATE OR REPLACE PACKAGE BODY PKG_TEST AS

    FUNCTION upperCaseLastName (p_Last_Name employees.last_name%TYPE)

    RETURN varchar2 AS

    BEGIN

    RETURN upper (p_Last_Name);

    END upperCaseLastName;

    FUNCTION getEmployeeInfo (p_Emp_Id employees.employee_id%TYPE)

    RETURN EmployeeInfoRecCur AS

    v_EmployeeInfoRecCur EmployeeInfoRecCur;

    BEGIN

    OPEN FOR V_EmployeeInfoRecCur

    SELECT upperCaseLastName (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_TEST;

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

    3. create a unit test for the PKG_TEST.getEmployeeInfo stored procedure: (click the command create test, select the stored procedure, click Ok for the pop-up message, click Finish).

    4. update the default value with the following dynamic query and save the changes.

    Select the cursor)

    SELECT pkg_test.upperCaseLastName (last_name),

    first name,

    E-mail

    This_is_very_long_table_alias 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

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

    The work around is to use an alias for the expression of long short, but our code is in Production, and we do not a new version whenever soon to add aliases... but we plan to use SQL Developer to automate our unit of PL/SQL code, tests once we clearly have some of the problems with the tool, we know...

    Please advise...

    Thank you

    Val

    Of course, Jeff... CS it logged as a bug... could be changed to apply for development later, I guess...

    BUG 19826375 - header BEHAVIOR IN the GAMES of RECORDS EXPECTED/RECEIVED LED to the ERROR

    Thank you

    Val

  • Developer SQL 3 EA1: Unit Test

    Hello

    I just started to use the work unit test framework in SQL Developer 3 EA 1 and I need assistance, definition of a test case involving parent - child tables that are handled using an API from plsql. The API for the child table requires a registration key in the parent table. The parent record and its key is created by a process of starting test case. The key is retrieved using a query of dynamic value in the implementation of the test. It seems that the dynamic value query is executed before the start of the test case process have been executed. Is this expected behavior? My expectation is that the boot process are executed before the dynamic values query.

    Also, is it possible to use values resulting from processes of startup as the case other than type parameter values by using a dynamic query in value?

    Summary test scenario:

    2 boot process: the first deletes all the data tables parent and the child. The second inserts in a record in the parent table.

    No disassembly process.

    Test implementation: application of dynamic value that selects the key of the parent table and defines literals for the remaining parameters of test cases.

    1 process validation: check if a record has been inserted into the table of childe with expected values.

    Thank you

    Alistair

    Hi Alistair.

    We execute the dynamic query to control how many times the test (start, test cases, validation, demolish) cycle runs.

    To get the behavior you want, put the test in a test suite and test suite start do the initialization of the table for you.

    Brian Jeffries
    SQL development team

  • How to map Dynamic Query columns on variables of forms.

    Dear all,
    This is a correct code for executing a dynamic query and display data.
    In this program that I have defined variables ("BOLD" of police) later I binds these with the query (in the second code "BOLD").

    How I can map a column in the query, in which case I don't know that the surveyed fields type?



    GetData PROCEDURE IS
    EXEC_SQL connection_id. PORT;
    cursorID EXEC_SQL. CURSTYPE;
    sqlstr VARCHAR2 (1000);

    loc_ename VARCHAR2 (30);
    loc_eno NUMBER;
    loc_hiredate DATE;

    nIgn PLS_INTEGER;

    BEGIN
    connection_id: = EXEC_SQL. DEFAULT_CONNECTION;
    cursorID: = EXEC_SQL. OPEN_CURSOR (connection_id);
    --
    -assuming empno is a primary key for the table emp, where clause ensures
    -only 0 or 1 row is returned
    --
    sqlstr: = "select ename, empno, hiredate from emp;
    -sqlstr: = sqlstr. 'where empno =' | input_empno;

    EXEC_SQL. PARSE (connection_id, cursorID, sqlstr, exec_sql. V7);
    -EXEC_SQL. Bind_variable (connection_id, cursorID, ': bn', input_empno);

    EXEC_SQL. DEFINE_COLUMN (connection_id, cursorID, 1 loc_ename, 30);
    EXEC_SQL. DEFINE_COLUMN (connection_id, cursorID, 2, loc_eno);
    EXEC_SQL. DEFINE_COLUMN (connection_id, cursorID, 3, loc_hiredate);

    --
    -do execute_and_fetch after the analysis of the statement and calling bind_variable and
    -If necessary define_column
    --

    nIgn: = EXEC_SQL. EXECUTE_AND_FETCH (connection_id, cursorID);
    IF (nIgn = 0) THEN
    TEXT_IO. Put_line ('not Rec');
    ELSE IF (nIgn = 1) THEN
    TEXT_IO. Put_line ('found an employee');

    END IF;
    --
    -get the values of this line
    --
    WHILE (EXEC_SQL. FETCH_ROWS (connection_id, cursorID) > 0) LOOP
    -nRows: = nRows + 1;
    EXEC_SQL. COLUMN_VALUE (connection_id, cursorID, 1, loc_ename);
    EXEC_SQL. COLUMN_VALUE (connection_id, cursorID, 2, loc_eno);
    EXEC_SQL. COLUMN_VALUE (connection_id, cursorID, 3, loc_hiredate);

    MESSAGE(loc_ename||) e '|| loc_eno | » '|| loc_hiredate);

    END LOOP;
    END IF;
    END;

    If you want to use EXEC_SQL and a dynamic query with unknown data types, but the known table name,
    Then you can declare a rowtype variable
    for example;

     NOT TESTED ---A ROUGH IDEA
    m_emp_row employee_master%rowtype;
    m_col_cnt number := 0;
    So when you define collumn, create a procedure to find the column name and its width if it is varchar2 with respect to the column name .
       Find the column details from the user_tab_columns table ...
    ---------------------------------------------------------------------------------------------------------------------------------------------------
      while m_col_cnt < 3 loop
           m_col_cnt  := m_col_cnt +1;
           proc_find_col_name_width(p_qry ,p_col_no=>m_col_cnt , p_col_name,p_col_width);
    
          If p_col_name = 'EMPCODE' then
             EXEC_SQL.DEFINE_COLUMN(connection_id, cursorID, m_col_cnt , m_emp_row.empcode , p_col_width);
          elsif p_col_name ='EMPNAME' then
             EXEC_SQL.DEFINE_COLUMN(connection_id, cursorID, m_col_cnt , m_emp_row.empname , p_col_width);
           -----
            -------
           end if;
      end loop;
    
    ---------------------------------------------------------------------------------------------------------------------------------------------------
    --Your procedure will look like this
     procedure proc_find_col_name_width(p_qry  varchar2,p_col_no number, p_col_name out varchar2,p_col_width out number) is 
    
     m_col_name varchar2(30);
     Cursor c1 is
     Select  data_length
     from user_tab_columns
     where table_name = 'yr_tab_name'
     and column_name = m_col_name;
     m_lastpos number ;
     m_nxtpos number ;
     Begin
      m_lastpos := instr(p_qry,',',1,p_col_no-1);
      m_nxtpos := instr(p_qry,',',1,p_col_no);
      If m_lastpos = 0 then --- if only one col
         m_col_name := substr(p_qry,instr(upper(P_QRY),'SELECT') + 6, instr(upper(P_QRY),'FROM') -1);
      else
           If m_nxtpos = 0 then ---if last column
                 m_nxtpos := instr(upper(P_QRY),'FROM') -1;
           end if;
    
        m_col_name := substr(p_qry,m_lastpos+1,m_nxtpos);
      End if;
      m_col_name := ltrim(rtrim(m_col_name));
      open c1;
      fetch c1 into p_col_width;
      close c1;
      p_col_name := m_col_name;
    END;
    

    same thing you must apply when retrieving values using exec_sql.column_value
    concerning
    Dora

    Published by: Dora on December 7, 2009 12:20

    Published by: Dora on December 7, 2009 12:20

  • Unit test, Visual Studio 2010 digital input read event

    Hello!

    I have problems in Visual Studio 2010, using NOR-DAQmx, but ONLY in a unit test project. I have compiled a dll that uses a DigitalChangeDetection task handler. The dll work very well in a draft standard form, but does not work in a Test project.

    I used .NET Framework 4.0 with success. Tried to switch to .NET framework 3.5, but it is not possible for a test project in Visual Studio 2010.

    When I start my test, it works fine until the event is raised. Once he does, the test will stop without exception or detail except the following result:

    "The agent process was stopped during the execution of the test."

    Nothing is caught in the trap in debugging.

    Also, I get the following in the Event Viewer error message:

    Log name: Application
    Source: VSTTExecution
    Date: 2010-12-01 11:32:31
    Event ID: 0
    Task category: no
    Level: error
    Keywords: Classic
    User: n/a
    Computer: xxx
    Description:
    The description for event ID 0 in source VSTTExecution is not found. Either the component that triggers this event is not installed on your local computer or the installation is corrupted. You can install or repair the component on the local computer.

    If the event is on another computer, the display information had to be saved with the event.

    The following information has been included in the event:

    (devenv.exe, PID 5592, walk on 73) OutOfProcessStrategy.ProcessMonitorThread: The Agent process was closed unexpectedly. will attempt to restart

    the message resource is present, but the message is not in the string/message table

    The event XML:
    http://schemas.Microsoft.com/win/2004/08/events/event">
     
       
        0
        2
        0
        0 x 80000000000000
       
        10312
        Application
        xxx
       
     

     
        (devenv.exe, PID 5592, walk on 73) OutOfProcessStrategy.ProcessMonitorThread: The Agent process was closed unexpectedly. will attempt to restart
     

    I understand that Visual Studio 2010 is not yet officially supported so here's my 2 questions:

    -I'm the only one experiencing this problem? (Easily duplicated by taking the sample project: DotNET3.5\Digital\Read Values\ReadDigChan_ChangeDetection_Events and extract the relevent part of to put in a separate dll so that you can try to UnitTest in a project UnitTest.)

    -Update on what NOR-DAQmx will rely on VS2010? (I read here: http://forums.ni.com/t5/Measurement-Studio-for-NET/Support-for-Visual-Basic-2010-NET-4-Framework/m-p... this is supposed to be before the end of the year, but no updates would be great because I could not find any information on it)

    Best regards

    Pierre-Luc

    Hello Pierre,.

    As NOR-DAQmx is not yet officially supported in Visual Studio 2010, it is not quite clear why this problem occur. At this point, the official release date has not been announced yet, however, please continue to check the updates to www.ni.com/support (drivers and updates). Thank you

    Best regards

    M Ali

    Technical sales engineer

    National Instruments

    www.NI.com/support

  • APEX 4.2 limiting size of the value dynamic Action

    Hi all, I'm using ApEx 4.2.5 with 11 g BD and stumbled on this problem.

    I'm trying to set the value of a div within an HTML region. To do this, I use one set dynamic Action launched by a custom event "search" when user press enter or click OK to a search bar. I also use the PL/SQL function as set type body.

    I tested it and it works fine except if the content of the value is large enough (about 30,000 characters or more). I can't find any information about a size limitation for the return value of this type of package. I get this error code: ORA-06502 when I'm looking for a big content, and it seems that this error may occur when "you attempted to assign a value to a numeric variable, but the value is greater than the variable can handle", but I'll be back a PL/SQL CLOB variable in a div, so I don't see any kind of limitation. I think the limitation can be in the call made by apex in the background AJAX...

    I need help on this, thanks in advance.

    Gaël

    Hi gados12,

    gados12 wrote:

    OK, I tried something and the result is weird.

    I created a pakaged function to retrieve the right HTML content that is stored in my CLOB column (because I reached the limit of characters for PL / SQL code in dynamic action)

    So I called my function (allows to name it FNC_GET_SEARCH) my previous dynamic Action Set value. I still get the same error with large HTML content. However... it is there, it's weird.

    So that means the error is not my FNC_GET_SEARCH function, but the dynamic Action itself... So there must be some kind of limitation with this kind of dynamic action?
    Is it because the dynamic action to set the value using the package HTP in the background?

    The DA type 'Set Value' is for session state implementation and display the value of an element of page APEX value that is defined internally as VARCHAR2 (4000).

    As a result, you get the above error. Use the approach mentioned above to manage CLOB based rendering html.

    Also of your FNC_GET_SEARCH function for the display unit test error message.

    Kind regards

    Kiran

  • Collection of the dynamic query

    Hi All-

    I'm trying to get the value of the collection through the dynamic query but I am facing some problem please let me know that I hurt.

    Created a function like below to run the dynamic query to select statement

    create or replace FUNCTION rfunGetColumnValue (
                  ColumnName VARCHAR2,
                  TableName  VARCHAR2,
                  DefaultValue OUT VARCHAR2,
                  Criteria VARCHAR2)
           RETURN VARCHAR2
    IS
           ReturnValue VARCHAR2 (32767 byte) ;
           Stmt        VARCHAR2 (32767 byte) ;
    BEGIN
           stmt := 'begin        
    select '|| ColumnName || ' into  :1  from table(:2) ' ||NVL
           ( Criteria, ' ') ||
           '       
    Fetch First Row only ;        
    EXCEPTION                                   
    WHEN OTHERS THEN                                          
    :2 := SQLERRM;
    end;'
           ;
           dbms_output.put_line (stmt) ;
           EXECUTE IMMEDIATE stmt USING OUT ReturnValue, OUT DefaultValue;
           --select Valueinto into Returnvalue from dual;
           RETURN ReturnValue;
    END;
    

    Now, I created a folder in the Package

    create or replace PACKAGE Collection_PKG
    is
    type Bank_rec is RECORD
    (
    SNO           NUMBER(10),    
    BANKID        NUMBER(5),    
    BANKNAME       VARCHAR2(50),    
    BANKSC         VARCHAR2(50),    
    ADDEDIT       varchar2(1),    
    COMPID        number(5),    
    ISBULK        number(1),    
    ROWNO         number(10),    
    ERROR         VARCHAR2(500)  
    );
    
    
    TYPE Bank_tbl IS TABLE OF Bank_rec;
    --type Bank_cur is ref cursor return Bank_rec;
    
    
    end Collection_PKG;
    
    end Collection_PKG;
    end Collec
    tion_PKG;
    

    Now, when I'm Trying the code below

    DECLARE
      V_EXECQUERYPARAM XMLTYPE:= XMLTYPE('<QueryParam>
      <BankXML>
        <Bank>
          <BankID>0</BankID>
          <BankSC><![CDATA[RCB]]></BankSC>
          <BankName><![CDATA[Royal challenger Bank]]></BankName>
          <IsBulk>0</IsBulk>
          <AddEdit>A</AddEdit>
        </Bank>
      </BankXML>
    </QueryParam>');
    BEGIN
     Rspbanksave(
        v_SPParamList => V_EXECQUERYPARAM  );
    
    
    END; 
    

    create or replace PROCEDURE rspBankSave (
                  v_SPParamList XMLTYPE DEFAULT NULL)
    IS
           V_Addedit VARCHAR2 (1 CHAR) ;
           Bank_tbl Collection_PKG.BANK_TBL := Collection_PKG.BANK_TBL () ;
    BEGIN
           
           SELECT Row_number () OVER (ORDER BY 1),
                  XT.BankID,
                  XT.BankName,
                  XT.BankSC,
                  XT.AddEdit,
                  v_CompID,
                  XT.IsBulk,
                  CAST (0 AS NUMBER (5)),
                  CASE
                         WHEN MBank.BankID IS NOT NULL
                         THEN
                                CASE
                                       WHEN XT.BankSC     = MBank.BankSC
                                          AND XT.BankName = MBank.BankName
                                       THEN 'R104|Entry Already Exist,R114|Short Code Already Exist'
                                       WHEN XT.BankSC = MBank.BankSC
                                       THEN 'R114|Short Code Already Exist'
                                       WHEN XT.BankName = MBank.BankName
                                       THEN 'R104|Entry Already Exist'
                                END
                         ELSE NULL
                  END Bulk collect
           INTO   Bank_tbl
           FROM   XMLTABLE ('//QueryParam/BankXML/Bank' PASSING v_SPParamList COLUMNS BankID NUMBER (5)
                  PATH 'BankID', BankName                                                    VARCHAR2 (
                  50) PATH 'BankName', BankSC                                                VARCHAR2 (
                  50) PATH 'BankSC', AddEdit                                                 VARCHAR2 (
                  1) PATH 'AddEdit', IsBulk                                                  NUMBER (1)
                  PATH 'IsBulk') XT
           LEFT JOIN MBank
           ON     XT.BankID   != MBank.BankID
              AND v_CompID     = MBank.CompID
              AND (XT.BankSC   = MBank.BankSC
               OR XT.BankName  = MBank.BankName) ;
           v_TotalRowCount    := SQL%ROWCOUNT;
    
    
    
    
    
    
           IF (v_TotalRowCount > 0) THEN
                  
                         BEGIN
                               V_Addedit:=rfunGetColumnValue (ColumnName=> 'Upper(AddEdit)',TableName=>'table(Bank_tbl)',DefaultValue=>'',Criteria =>'');
                         END;
                         --SQL Code here
                  
           END IF;
           
    END rspBankSave;
    
    
    
    
    
    
    
    

    As I've suggested before:

    To get the name of the table the column

    and as others have:

    Type global temporary Tables vs. table

    If you give more context, more information about the bigger picture, more information about what you're trying to do and why you're going down the road you go down, you can return more useful information. But you seem reluctant to do.

    For the moment, your recent posts seem to just raise the same type of question - why are you doing this?

    The normal way to return data to a client is a refcursor.

    It is the most effective way.

    Not through collections that you seem to be put on the must-do approach.

  • Is there a real BENEFIT in SQL * Developer Automated Unit Testing?

    I'm trying to understand the unit test in SQL * Developer. Asked me to evaluate it as a method of test automation on an integration solution that we develop.

    (1) my 'A' schema has this table:

    SQL > DESC EMP

    Name                                      Null?    Type

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

    EMPID NOT NULL NUMBER

    EMPNAME VARCHAR2 (30)

    SALARY NUMBER (7.2)

    COMM_PCT NUMBER (2.2)

    Table (2). has these values:

    SQL > SELECT * from emps;

    EMPID EMPNAME SALARY COMM_PCT

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

    1 ROHAN 10000.05

    2 JOHN 20000

    3 PETER.06

    4 SMITH

    (3.) I create this procedure in drive A:

    create or replace

    PROCEDURE award_bonus (NUMBER, sales_amt NUMBER p_empid)

    AS

    REAL Commission;

    comm_missing EXCEPTION;

    BEGIN

    SELECT comm_pct IN the commission OF EMP

    WHERE empid = p_empid;

    IF the commission IS NULL THEN

    RAISE comm_missing;

    ON THE OTHER

    PGE UPDATED

    SET salary = salary + sales_amt * commission

    WHERE empid = p_empid;

    END IF;

    END award_bonus;

    (4) now, I want to create a unit test in SQL Developer to test this procedure.

    (5) I created a user "unit_test_repos" according to the instructions in the tutorial.

    (6) ' SELECT OPERATION': I specifies the procedure of award_bonus.

    (7) ' SPECIFY the name of test': give a name and select "create with a single model.

    (8.) 'SPECIFY the STARTUP': Add a ' copy Table or the line "the startup process.

    -I give "EMP" as the source table.

    -And then I get this for the 'generated query.

    SELECT ROWID AS SRC$ ROWID, s.* FROM EMP s

    -Target table has "TMP$ AWARD_BONUS.

    (Q1) WHAT IS THE PURPOSE OF CREATING ANOTHER TABLE?

    (Q2) WHEN THE TEST IS DONE, ARE ROWS OF PGE copied into this table?

    (Q3) Why is this? Why can't the test simply read 'EMP '?

    (9) "PARAMETERS SPECIFY": I give "Input".

    -1 for P_EMPID

    -10000 for SALES_AMT

    -In "Expected result", I say "success."

    (Q4) So I should know in my mind the results of the proc, foregoing given entries?

    (10) ' SPECIFY VALIDATION': I add validation "poll rows of queries.

    -I paste the following query: SELECT count (*) FROM EMP WHERE empid = 1 AND salary = 10500

    -that is, I know that for an amount of 10000 sales, employee 1 will get a Commission of 10000*.05 = 500. For example, 10000 (its sal) + 500 = 10500.

    (Q5) The thought that the above is correct?

    (11) "TEARDOOWN SPECIFY": give nothing.

    (12) my unit test is created.

    (13.) I run now by clicking on the button of the beetle, to the left of the green arrow. Unit test is run.

    (14) now in my table a.emps, 1 salary has increased to 10 500, and the diag test case, I get the "execution results: SUCCEED.

    (15) now, I run the unit test again.

    (16.) salary 'EMP' table emp 1 is passed to 11000 (which is correct) and the so-called execution results "SUCCESS".

    (Q6)  My question is: the query I gave for validation, SELECT count (*) FROM EMP WHERE empid = 1 AND = 10500 salary, now gives 0. so, this means that no row is returned for this condition and so the test must FAIL. But how is SQL * Developer said that the test was SUCCESSFUL. How does this system of validation?

    (17.) I went through the tutorial, but I do not understand these concepts >

    (Q7) What is the purpose of disassembly? I undersand the option 'drop table' "disassembly", where you drop the temporary table, but I do not understand the others, 'Table or line restore' and 'code pl/sql user '?

    (Q8) WHAT IS the advantage of making the test like this? Can I use an Excel spreadsheet and make dozens of unit tests faster than this method?  It is easy to understand too. This method is complicated.

    Your answers and your advice would be greatly appreciated.

    The temporary table to hold the original values for EMP. After the test runs, you must configure the disassembly to reset the return values of the temporary for the next time table that the test works again, he has values of expected start.

Maybe you are looking for

  • Satellite Pro 4600 - appropriate replacement HD

    I'm looking to replace my old Sat Pro 4600 HD anywhere since a 40gig 80gig HD, but I'm confused by GAP and GAX models Toshiba. Is correct any size HD? What is the difference between a GAX and a GAP model? Any brand is suitable. Special recommendation

  • Network problems suddenly with a NASNetwork, troubleshooting

    I have a Synology NAS hung t my Netgear router. It has worked flawlessly so far. I can access the nas via http://192.168.1.8:5000 / index.cgi I can access any of the actions. The NAS IP address is reserved. I can't ping, I can't even ping all machine

  • External HD FCPX ejected 10.1.4 when editing now the project is missing

    Hi, I am using FCPX 10.1.4 OSX 10.11.2 my library is saved on an external hard drive as well as my media. If you change a project my external drive mounted and ejected itself unexpectedly. I got a pop up saying FCPX could not save the project and pre

  • Opening no longer works? ALL the work I've done is lost! Sorting, development, RAW conversion...

    Aperture is no longer supported on OSX Yosemite 10.10.3? I did NOT update my operating system and it used to work properly. Opening requires an update, but it is not available to the Canada? It is actually available anywhere? My Aperture library is s

  • sensor pressure and USB-6210

    I am installing a USB-6210 to read pressure sensors (specifically: http://www.omega.com/pptst/PX309-100mv.html), with labview2013. Its one task relatively simple and should not be this hard... I used a similar system to take similar measures in the p