Unit Test Variable Substitution in PL/SQL User Vailidation code not running

Hi
I am using new Unit Test Feature in SQL Developer 2.1.0.62.
I have created a test implemented to test a function. The function has a VARCHAR2 parameter as input and returns a BINARY_INTEGER.
I would like to perform 'Process Validation instead of specifying an explicit 'Result'. The check box 'Test Result' is unchecked.
I have seen in the doc. that I can use substitution variables in my user defined PL/SQL code. I try
IF {RETURNS$} < 0
THEN ...
but I always get the error
ERROR
<RETURN> : Expected: [Any value because apply check was cleared], Received: [-103]
Validation User PL/Sql Code failed: Non supported SQL92 token at position: 181: RETURNS$
Obviously, the program doesn't recognize {RETURN$}.
Am I missing something?
br
Reiner

Hi all,
I have installed the latest version of SQL Developer (2.1.1) that fixed the problem - must have been a bug.
The only problem was that I got an ORA-904 TEST_USER_NAME... error. I export my tests, dropped the repository, created a new one and reimported everything. Now it works as it should.
br
Reiner

Similar Messages

  • Hyper-V - 'Failed to start the virtual machine 'test' because one of the Hyper-V components is not running.'

    Hi all,
    Having a bit of a nightmare with Hyper-V on my Windows 8 Pro laptop - Whenever I create a new VM and try to start it I receive the following error;
    'Failed to start the virtual machine 'test' because one of the Hyper-V components is not running.'
    I sometimes also receive an error saying something along the lines of 'Unable to change virtual machine state'
    I have done a lot of searching a seen two common answers - The first is to try removing the Hyper-V role and re-adding it - I have tried this several times to no avail. (Intel VT and all virtualisation capabilities are enabled in BIOS). The second issue
    it would seem
    some people have had relates to editing the VMX configuration file and adding the line
    hypervisor.cpuid.v0 = "FALSE" - I thought VMX files were only present in VMware Virtual Machines...
    Any help would be greatly appreciated.
    Many thanks in advance.
    James

    The hypervisor event log message is generated only at boot - so this would be expected.  Also vmbus should not be running on the host (I was looking at a VM yesterday)...  This error message is generated only when the vid is determined not to be
    running or cannot communicate with the hypervisor.
    I have seen this due to anti-virus software in the past or due to driver verifier being configured.  Since it looks like you checked driver verifier already do you have anti-virus software installed?  If so have you followed the best practices
    and exempted the Hyper-v services? 
    http://technet.microsoft.com/en-us/library/dd283088(WS.10).aspx
    To resolve this problem, configure the real-time scanning component within your antivirus software to exclude the following directories and files:
    Default virtual machine configuration directory (C:\ProgramData\Microsoft\Windows\Hyper-V)
    Custom virtual machine configuration directories
    Default virtual hard disk drive directory (C:\Users\Public\Documents\Hyper-V\Virtual Hard Disks)
    Custom virtual hard disk drive directories
    Custom replication data directories, if you are using Hyper-V Replica
    Snapshot directories
    Vmms.exe (Note: This file may have to be configured as a process exclusion within the antivirus software.)
    Vmwp.exe (Note: This file may have to be configured as a process exclusion within the antivirus software.)
    -Taylor Brown<br/> -Program Manager, Hyper-V<br/> -http://blogs.msdn.com/taylorb

  • Report Subscription by email error - The SQL Agent service is not running

    Hello All,
    This may be an easy answer, so please excuse my ignorance if I am overlooking something simple. I a simply trying to setup Report Subscriptions to be emailed to me. We currently have essentially 3 servers in use in our environment - a CAS, a Site server
    and a SQL 2012.
    I have configured the email settings in Reporting Services Configuration Manager on the Site server and was finally able to see the email option in the Create Subscription Wizard, but it errors out with:
    System.Web.Services.Protocols.SoapException: The SQL Agent service is not running. This operation requires the SQL Agent service. ---> Microsoft.ReportingServices.Diagnostics.Utilities.SchedulerNotRespondingException: The SQL Agent service is not running.
    This operation requires the SQL Agent service.   at Microsoft.ReportingServices.Library.ReportingService2005Impl.CreateSubscription(String Report, ExtensionSettings ExtensionSettings, Boolean isDataDriven, DataRetrievalPlan DataRetrievalPlan, String
    Description, String EventType, String MatchData, ParameterValueOrFieldReference[] Parameters, Guid batchId, String& SubscriptionID)   at Microsoft.ReportingServices.WebServer.ReportingService2005.CreateSubscription(String Report, ExtensionSettings
    ExtensionSettings, String Description, String EventType, String MatchData, ParameterValue[] Parameters, String& SubscriptionID)
    We do not have SQL installed locally, therefore it makes sense that the Agent service is not running. How do I subscribe to alerts in SCCM without a local installation of SQL?
    -Brad

    I am positive - see screenshots below of services on the SQL server:
    Yes, reports work perfectly otherwise... Just cannot subscribe.
    -Brad

  • Odd Variable Substitution Error in SQL Query

    I'm trying to finish up an application but one goofy error is
    throwing me for a loop. The error complains about my SQL syntax on
    the line containing "#filelist_sql#" near the bottom of the query,
    but when I output the SQL and run it in phpMyAdmin, it works fine.
    Thanks in advance for any help provided. I think I've just
    been looking at this way too long.
    Code follows:

    Thanks for the quick assistance, Azadi. I am finding the same
    bit of strangeness occurring just a bit earlier in my code.
    The application complains about the SQL syntax near
    "#grouplist_sql#" in the attached code.
    After the code gets processed (using '11' for
    sql_find_lists.id), the SQL looks like:
    SELECT DISTINCT file_id FROM grouplists_to_files WHERE
    grouplist_ids = '11' OR grouplist_ids LIKE '11,%' OR grouplist_ids
    LIKE '%,11' OR grouplist_ids LIKE '%,11,%'
    Hopefully someone can spot something else brilliantly obvious
    that is wrong here.

  • PL/SQL code not running

    Hi , Please help to get the rows which have a character in the PFNUM column for this table
    EMPNU PFNUM NAME
    100 222 rat
    101 a33 sanu
    102 4a4 rahul
    our PL/SQL is
    1 DECLARE
    2 i number;
    3 j number;
    4 t varchar2(10);
    5 CURSOR ratnesh_cur IS
    6 select PFNUM from employee;
    7 BEGIN
    8 OPEN ratnesh_cur;
    9 FETCH ratnesh_cur into t;
    10 FOR i IN 0..LENGTH(t)
    11 loop
    12 FOR j IN 0..9
    13 loop
    14 IF SUBSTR('t',i,1)= j THEN dbms_output.put_line(t);
    15 ENDIF;
    16 END LOOP;
    17 END LOOP;
    18 CLOSE ratnesh_cur;
    19* END
    20 /
    END LOOP;
    ERROR at line 16:
    ORA-06550: line 16, column 5:
    PLS-00103: Encountered the symbol "LOOP" when expecting one of the following:
    if
    ORA-06550: line 19, column 3:
    PLS-00103: Encountered the symbol "end-of-file" when expecting one of the
    following:
    loop

    TO APC ...
    <quote>Which solution is appropriate depends on the spec details.</quote>
    Indeed … that is why I provided a simple alternative answering the original question (my interpretation of it extrapolated from the actual data set provided) … I did not comment on your reply.
    But let me address your answers:
    <quote>The best way of checking whether a value is numeric is to test for failure of the Oracle built-in function TO_NUMBER()</quote>
    That would be too strong a statement, wouldn’t it?
    Let us assume a table with a varchar2 column which we know contains only alphanumeric characters … 2097152 rows … half containing only digits … half with a mix of digits, upper and lower alphabetical characters.
    flip@FLOP> select count(0) from apc
    2 where instr(translate(lower(v)
    3 ,'abcdefghijklmnopqrstuvwxyz'
    4 ,'xxxxxxxxxxxxxxxxxxxxxxxxxx'),'x') > 0
    5 ;
    COUNT(0)
    1048576
    Elapsed: 00:00:05.02
    flip@FLOP> select count(0) from apc
    2 where is_number(v) = 0
    3 ;
    COUNT(0)
    1048576
    Elapsed: 00:00:13.05
    “is_number” is your function modified to return 1 (true) or 0 (false) instead of the Boolean.
    Clearly a solution employing TO_NUMBER is not always the most performant way (as you seem to imply) … all those context switches between SQL and PL/SQL do add up.
    Soooo … there is no “most performant way” to check for numeric or non-numeric values for all categories of problems … in fact there isn’t even a universal solution … one has to have some knowledge of the data domain being checked and the environment context.
    So how about the ‘?’ and '@’? … Is the string ‘-1?123@99' numeric or not? Having modified your “is_number” function yet again to do “ln := to_number(pv_string,'9G999G999D99');” …
    flip@FLOP> select is_number('-1?123@99') from dual;
    IS_NUMBER('-1?123@99')
    0
    NO.
    flip@FLOP> alter session set nls_numeric_characters='@?';
    Session altered.
    flip@FLOP> select is_number('-1?123@99') from dual;
    IS_NUMBER('-1?123@99')
    1
    YES.
    But forget about nls settings … how about ‘-123e2’? … is this numeric or not ?
    flip@FLOP> select to_number('-123e2') from dual;
    TO_NUMBER('-123E2')
    -12300
    According to TO_NUMBER, it is numeric … for the person having the knowledge of the data domain being checked that well may be a false positive.
    Hope this proves the point about the universal solution and the qualities of TO_NUMBER.
    As for <quote>And if the character is uppercase?</quote> … this kind of flipped me … looking at the link supplied by you … and glancing over the implementation of “StringParse” one could well ask: “and if the string contains lowercase?” … but nobody did … would’ve been a bit too picky and outside the main technique being demonstrated.
    Gabe

  • SQL Server Cursor dioe not run in Hyperion Workspace

    Hi all,
    I have a bqy file which runs fine in the design studio client (v9.3) however when I import it into the Workspace and try and run it i get the following error :
    An Interactive Reporting Service error has occurred.-SQL API: [SQLFetchScroll], SQL RETURN: [-1], SQL STATE: [HY010], SQL NATIVE ERROR: [0], SQL MESSAGE: [[DataDirect][ODBC lib] Function sequence error]
    (2001)
    The query was built from importing the SQL as below:
    DECLARE @Fig1 int
    DECLARE @i int
    DECLARE skuCursor CURSOR FOR
    Select r.QtyReceived / b.qty as Figure1
    from ReceiptDetail r
    inner join BillofMaterial b on b.SKU = r.Lottable03
    where r.DateReceived > getdate() - 14
    create table #TEMPIG (Test char(2),Median1 int)
    OPEN skuCursor
    FETCH NEXT FROM skuCursor INTO @Fig1
         set @i = 0
    WHILE @@FETCH_STATUS = 0
    BEGIN
         while @i < @Fig1
         begin
    insert into #TempIG (Test,Median1) values ('MV',@Fig1)
              --print @Fig1
              set @i = @i + 1
         end
         set @i = 0
         FETCH NEXT FROM skuCursor INTO @Fig1
    END
    CLOSE skuCursor
    DEALLOCATE skuCursor
    --select cast(Median1 as Int) from #TEMPIG
    --order by 1 asc
    select
    AVG(Median1) as MedianVal
    from
    select Median1,
    ROW_NUMBER() over (partition by Test order by Median1 ASC) as MedRank,
    COUNT(*) over (partition by Test) as MedCount
    from
    #TEMPIG
    ) x
    where
    x.MedRank in (x.MedCount/2+1, (x.MedCount+1)/2)
    drop table #TEMPIG
    Could anyone explain what is wrong and how to put it right.
    Many Thanks in advance.
    Ian.

    Try run "Configure Web Server" under Foundation in EPM Configurator again
    then restart both Foundation Services and Web Server (OHS or IIS or the embedded weblogic server)
    Edited by: YeeHeong on Jun 4, 2013 1:54 AM

  • Automated SQL Agent jobs do not run

    Hi all
    I am having serious issues in running SSIS packages automatically.
    Furthermore, when I assign a job to run the SSIS package manually (SSMS -> Start Job at Step....), it runs through the job very quickly and displays "success", when in actual fact, it hasn't done anything.
    I have tested my package in BIDS and all works fine.
    Can anyone give me a clue as to what may be going wrong please?
    Many thanks in advance.

    Hi divvyboy,
    Based on your description, the issue may be caused by one of the following factors:
    Data source connection issue. This can occur because the SQL Server Agent Service Account or the proxy account lacks permissions to access the data source.
    Package Protection Level issue.
    For the solution in each scenario, please refer to the following link:
    http://social.technet.microsoft.com/Forums/sqlserver/en-US/e13c137c-1535-4475-8c2f-c7e6e7d125fc/how-do-i-troubleshoot-ssis-packages-failed-execution-in-a-sql-agent-job?forum=sqlintegrationservices.
    If the issue persists, please post the error details from the SQL Server Agent job history.
    Regards,
    Mike Yin
    TechNet Community Support

  • User function code not substituted

    Hi
    I have a user function (getCode(...)) of the form
    case
    when exists (select * from ...)
    then '!Ok!'
    else '!None!'
    end
    When I use this function in a interface mapping (getCode(a,b,c)), the code is not substituted in the generated query (as seen in the operator):
    insert /*+ APPEND */ into ...
         Z_CODE,
         RUN_NR,
         REC_ID
    select     
         getCode( NAME, 'ZIV', 'G' ),
         RUN_NR,
         REC_ID
    from     ...
    where     (1=1)
    and the execution results in an ORA-00904 exception: Invalid column name.
    How come?
    Thanks

    First of all, thanks for your answers!
    The problem was lying in the definition of the function's syntax:
    I'm using the possibility to specify the data_type of the arguments: getCode($(run_nr)n, $(tabi)s, $(code)s).
    Unfortunately, I put a space between the arg_name and the data_type! This causes the function not to be substituted into the query ...
    Once again thanks to all.
    Cheers, Benno

  • The SQL Agent service is not running. This operation requires the SQL Agent service. (rsSchedulerNotResponding)

    Hi,
    I have started sql agent service on the SQL server but I still cannot subscribe. I have followed few instructions but no joy.
    Can you please help?
    Thanks,

    Hi Mo,
    According to your description, you want to subscribe a report with E-mail delivery extension, right?
    In Reporting Services, since the E-mail delivery extension is not configured by default, if we want to subscribe reports with E-mail delivery extension, we should specify E-mail settings in Reporting Services Configuration Manager. Besides, we should specify
    advanced settings in rsReportServer.config file. In your scenario, please make sure you have configured the E-mail delivery extension correctly. For more information, please refer to this article:
    Configure a Report Server for E-Mail Delivery (SSRS Configuration Manager).
    If you have any question, please feel free to ask.
    Best regards,
    Qiuyun Yu
    Qiuyun Yu
    TechNet Community Support

  • SQL Server Agent Jobs- Not running

    Team,
    We have a production database hosted on SQL Server 2008R2 SP2(10.50.4000). We have application jobs which are scheduled and basically have packages called from this job. These jobs were running all good till yesterday and it has stopped working since yesterday
    even though its enabled. Manual runs are successful. Other jobs are running fine. 
    Checked the Owner of these jobs and the account is SQL Server account which is a proxy account. It had enforce password policy. I have removed that and reset the password to original. However it didnt work.
    The last change on this server was windows patching which was performed last week. Apart from that the SQL Server agent service was changed. This is a clustered environment.
    The last resort is restart the agent, however would like to get some inputs before I perform this action. 
    Please let me know your valuable inputs.
    Regards,
    Sharath

    If job is not executed at all, that is, there are no entries in the job history, check:
    1) The job is enabled.
    2) The schedule(s) is enabled.
    3) The scdedule does not have an end date has has passed.
    4) And that all other conditions on the schedule says that the job should run.
    Erland Sommarskog, SQL Server MVP, [email protected]

  • Printer sees network, won't connect. Test report says "faiol" under no filtering. Channel not run.

    Will not connect to wireless network.  2 computers are on with SSID and WPA code.  Worked last week.

    Hi,
    Sorry, I misread the last bit. Do you know what is the channel on your router ? You may try to reboot the router.
    Hope this helps.
    BH
    **Click the KUDOS thumb up on the left to say 'Thanks'**
    Make it easier for other people to find solutions by marking a Reply 'Accept as Solution' if it solves your problem.

  • Unit Testing and APEX Global Variables

    We've recently started to unit test our database level PL/SQL business logic.
    As such we have a need to be able to simulate or provide output from PL/SQL APEX components in order to facilitate testing of these components.
    Some of the most obvious portions that need simulation are:
    1. The existence of a session
    2. The current application ID
    3. The current page ID.
    We currently handle requirement #1 by using apex_040100.wwv_flow_session.create_new
    We handle 2 and 3 using the apex_application.g_flow_id and g_flow_step_id global variables.
    I'm just wondering, how safe is it for us to use wwv_flow_session.create_new to simulate the creation of a session at testing time for those things which need a session?
    I've also noticed that there are apex_application.get_application_id and apex_application.get_page_id functions whose output is not tied to the global variables (at least in our current version).
    Is it safe for us to expect that we can set these global variables for use in testing or is apex moving to get_application_id and get_page_id functions away from global variables?
    Will there be corresponding set_application_id and set_page_id functions in the future?
    Sorry for the question bomb. Thanks for any help.

    My first question would be why do you need to establish a session to test your PL/SQL?
    wwv_flow_session is a package internal to APEX, and you should probably leave it be.
    The get_application_id procedure you refer to is in apex_application_install, which is used for scripting installation of applications - not get/set of page ID like you're describing.
    If you're uncomfortable using apex_application.g_flow_id, you can use v('APP_ID') or preferably pass the app_id/page_id as parameters to your procedures.
    Your question seems to have a few unknowns, so that's the best I can describe.
    Scott

  • Web Service in Unit Test Client

    Hello all
       I have created a Web service in our Development client 200.(no auth type)
       We have a unit test client 210.
       I nned to test my Web Service in Unit test client 210.
      But In Soamanager, I could not see any service.
      Should I have create my service again in this Client ?
      In that case, what type Auth Method should I have to choose here ?
    Please help.
    Cheers
    RJ

    I have removed the other synchronous and asynchronous methods after generation and it caused the error. I did put them back.

  • [svn:osmf:] 10425: Add initial unit tests for VASTParser.

    Revision: 10425
    Author:   [email protected]
    Date:     2009-09-18 17:35:58 -0700 (Fri, 18 Sep 2009)
    Log Message:
    Add initial unit tests for VASTParser.  Minor changes to parsing code.
    Modified Paths:
        osmf/trunk/libs/VAST/org/openvideoplayer/vast/model/VASTAd.as
        osmf/trunk/libs/VAST/org/openvideoplayer/vast/model/VASTAdPackageBase.as
        osmf/trunk/libs/VAST/org/openvideoplayer/vast/parser/VASTParser.as
        osmf/trunk/libs/VASTTest/org/openvideoplayer/vast/VASTTests.as
    Added Paths:
        osmf/trunk/libs/VASTTest/org/openvideoplayer/vast/parser/
        osmf/trunk/libs/VASTTest/org/openvideoplayer/vast/parser/TestVASTParser.as

  • How to call Microsoft SQL User defined function??

    I am trying to call Miscrosoft SQL user defined function (not stored procedure) and experience problems. The function -- func_profile_history takes 3 inputs and returns resultSet.
    Please let me know if there is any examples some where. All the examples I found are for stored procedure.
    Thanks....
    Siu
    ************ source *************
    public Vector callSqlFunction(String eidTradcom, String idSku, String endDate, String idUserPost)
    throws TradcomException, RemoteException
    System.out.println("--------------in callSqlFunction--------------1");
    Connection conn = null;
    java.sql.CallableStatement cstmt = null;
    ResultSet rs = null;
    ForecastInfo info = null;
    Vector v = new Vector();
    try{
    conn = TradcomUtils.getConnection();
    String sql = "{call func_profile_history(?,?,?)}";
    System.out.println("--------------in callSqlFunction--------sql="+sql);          
    cstmt = conn.prepareCall(sql);
    System.out.println("--------------in callSqlFunction-------2");                         
    cstmt.setString(1, eidTradcom);
    cstmt.setString(2, idSku);
    cstmt.setString(3, endDate);
    System.out.println("--------------in callSqlFunction-------3");                    
    rs = cstmt.executeQuery();
    System.out.println("--------------in callSqlFunction-------4");                    
    while (rs.next()){
         info = new ForecastInfo ();
         info.setEidTradcom(rs.getString("eid_tradcom"));
         info.setIdSku(rs.getString("id_sku"));                    
         info.setQtOnHand(rs.getDouble("qt_on_hand"));                    
         info.setQtOnHold(rs.getDouble("qt_hold"));
         info.setQtNetOnHand(rs.getDouble("qt_net_on_hand"));
         info.setQtAlloc(rs.getDouble("qt_alloc"));
         info.setQtAvailUnalloc(rs.getDouble("qt_avail_unalloc"));     
         info.setQtPoShip(rs.getDouble("qt_po_ship"));
         info.setQtPoRcvd(rs.getDouble("qt_po_rcvd"));
         info.setQtTransit(rs.getDouble("qt_transit"));
         info.setQtAsn(rs.getDouble("qt_asn"));                    
         info.setQtPo(rs.getDouble("qt_po"));
         info.setQtPoBalance(rs.getDouble("qt_po_balance"));
         info.setQtSoShip(rs.getDouble("qt_so_ship"));     
         info.setQt4Cast(rs.getDouble("qt_4cast"));
         v.addElement(info);
    System.out.println("--------------in callSqlFunction-------5");     
    System.out.println("--------------in callSqlFunction-------v="+v);          
    return v;
    }catch(Exception ex){
    System.out.println("Error in callSqlFunction:"+ ex.getMessage());
    throw CachingManager.getTradcomException(ex, "Error in callSqlFunction");
    }finally{
    try{ if (cstmt != null) cstmt.close(); } catch(Exception ex){}
    try{ if (conn != null) conn.close(); } catch(Exception ex){}
    ********************* error output ***************
    ********************* bef calling callSqlFunction
    --------------in callSqlFunction--------------1
    --------------in callSqlFunction--------sql={call func_profile_history(?,?,?)}
    --------------in callSqlFunction-------2
    --------------in callSqlFunction-------3
    Error in callSqlFunction:The request for procedure 'func_profile_history' failed
    because 'func_profile_history' is a function object. Severity 18, State 1, Proc
    edure 'LAP_DUAL null', Line 4
    ERROR=Error in callSqlFunction...The request for procedure 'func_profile_history
    ' failed because 'func_profile_history' is a function object. Severity 18, State
    1, Procedure 'LAP_DUAL null', Line 4

    well, I tried the preparedStatemnet and it worked. Case closed.

Maybe you are looking for