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:
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,
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,
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
Tags: Database
Similar Questions
-
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:
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
-
Can I use the Wireless Comfort Desktop 5000 keyboard and receiver with a Mobile 4000 mouse?
Hi, as the title says: can I use the Wireless Comfort Desktop 5000 keyboard and receiver with a Mobile 4000 mouse? I have the kit, but the mouse is to bulky for me and I would use a mouse Microsoft Mobile 4000 but with the same receiver as the keyboard of the kit, is it possible? Thank you
Hello
looks at it's not going to work. Wireless products are programmed to be used with a specific key, so they won't work on another dongle.
B Eddie
-
I would like to know how to optimize my Internet settings for the Indian Government Internet service provider and have a safe browsing experience.HelloHow to optimize Internet Explorer: http://support.microsoft.com/kb/936213Hope you will find many answers to your questions in this article: http://windows.microsoft.com/en-US/windows-vista/Why-is-my-Internet-connection-so-slowTo secure your internet connection, install a security software on the computer.
Introduction to security and computer security: http://windows.microsoft.com/en-us/windows7/Understanding-security-and-safe-computingMany internet settings are controlled by the Internet (ISP) Service provider. Therefore, more support on that, you can get in contact with the service provider at any time.I hope this helps.Kind regards
Syed
Answers from Microsoft supports the engineer. -
* Original title: scam or not
I received a call from a woman saying that she was with the ICC with Windows service provider and they received my computer error messages and I wouldn't be able to help me solve it. I asked for a number of 800-373-4609 because he came unknown on my phone.
I wanted to open my computer. I told her I would call her back.
Is it a scam?
(Moved from P & M)
Yes, it's a scam. When someone calls and says they need to talk to you about 'mistakes' in your computer, simply hang up. I just had one of these calls myself about 15 minutes ago.
-
I volunteer for installation of the Government in New Orleans. I'm helping recommendations on equipment and software. Their editing computer cannot be connected to the Internet. How to buy and receive the software and updates?
Please see this link in the topic "successful."
Creative cloud using Enterprise | Applications and updates
You can use managed delivery of applications for the following:
- If you need to exercise strict control over the applications installed on client computers.
- If end-users have administrator privileges on the computer.
- To reduce Internet bandwidth consumption by preventing multiple downloads of self-service.
- If there is no Internet access on client computers.
-
Windows XP / 10g 10.2.0.1.0
Table1 with columns (A, B, C, D)
Table2 with columns (A, C, D, E, F);
How can I get the columns set out as B, E, F < == out put only the different columns, not the data. I would like to only contain output for different column name.
Thank you.SELECT COLUMN_NAME FROM USER_TAB_COLUMNS WHERE TABLE_NAME = "TABLE1".
LESS
SELECT COLUMN_NAME FROM USER_TAB_COLUMNS WHERE TABLE_NAME = "TABLE2".
UNION
SELECT COLUMN_NAME FROM USER_TAB_COLUMNS WHERE TABLE_NAME = "TABLE2".
LESS
SELECT COLUMN_NAME FROM USER_TAB_COLUMNS WHERE TABLE_NAME = "TABLE1".
/ -
Calculation of the OSR in BI applications financial / accounts receivable
Hello
Anyone know how the calculation of the days sales outstanding (DSO) is determined in the financial applications BI module sourcing against Oracle E-Business Suite?
Thank youDSO calculates days exceptional sales - (balance AR / average income for daily publication). The daily average income posted is calculated by posted revenue for the period / number of days in the period.
-
How to make calculations on the grid... salary total and so on?
Hi Experts,
I use the Employee table and I it shows as a grid in the jspx page.
When I add or change the value of the SALARY column, the total salary of the employees in the grid should be updated in the State of the panelcollection...
I just tried to use ValueChangeListener and I am an iteration values and adding the wage and doing other things...
Is it an effective way to do this...?
Please suggest some ideas...
Kind regards
GOPsHello
I guess you can also use groovy
See page 12 of this link. Might be useful
http://www.Oracle.com/technetwork/developer-tools/jdev/introduction-to-Groovy-128837.PDFKind regards
Briant -
When I visit a Web site that requires SSL I displays the message "this connection is untrusted". Any Web site that I visit, it's always exactly the same message and the same SSL certificate that she is no longer valid for www.thawte.com
support.Mozilla.org uses an invalid security certificate.
The certificate is not approved, because no sender string has been provided.
The certificate is valid for www.thawte.com
The certificate expired on 11/11/2011 23:59. The time now is 11:46 28/01/2012.When I click "Add the Exception" on a Web site and view the certificate, it is exactly the same certificate with the exact same serial number.
I had a similar problem with Internet Explorer showing a 404 error when I visited SSL protected pages but to do a restore of the system a month ago to correct this. All other bowsers are / were very good.
I installed Firefox 3.x month last to test something that is when the problem started. I have since uninstalled Firefox 3.x and reinstalled the latest version. I deleted all the preferences/settings, disabled modules and reinstalled many times. I did a Windows system restore to before that the problem started with no luck.
The time / Date on my computer are correct. I have no firewall other than the windows one. I had no antivirus (netbook) until I installed a (Avast) yesterday to see if a virus was causing issues (found nothing). This problem arises on any internet connection (tested to work and home).
or try to use the module Skip Cert error (to jump to the SSL/TLS certificate error page)
Thank you
Please check 'Resolved' the answer really solve the problem, to help others with a similar problem.
-
I can't watch the video of MSN homepage. The Device Manager in the Control Panel also gives me same error message. Any help would be appreciated.
Hi bears Beltran.
1. what browser do you use for viewing?
2. What plugin you are trying to install?Method 1
I suggest you to run the fixit from the following link:Fix Windows Media Player video and other media or http://support.microsoft.com/mats/windows_media_player_diagnostic/ question library
Method 2
I suggest you to scan SFC. Scan SFC will replace missing or damaged files.How to use the System File Checker tool to fix the system files missing or corrupted on Windows Vista or Windows 7
http://support.Microsoft.com/kb/929833Method 3
I suggest you try the steps from the following link:Problems installing and uninstalling programs on Windows computers
http://support.Microsoft.com/kb/2438651#reso3Method 4
I suggest you try the steps from the following link:The video problems when you use Internet Explorer
http://support.Microsoft.com/kb/2532294Additional information:
Plug-ins for Windows Media Player
http://Windows.Microsoft.com/en-us/Windows/downloads/Windows-Media-Player/plug-ins -
Calculation of a total of 2 different columns in different regions.
Hi all
Can someone give me a hint on how to refer to the 2 different columns in different regions, I need calculate a total by adding these. My idea is to create another region and hoping to write sql code to calculate the total, but do not know how to refer to these two columns?
Any help please?
Thank you
Naushad.Report columns that are not of the fields (as in a report updated (in form)) can not be referenced. I think your only likely choice is to repeat the code SQL for two reports in the 3rd region out of all non-relevant columns and then to summarize these in SQL itself.
-
What is the different between firefox "Sync Key" and "key recovery"?
The problem is: I can't get my data from server. I have my key to 'Sync', and I used it several times before, but now Firefox says its wrong. Are 'sync key' and two 'recovery key' names to a single key or its two different keys?
There is no difference between tho two names, they both refer to the sync key that is used to encrypt data locally before sending it to the sync server.
Try creating a new profile as a test to check whether your profile is the source of the problems.
See "create a profile":
- https://support.Mozilla.org/KB/Profile-Manager-create-and-remove-Firefox-profiles
- http://KB.mozillazine.org/Standard_diagnostic_-_Firefox#Profile_issues
If the new profile works then you can transfer files from a profile in the new profile, but make sure not to copy corrupted files.
-
The update does not load, and I can't "remove" program to my computer and reload as the same (needs to restart to complete the installation) error message keeps appearing even after several reboots.
Do a cleaning (re) install and delete the folder of the program Firefox (C:\Program Files\Mozilla Firefox\).
Download a new copy of Firefox and save the file to the desktop.
- Firefox 8.0.x: http://www.mozilla.com/en-US/firefox/all.html
Uninstall your current version of Firefox if possible.
- Do not remove the data of a personal nature when you uninstall the current version or you lose your bookmarks and other data in the profile folder.
Delete the program folder Firefox before installing newly downloaded copy of the Firefox installer.
- It is important to remove the Firefox program folder to delete all the files and make sure that there is no problem with the files that were the remains after uninstallation.
Your bookmarks and other profile data stored in the Firefox profile folder and will not be affected by a relocation, but make sure that you do not select delete data of a personal nature if you uninstall Firefox.
-
I develop application RT who communicate with device of CAN frames extended through CRIO and 9853 CAN module with J1939 Protocol.
I look at Protocol J1939 example of reference to help me in my project.
Everything works fine, but I want to know why when I use the 9853 Module I need to use the bitmask (AND 0x1FFFFFFF to READ and OR write 0x20000000)
As you can see on the example of OR... (to WRITE)
Therefore, use both mask the good CAN Frame ID on the network?
He's not blok me... but I would like to understand why I need to add this code...
Hope someone will have the answer.
Roman
Playback uses the 30 bit to indicate whether the ID is standard or extended. Otherwise, if you have received ID 0x0000000A, you don't know if it was std or extended. For higher numbers (> 11 bit), it's obvious, but the flag is set, without worrying if you don't need several branches.
Maybe you are looking for
-
Would it be possible to have the 'Messages' app in the web interface for iCloud?
I love writing my TEXT with my iMac or my Macbook. But when I'm at work, I'm working on a Windows PC. So I was wonderning if, one day, Apple could add this app to interface web iCloud. This year only, I used an Android phone, I did it with a third-pa
-
XMPP error: Unauthorized (is that what made you enter the wrong password?)
I am trying to configure my xmpp account in thunderbird, but I get this error message.Everything works fine in pidgin with the same settings.I already tried this: http://askubuntu.com/questions/196107/unable-to-connect-to-xmpp-account-with-thunderbir
-
First "Slide" crashes when exported in the form of film
When I try to send a presentation Keynote to Quicktime or share on YouTube the first slide hangs and never advance to another even if I scroll to slide following progress very well. Not sure why I can't get anything beyond the first slide. Seems to m
-
How can I solve this problem
-
% SFF8472-5-THRESHOLD_VIOLATION: RX
Hi all I have this problem on 2 4503E switch CORE01 % SFF8472-5-THRESHOLD_VIOLATION: 1/Te1: low power warning Rx; Running value:-13,8 dBm, threshold value:-9,9 dBm. % SFF8472-5-THRESHOLD_VIOLATION: 1/Te1: low current alarm Rx; Running value:-13.9 dBm