How to unit test pl/sql collection in the unit test ?

There is a function SPLIT_LIST (see below) to split a string list to a collection type .
I'm trying to use the SQLP DEVELOPER to do the unit test on this fucntion. The idea is to use lookups to give multiple string list for different inputs such as 'A,B,C' 'D', '', 'EF,,GH'. for multiple tests a time.
the expected result (function returns) are SPLIT_TBL('A','B',C'), SPLIT_TBL('D'), SPLIT_TBL(), SPLIT_TBL('EF','','GH')
But I have problem to use unit test to verify the result based on the lookups as the out put is the collection. anyone has a good idea to do those ?
create or replace TYPE SPLIT_TBL AS TABLE OF VARCHAR2(32767) ;
create or replace
FUNCTION SPLIT_LIST (
P_LIST VARCHAR2,
P_DEL VARCHAR2 DEFAULT ' ' )
RETURN SPLIT_TBL PIPELINED DETERMINISTIC
IS
lv_idx PLS_INTEGER;
lv_list VARCHAR2(32767) := P_LIST;
lv_value VARCHAR2(32767);
BEGIN
LOOP
lv_idx := instr(lv_list,p_del);
IF lv_idx > 0 THEN
PIPE ROW(SUBSTR(lv_list,1,lv_idx-1));
lv_list := SUBSTR(lv_list,lv_idx+LENGTH(p_del));
ELSE
PIPE ROW(lv_list);
EXIT;
END IF;
END LOOP;
RETURN;
END;
/

I'm having a similar problem - have you solved yours yet?
As for me, when I return a collection as an output parameter from a procedure, I can't test the result.
Example: I'm testing a procedure defined like this: Procedure check_this (p_id number, p_result out CompResult)
where CompResult is defined as: create or replace type CompResult is varray(100) of CompObj;
Unit Test understands that the data type of out parameter p_result is CompResult.
It fills in schemaName.CompResult() as the result (empty varray).
Editing of the result does not appear to be allowed - it's read only.
So, when the proc returns a varray that isn't empty, the test fails.

Similar Messages

  • [svn] 2965: A test method got added to the EnumTypeTest test on BlazeDS/ trunk but didn't get added to the test on the 3.0.x branch.

    Revision: 2965
    Author: [email protected]
    Date: 2008-08-22 11:11:30 -0700 (Fri, 22 Aug 2008)
    Log Message:
    A test method got added to the EnumTypeTest test on BlazeDS/trunk but didn't get added to the test on the 3.0.x branch. The test method is a test for bug BLZ-214 that is still open so we may want to exclude this test from running on both branches.
    Ticket Links:
    http://bugs.adobe.com/jira/browse/BLZ-214
    Modified Paths:
    blazeds/branches/3.0.x/qa/apps/qa-regress/testsuites/mxunit/tests/remotingService/dataTyp es/EnumTypeTest.mxml

    Revision: 2965
    Author: [email protected]
    Date: 2008-08-22 11:11:30 -0700 (Fri, 22 Aug 2008)
    Log Message:
    A test method got added to the EnumTypeTest test on BlazeDS/trunk but didn't get added to the test on the 3.0.x branch. The test method is a test for bug BLZ-214 that is still open so we may want to exclude this test from running on both branches.
    Ticket Links:
    http://bugs.adobe.com/jira/browse/BLZ-214
    Modified Paths:
    blazeds/branches/3.0.x/qa/apps/qa-regress/testsuites/mxunit/tests/remotingService/dataTyp es/EnumTypeTest.mxml

  • Reg: How to Filter from PL/SQL Collection

    like SQL queries ...any otherway is there to filter from the PL/SQL collection ( PL/SQL table )...
    Edited by: user12159093 on Nov 28, 2010 7:24 PM

    LOOP
       IF
       THEN
       END IF
    END LOOP
    when all else fails Read The Fine Manual
    http://download.oracle.com/docs/cd/B19306_01/appdev.102/b14261/toc.htm
    http://asktom.oracle.com contains many fine coding examples
    Edited by: sb92075 on Nov 28, 2010 7:26 PM

  • How to generate Top 10 SQL's in the grid report.

    Hello,
    can anyone give a sample query to be used against to get the information of the top 10 SQL's from the database during the time frame we provide to the report during run time.
    Thanks for your time in advance,
    -Vj

    Subhash,
    A quick and dirty Google search could have get you started with the following:
    Thread: how to get top CPU consuming sql oracle 10g
    Re: how to get top CPU consuming sql oracle 10g
    Oracle SQL top sessions
    http://www.dba-oracle.com/oracle10g_tuning/t_sql_top_sessions.htm
    "How to Find top 10 expensive sql's", version 9.2.0
    http://asktom.oracle.com/pls/asktom/f?p=100:11:0::::P11_QUESTION_ID:73325450402303
    HTH,
    Thierry

  • How to rectify "No master record exist for the vendor TEST"  in ME41

    I created an Vendor TEST in XD01
    while creating a RFQ number in ME41 . It showing "No master record exist for the vendor TEST".
    Why is this error occurs, what is the mistake how to rectify it

    Hello,
    Create the vendor with all details ie) Accounts, Purchase Org. Etc..
    If useful reward points.
    Vasanth

  • How to set a condition based on whether the following test is selected

    Hi,
    In addition to the 'Full Test' (Run UUTs), I would also like to allow for 'Partial Test' (Run Selected Steps Using Single Pass).
    In order to run 'Partial Test' I must run some precondition steps.
    I was thinking to write an 'Action type' step and in its precondition section to set:
    a) run only in 'Partial Test' (I already have a flag for that)
    b) run only if the next step (or any specific test for that matter..) is marked for testing.
    My questions:
    1) Is my approach appropriate or is there a better way to achieve the same goal?
    2) How would you specify a condition of a specific test being marked for testing?
    Thanks
    Rafi

    Hello Rafi,
    If your sequence file contains steps that you will always want to run before running your selected steps, it is best to place those steps inside the Setup step group. So when you run the selected steps, the steps in the Setup step group will always run. This way you do not need to use preconditions.
    However, if you only want those steps to run when you select run selected steps and not when you run Test UUTs; you will have to use preconditions. I would still place those steps inside of the Setup step group. As a side note, there is a TestStand API method Execution.InInteractiveMode which will return a Boolean true if you choose to run selected steps.
    In response to your second question, I would not think that you will need to mark a test using the above method since run selected steps will run all steps currently selected.
    I hope that this information is helpful.
    Regards,
    Kevin L.
    Applications Engineer
    National Instruments

  • How can I skip/pass a lesson when the pre-test is passed?

    I'm creating a course with an overview and 3 lessons. Each is its own CP file (Captivate 6).
    This course will be hosted in our LMS, where I will require each lesson to be taken/passed.
    Lesson 1 is introductory/background material about my topic, and my users may or may not have had exposure to this information already. If they know the info, there's no need for them to take this lesson.
    I have added a pre-test to the lesson, that, if failed, forces the user to go through the lesson content and a graded quiz at the end. The score is reported to the LMS and all is well.
    If the user passes the pre-test, s/he is jumped to a congrats slide and instructed to exit the lesson. (No need to take the graded quiz - the questions are the same, and they've already "passed.")
    My question: How do I report a PASS for the lesson if the user doesn't take the graded quiz? I don't need to report any particular score.
    Thanks for any help you can offer!

    Lieve, I'd LOVE to see your blog post about this topic - especially since you always include examples. =)
    Request: I need help with reporting.
    Here's my project's Branch View (click to view larger):
    I've done as you suggested as far as I know. The navigation works perfectly, but when it comes to reporting, I'm not seeing what I expect/want.
    What I want:
    For the user to be able to skip the pre-test (the branching image shows this)If the user passes the pre-test, can exit the course with a Complete/Pass
    For the user to have X number of chances at the test. After the user a) passes or b) uses up X chances and still fails, I want to report back to my LMS (I'm testing in scormcloud right now, but will be using HealthStream) both completion AND pass or fail.
    What I've got:
    The user CAN skip the pre-test (the branching works, anyway)
    I can get Captivate to report Complete/Unknown or Complete/Pass (sometimes, even when the user fails the graded quiz), or Incomplete/Unknown.

  • I updated all settings, how long before apple logo goes away so the unit can reset?

    I recently "updated all settings", the logo has been on my screen for over 1 hour. About every 10 min, a short "blue screen" appears, then the logo re-appears.  How long before the unit will reset to normal? (unless I have a hardware issue...)

    Hello birddogbill,
    I'm sorry to hear you are having this issue with your iPhone. If your iPhone is still having issues starting up successfully, you may find the troubleshooting steps outlined in the following article helpful:
    If your device gets stuck during startup
    When starting up, you might see the Apple logo or a red or blue screen for a long time, or your device might restart again. Try these steps:
    Make sure that you have iTunes 12 or later on your computer.
    Put your device in recovery mode.
    When you get the option to restore or update, select Update. This will reinstall iOS without erasing your data.
    If your iPhone, iPad, or iPod touch doesn't respond or doesn't turn on - Apple Support
    Sincerely,
    - Brenden

  • How can I add images from collection after the book is saved?

    I am new to the Book module on Lightroom 5. I prepared a rough draft of a book and saved it with the tab on the right hand top of the main screen. Unfortunately, I saved it with the option of only saving the used images from the original collection. Later I brought up the draft book and tried to add some additional images, but see that only the images already used in the book are available on the image strip at the bottom.  I need to get other images which are in the original collection.  Is there any way to do this?  If not, is there a way to save the entire format of the book and then start over with the same format but with the original full collection as the source of images in the bottom strip?

    When you create a saved book, it creates a "Saved Book Collection" in your collections panel with a special "Book" icon. To add pictures to a saved book. Find them in your Grid mode of Library module and drag them into your Saved  Book Collection and they will be available to add back in from the Book Module.

  • I have created a Saved Book, but now realized I want to include additional photos from another Collection. How do get photos from another collection into the filmstrip of the Saved Book? Terry O'Loughlin

    Any help you can give me will be most appreciated. Terry

    Your saved book will show as a Book Collection in your collections panel.  Open the collection with the other photos, select the desired photos in Grid view and drag them into the Book collection.

  • Can I remediate the user at the end of the test after they have completed the entire test?

    We have a course with several lessons.  At the end of the lessons there will be a test that must allow the user to remediate to the questions they missed.
    Our issue is that they students must finish the test first before they are remediated.
    How do I do this?
    Thank you!

    Our plan is to create a lesson test with a minimum of 20 questions where the student will work through the entire test and receive a score.
    At this point after concluding the test, the student is presented with the score showing correct and incorrect answers.
    The student can then select the question(s) they missed and navigate back to the slide containing the information.
    After reviewing each missed question, they can exit the test.
    Keep in mind the test will be a separate captivate file with the 'information slides' copied and pasted into the test.cptx file.
    Is this clear as mud now? 
    Thank you for your feedback.

  • How to pass empty PL/SQL collection?

    I can pass an array as PL/SQL associative array into PL/SQL procedure/block.
    It works perfectly.
    But i can't pass empty array (e.g. new decimal[] {} ) as value - exception raised:
    System.InvalidOperationException:
    "OracleParameter.Value is invalid"
    I can receive empty collection FROM pl/sql, but can i pass empty collection TO pl/sql?

    Unfortunately, there are no any suitable workaround for this problem in thread mentioned above.
    Workaround given by Greg in the thread:
    You can get around it in the meantime by using
    Param1.Value = new string[1]{null};
    Param1.Size=0;Why is that not suitable?
    - Mark

  • How can I save cfquery sql text, not the results

    Hi,
    I have the need to save a dynamically generated cfquery actual sql, not the results.
    I can see it in <cfdump var="#<qry_name>#"> but, how can I capture the actual sql
    and save it in a var for later use ?
    Thanks,
    Bob

    The results property of the <cfquery....> tag allows you to put that information into a variable for later use.
    I.E.
    <cfquery ... results="stuff">...</cfquery>
    <cfdump var="#stuff#">

  • How do i connect to SQL server using the JDBC ODBC

    I am attempting to connect to a database on a server over a network. It is running SQL Server 2005. Am i supposed to set the ODBC on my computer or on the server computer and this is the code i am using but i keep getting a class not found exception.
    //Variables for the connection to the second Database static final String JDBC_DRIVER2 = "com.microsoft.sqlserver.jdbc";; static final String DATABASE_URL2 = "jdbc:sqlserver:///*serverName*/;databaseName=Dashboard;" + "user=dashboard; password = **********"; private Connection connection2; public void Connection2() throws Exception{ Class.forName(JDBC_DRIVER2); connection2 = DriverManager.getConnection(DATABASE_URL2); System.out.println("Connected 2"); Statement statement2 = connection2.createStatement(ResultSet.TYPE_SCROLL_SENSITIVE, ResultSet.CONCUR_UPDATABLE); }
    I have the server's actual name in /*serverName*/ so i know that it is not the issue i left it out for business sensitivity.
    I downloaded sqljdbc.jar and have placed it both in my eclipse driver folder and in the project folder itself.
    Any help would be very grateful.
    Thanks Nathan M.

    ODBC has nothing to do with the driver in the code that you posted.
    Class not found has nothing to do with the connection string.
    And the exception stack trace, if you were printing it, would make that obvious because then you would note that
    it isn't getting to that line.
    Class not found exception means that either your class path is wrong, which is a basic part of java not jdbc,
    or that you specified the class name wrong.
    I downloaded sqljdbc.jar and have placed it both in my eclipse driver folder and in the project folder itself.Apparently that isn't sufficient because it still isn't in your class path.

  • How to use a dynamic SQL data as the header ?

    I'm using BO XI Rel 2. I have hard coded the report headers, but i do have a table wherein the header data is available. I like to fetch the HEADER information from the table, rather than hard coding. How to go about it?
    Example: "Statement of Closing" is the header.
    The above output can be retrieved by using the below query!
    Select Form_desc from TBS_FORMS where form_id = 'tbs1a';
    form_id is a common link between tables!! Since the actual report data has multiple value as output, just by plugging the query in the header, i'm getting #multivalue error!!!!
    In oracle reports, i have something called place holder to achieve the above objective. In BO, how to go about it?
    Edited by: Karthik  Ganesan on Dec 28, 2008 1:22 PM

    Sorry, that doesn't solve my problem. Please read the question more closely - I want my USERS to be able to do this without changing their configurations. My users are public school elementary teachers and parents. I can't ask them to toggle any settings - I'm looking for a way that my users can do this on their own.
    Thanks

Maybe you are looking for

  • Transformation in sap bw 7.0

    i am learning sap bw. i would like to know full details on the topic  transformation in sab bw 7.0 Please search the forum before posting a thread. Edited by: Pravender on Jul 8, 2010 10:57 AM

  • Java, postgres and jasper help

    hi all, i am trying to fix this bug within my program. its a java, postgres and jasper based program which generates charts. now i am generating a chart which does not show any 0 data points if they exist, only non-zero ones. obviously i am trying to

  • Multiple aperture libraries?

    I am a dentist and take many before and after photographs of cosmetic cases I complete. I also take many family photos. I have one library for both with many projects but would love to have a "family only" library and one for my dental practice. Is i

  • Solaris 10 cannot recognize tape device in library.

    We have a DLT7000 tape device in a Quantum PX100 library connected to a Solaris 10 server via SCSI Adapter: X6541A. We can see the tape drive via OBP: /pci@1e,600000/scsi@2 Target b Unit 0 Removable Tape QUANTUM DLT7000 2565 But when Solaris 10 is lo

  • Firewalls and IP blockers for 10.3.9

    I've got some issues here concerning installing an Internet Protocol IP blocker. The reason is simple, to stop hackers and other agents from getting in to see my IP address and to keep spies out when possibly sharing files online. There is some freew