Unit Test Validation for Output Ref Cursor Not Working

Here is the problem:
I have a stored procedure as follows:
CREATE OR REPLACE
PROCEDURE usp_GetEmployee(
p_employeeId IN NUMBER,
cv_employee OUT Sys_RefCursor )
AS
BEGIN
OPEN cv_employee FOR SELECT * FROM employees WHERE employee_id=p_employeeid;
END usp_GetEmployee;
For this, I am implementing a unit test.
* In the "Select Parameters" step, I am unchecking the "Test Result" check box for the cursor OUT variable.
* In the "Specify Validations" step, I am choosing "Boolean Function" and putting the following PL/SQL code:
DECLARE
emp_rec {cv_employee$}%rowtype;
BEGIN
FETCH {cv_employee$} INTO emp_rec;
IF {cv_employee$}%FOUND THEN
RETURN TRUE;
ELSE
RETURN FALSE;
END IF;
RETURN TRUE;
END;
But, when I try to execute this Test, I get the following error:
Validation Boolean function failed: Unable to convert <oracle.jdbc.driver.OracleResultSetImpl@4f0617> to REF CURSOR.
If I run in the debug mode, I get the following content in a dialog box:
The following procedure was run.
Execution Call
BEGIN
"ARCADMIN"."USP_GETEMPLOYEE"(P_EMPLOYEEID=>:1,
CV_EMPLOYEE=>:2);
END;
Bind variables used
:1 NUMBER IN 1001
:2 REF CURSOR OUT (null)
Execution Results
ERROR
CV_EMPLOYEE : Expected: [Any value because apply check was cleared], Received: [EMPLOYEE_ID                             COMMISSION_PCT                          SALARY                                 
1001                                    0.2                                     8400                                   
Validation Boolean function failed: Unable to convert <oracle.jdbc.driver.OracleResultSetImpl@31dba0> to REF CURSOR.
Please suggest how to handle this issue.
Thanks,
Rahul

979635 wrote:
But, when I try to execute this Test, I get the following error:
Validation Boolean function failed: Unable to convert <oracle.jdbc.driver.OracleResultSetImpl@4f0617> to REF CURSOR.
If I run in the debug mode, I get the following content in a dialog box:
The following procedure was run.
Execution Call
BEGIN
"ARCADMIN"."USP_GETEMPLOYEE"(P_EMPLOYEEID=>:1,
CV_EMPLOYEE=>:2);
END;
Bind variables used
:1 NUMBER IN 1001
:2 REF CURSOR OUT (null)
Try explicity declaring the ref cursor instead of using a bind variable, something like (untested)
begin
  foo sys_refcurosr;
begin
  test_procedure(foo);
end;Alternately, in SQL*PLUS use the DEFINE command to ste a named bind variable to type REFCURSOR and use the named bind variable in your test
Edited by: riedelme on Jan 23, 2013 7:10 AM

Similar Messages

  • Validation for an item is not  working

    Hi All,
    I have a validation for name field in my application to resist the names repeating while creating new USER
    i tried Function returning error text.
    declare
    l_count number:=0;
    begin
    if :p102_username is not null and :REQUEST ='CREATE' then
    select count(username) into l_count
    from portal_login
    where user_id =:p102_user_id;
    if l_count > 0 then
    return'This Username already exists. Please enter a new name.';
    end if;
    end if;
    end;
    But it is not working..
    It gives error like
    ORA-01403: no data found
    Error unable to fetch row.
    First it was working fine, after validation it started to give error.
    So i removed that but also the condition is same..
    Can any one help me?
    Thanks,
    Alka

    You are getting this error because your SELECT statement is not returning any rows. You need to do something like:
    DECLARE
      l_count number:=0;
      CURSOR check_emp IS
        SELECT COUNT(ename) cnt
          FROM emp
         WHERE ename = :p14_ename;
    BEGIN
      IF :p14_ename IS NOT NULL AND :REQUEST ='CREATE' THEN
        OPEN check_emp;
        FETCH check_emp INTO l_count;
        IF (l_count > 0) THEN
          CLOSE check_emp;
          return l_count||' This employee name already exists. Please enter a new name.';
        END IF;
        CLOSE check_emp;
      END IF;
    END;Mike

  • Where should I put my extended unit test assemblies for Visual Studio 2013?

    Hi, I have a question about M/S Unit test extension.
    1. My purpose
    I'm trying to extend Visual Studio Unit Test.
    The points where I extends unit test is to output detail logs.
    My development environment is as follows.
    OS: Windows 8.1Pro (64bit version)
    IDE: Microsoft Visual Studio Professional 2013
      (Version 12.0.30723.00 Update 3)
    2. Things which I'd like to know
    To enable my test extension, it is required to put my test extension assemblies into designated sub folder under Visual Studio's installed folder.
    The source of this information is MS developers blog below.
    (http://blogs.msdn.com/b/vstsqualitytools/archive/2009/09/04/extending-the-visual-studio-unit-test-type-part-1.aspx)
    Q1. It's required to put the assemblies bellow.
    C:\Program Files\Microsoft Visual Studio 10.0\Common7\IDE\PrivateAssemblies
    Howerver, the guidance in the blog is for Visual Studio 2010.
    In Visual Studio2013, above "PrivateAssemblies" could not be found under "\Microsoft Visual Studio 12.0\Common7\IDE" folder.
    Where should I put my assemblies for my 2013. Is there any substitution for "\PrivateAssembly" folder?
    Q2. Another requirement is to set Assembly information entry into the registry below.
    HKEY_LOCAL_MACHINE\SOFTWARE\Wow6432Node\Microsoft\VisualStudio\10.0\EnterpriseTools\QualityTools\TestTypes\{13cdc9d9-ddb5-4fa4-a97d-d965ccfc6d4b}\TestTypeExtensions
    For Visual Studio 2013, I could find almost the same node hierarchy, but
    could not find the last "TestTypeExtention" node. Instead,
    I could find "Extensions" node.
    Should I write registry entry here? Or, should I make a new "TestTypeExtension" node and write the entry there?
    Q3.Last question is more basic question.
    Is there any way to kick extended test program in Visual Studio 2013's Test Explore
    without registering my assemblies in the way recommended above.
    I think it's much tender for developer's in debugging phase. For example,
    it is very much helpful, if I could kick a unit test which uses my extended test class in the unit test extension solution.
    That's all. Any information concerning this topics will be appreciated.

    Hi TrailRunner-MF,
    One possible reason is that you didn't view the correct folder, for example, in my windows 8.1 64 bit, it is in the path: "C:\Program Files (x86)\Microsoft Visual Studio 12.0\Common7\IDE", not the "C:\Program Files\Microsoft Visual Studio
    12.0\Common7\IDE " folder.
    Best Regards,
    Jack
    We are trying to better understand customer views on social support experience, so your participation in this interview project would be greatly appreciated if you have time. Thanks for helping make community forums a great place.
    Click
    HERE to participate the survey.

  • Unit test plan for inbound and outbound interfaces

    I am trying to create a UNIT TEST PLAN for an interface. In this interface a flat file in IDOC format is picked up from the application server and processed using EDI_DATA_INCOMING for the relevant posting ( example : Sales order creation from a PO IDOC). IF the file is not in IDOC format then it is reformatted to the IDOC format manually.
    In second scenario(outbound), after sales order creation or billing document creation, IDOC is created which is read and a custom flat file is created and sent to a middleware.
    PLease suggest a unit test plan for these kind of scenarios or send a sample UTP if possible.
    REgards
    Nishant
    PS: points will be awarded to helpful answers.

    Unfortunately this isn't possible, the esa has only one routing table. You'll have to add specific routes for your internal networks.
    I usually avoid two-armed setups because of this and it gets even worse if you want to use virtual gateways (traffic gets sent via the internal interface with an IP from the external interface)

  • Valuation Basis for Different Payment (BWGRL) not working in 2010

    Hi
    We have a commission wagetype which we entered in IT 2010 in Number/Unit field. 
    Since we don't have premium id available, we used "Valuation Basis for Different Payment (BWGRL)"  to enter the RATE.
    This RATE is not working during our payroll run, however when we are using the wagetype with premium ID it is working fine.
    My question is- What could be the reason that the Valuation Basis for different payment is not working ? 
    I checked the wagetype in V_512W_B table and it has the following configuration-
    Current wage type
    Valuation Basis = BLANK
    Statement/WT = BLANK
    %Rate = 100
    1st derived wage type
    Valuation Basis = BLANK
    Statement/WT = BLANK
    %Rate = BLANK
    2nd derived wage type
    Valuation Basis = BLANK
    Statement/WT = BLANK
    %Rate = BLANK
    Would appreciate if the the fix could be provided.
    Saurabh Garg

    Hello,
    I think in your case for commision wagetype you need to modify rule $930 to process the override rate from Infotype 2010 BWGRL field in case you are using the US standard schema.
    The valuation basis table V_512W_D and rule $930 together will determine the valuation basis.
    The default valuation basis comes from table V_512W_D.In case you want to override the valuation basis rate defined in this table,you need to maintain override rate in It2010 and accordingly have the logic defined in rule $930 for that particular wagetype .
    Following is the sample rule definition for a similar scenario.
    ****(commision wagetype)
      NUM= ANZHL Set
      RTE= BWGRL Set
      RTE?0      Comparison
          MULTI NRA  Multipl.amt/no/rate
          SETIN X=NX Set variable split
          ADDWT *    OT   Output table
        =
          VALBS0     Eval.0.WT in 512W
          MULTI NRA  Multipl.amt/no/rate
          SETIN X=NX Set variable split
          ADDWT *    OT   Output table
    Regards,
    Malathi V.

  • Earlier installed flash player for x64 yet still not working

    Hello:
    Over the past 6months flash player installed and it's a working program, then a update comes
    along install that then you know it program  stops working.  I just uninstalled latest version  as it was not working
    I went back to dl.flash player square "beta preview, for windows X64.  Not working.
    Where,what is a user to do? I like learning from H.P. Learning which uses flash player so I really
    need to get Adobe Flash Player working a.s.a.p.
    thanks nedt

    Hi, The Square is a beta version and still in testing. You need to Uninstall it if you want the latest released version.
    Even tho you have a 64bit OS, you need to use the 32bit browser with any Flash Player version other than Square.
    Download and SAVE to your Desktop the Uninstaller:
    http://kb2.adobe.com/cps/141/tn_14157.html
    Download and SAVE to your Desktop the Installer(s)
    http://www.adobe.com/products/flashplayer/fp_distribution3.html   Use the EXE Installer for Win/IE and Win/plugin
    Use the Administrator Account
    Close all browser windows, disable any instant messengers in the system tray
    Disable any realtime anti-virus
    Run the Uninstaller and then reboot
    Run the Installer(s) and reboot.
    Reenable any that was disabled.
    Test here with browser(s)
    http://www.adobe.com/software/flash/about/
    You can print this out to make it easier.
    eidnolb

  • Validation of existing certificate does not work since release 9.3.3

    Hi everyone,
    Since I updated to Adobe Reader 9.3.3 the validation of digital signatures does not work properly anymore. Though I try to validate the certificate that used to be OK before the upgrade to 9.3.3 I now get an error on the same document and signature that used to work before. In the signature details Adobe Reader now states that "The certificate ...is not trusted...". This has to do with the new Adobe Approved Trusted list (AATL) I assume since nothing else changed.
    Does anybody know a workaround or is anybody aware of a bugfix that will be released in the near future?
    Thanks in advance,
    Mike G

    Works for me.
    What OS/JDK etc are you using?

  • New Release QuickVPN client 1.4.0.5 for windows 7 does not work????

    New release of QuickVPN client version  1.4.0.5  for windows 7 is not working properly.
    We can not connect; instead we receive this message:
    "Remote Gateway is not responding, do you want to wait?"
    Dear Cisco,,,,
    Your release is not complete; please correct issue and advise after it has been tested.
    Rgds, EM

    Hi, first disable this POLSTORE.DLL again in your QuickVPN-Folder. Then start in this folder IPSEC.MSC and than IPSEC.EXE. You should get from IPSEC.EXE  the error above. If not, than any other problem you have. Follow all the hints here in this thread.
    If you get the same error above, than enable this POLSTORE.DLL again and start the IPSEC.EXE. You get the full info what has been gone. And within the IPSEC-Window for Local Computer you may find this FREESWAN-setting.
    B.t.w. before I went this way I did export and import the IPSEC-settings from the XP-machine, as it was hinted some posts earlyer. But the way I have gone, works also with manualy deleting the FREESWAN config. With the IPSEC.EXE it will new generated in any case.
    When you start via QuickVPN you may monitor also what happens within this IPSEC for Local Computer. Press F5 to keep it aktual.
    From time to time the connection gets only succeeded after the second and more times. I have a very slow UMTS Internet-Access.
    Juergen
    Adding: These effects, getting not connected, first and during the VPN-Tunnel exists, has not changed since the top-first Version of Quick-VPN.
    Dear customer, be patient, don't care about these stupid messages, click again or when the connection allready has succeeded through the VPN-tunnel do what you did like to do.
    ...... and again, with which configuration-scenario do the guys at Cisco test and develop .....
    Fortunately, I never was a Cisco partner, only a poor user ;)

  • [svn:fx-trunk] 7473: Fix for 'ant asdoc' does not work.

    Revision: 7473
    Author:   [email protected]
    Date:     2009-06-01 12:09:26 -0700 (Mon, 01 Jun 2009)
    Log Message:
    Fix for 'ant asdoc' does not work.
    It should now work from both svn and package zip.
    Bugs: SDK-15306
    QE Notes: None.
    Doc Notes: None.
    tests: checkintests
    Ticket Links:
        http://bugs.adobe.com/jira/browse/SDK-15306
    Modified Paths:
        flex/sdk/trunk/asdoc/build.xml
        flex/sdk/trunk/build.xml

  • TS1363 In my "Diagnostics Test" it says iTunes Helper is not working. How do I rectify this?

    I ran a diagnostics test & it said iTunes Helper is not working. How do I rectify this? Also, I recently updated iTunes & I hadn't done it for three years prior & now to burn a CD of i8 songs is taking me 13 min. instead of 2-3 min. like it should. What is going on? My friend is having the same problem.

    Hi there,
    You may want to take a look at some of the information found in the article below.
    iTunes Store: About authorization and deauthorization
    http://support.apple.com/kb/ht1420
    -Griff W.

  • HT1947 Remote for ipad landscape orientation not working in ios 7

    Remote for ipad landscape orientation not working in ios 7

    See this thread: remote app rotation locked in portrait orientation after iOS 7 upgrade
    It is a discussion only - no helpful hints.  Appears to be a bug for sure.

  • My dvd slot for imac10,1 does not work. It rejects the disc. Problem after reinstall of backup from hdd.

    My dvd slot for imac10,1 does not work. I had a new harddrive installed in November and the MacStore installed my backups from an external harddrive. I do not use it other than to upload programs, so I have not tried using it until tax season, but it rejects the disc. The ata file indicates no dvd firmware, but the serial-ata does indicate firmware for a dvdrw. What might I do about this to bring the dvd back, least expensive to most?

    Yesterday I started having the same problem. Can read disc (play movies and music) but blank disk are ejected or idvd cannot see the blank disk. I have a almost 12 month old 27" i7 imac.

  • I want to reset my ipod touch 4th gen but i have forgotten the restrictions passcode and for some reason its not working on my laptop on itunes and the restore thing wont work! any help?

    I want to reset my ipod touch 4th gen but i have forgotten the restrictions passcode and for some reason its not working on my laptop on itunes and the restore thing wont work! any help?

    Make sure you have the Current Version of iTunes Installed on your computer
    iTunes free download from www.itunes.com/download
    Then See Here  >  http://support.apple.com/kb/HT1808
    You may need to try this More than Once...  Be sure to Follow ALL the Steps...
    Take your time... Pay particular attention to Steps 3 and 4.
    After you have Recovered your Device...Re-Sync your Content
    Note:
    To remove a forgotten Restrictions passcode you will need to  Restore the Device as New...
    OR... From a Backup created Before the Restrictions Code was set....

  • Auto To working for one material and not working for other material

    Hi,
    Hope everybody is doing fine.
    I have configured the auto TO. Its working fine for one material and not working for the other material. I checked the material master and wm 1,2 views have the same fileds / values. What could be wrong?
    I didn't setup the back ground processing job. Is that is affecting it?
    thanks for any help.
    regrads,
    KHAN

    Thnaks,
    You are right but then what could be wrong? Its working for one material and not working for otehr material? Any clue?
    Appreciate your time charlie

  • My new Dell PC running Windows 8 does not recognize my iPad or iPhone. Worked OK for iPhone for months but would not work for new iPad.  I removed /relaoded iTunes and now it won't recognize either iPad or iPhone.

    My new Dell PC running Windows 8 does not recognize my iPad or iPhone. Worked OK for iPhone for months but would not work for new iPad.  I removed /relaoded iTunes and now it won't recognize either iPad or iPhone. Got any suggestions?

    Hi there Lizabethfromaz,
    You may find the troubleshooting steps in the article below helpful.
    iOS: Device not recognized in iTunes for Windows
    http://support.apple.com/kb/ts1538
    -Griff W. 

Maybe you are looking for