Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 8115743
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 6, 20262026-06-06T03:34:04+00:00 2026-06-06T03:34:04+00:00

I have decided to start using unit testing in PL/SQL, since it could be

  • 0

I have decided to start using unit testing in PL/SQL, since it could be fun and improve the quality of the code.

So, Ive read several resources available and picked SQL Developer and its unit testing capabilities.

I ran into a stupid problem, and Google failed me.

I’m unit testing a simple package.

--Package spec
CREATE OR REPLACE
PACKAGE SAMPLE_TEST
AS

TYPE SAMPLE_RECORD
IS
  RECORD
  (
    SAMPLE_NUMBER NUMBER(3),
    SAMPLE_DATE DATE,
    SAMPLE_INTEGER INTEGER );

PROCEDURE DO_SOMETHING(
    P_FILE VARCHAR2,
    P_RESULT OUT SAMPLE_RECORD);
--OR FUNCTION (..) RETURN SAMPLE_RECORD...    

END SAMPLE_TEST;

With the implementation:

--Package body
CREATE OR REPLACE
PACKAGE BODY SAMPLE_TEST
AS
PROCEDURE SAMPLE_PROC(
    P_FILE VARCHAR2,
    P_RESULT OUT SAMPLE_RECORD)
AS
BEGIN
  P_RESULT.SAMPLE_NUMBER    := SUBSTR(P_FILE, 0 ,3);
  P_RESULT.SAMPLE_DATE      := TO_DATE(SUBSTR(P_FILE, 4 ,8), 'DD.MM.RRRR');
  P_RESULT.SAMPLE_INTEGER   := SUBSTR(P_FILE, 20);
END SAMPLE_PROC;
END SAMPLE_TEST;

The input string is 035200220122102201213.

The result is – an ERROR. Assertion failed.
The procedure is correct, it returns the correct values, but the “unit testing framework” informs me:

P_RESULT : Expected: [<SAMPLE_NUMBER=35, SAMPLE_DATE=20.02.12, SAMPLE_INTEGER=13>], 
           Received: [<SAMPLE_NUMBER=35, SAMPLE_DATE=20.02.12, SAMPLE_INTEGER=13>]

I can’t find a submited bug anywhere – metalink, Google – any ideas?

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-06T03:34:06+00:00Added an answer on June 6, 2026 at 3:34 am

    this page https://forums.oracle.com/forums/thread.jspa?threadID=2382730
    says there is a problem with ref cursors and unit testing…

    maybe its related.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

When I decided to start using php framework, I have gone for CodeIgniter because
I have decided to start coding using OOP and a PHP framework. I have
OK so I decided to start using interfaces in my code base and this
I've read alot about the Castle Project and decided to start using it, primarilly
I have decided to start using Team City as my continuous integration software and
I have decided to start using HTML5BP and Bootstrap2 (with responsive option) as my
Our project contains 2600 class files and we have decided to start using automated
I have decided to start developing a little web application in my spare time
I'm new to programming and stackoverflow and have decided to start by learning objective
I have decided to start doing small coding projects on my own that focus

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.