Testing for

Hi,
Is there a more efficient way of writing this SQL, I know I can do it with 1 exist using an aggregate function such as count(1), just wonder if there's any other way;
select 1
from tableA a
where :param1 = 'true'
and exists (select 1
from tableB b
where b.colx = a.colx
or :param1 = 'false'
and not exists (select 1
from tableB b
where b.colx = a.colx
cheers

Hmmm... Then it ought to be possible to push the CASE into the where clause.
select distinct a.*
from tableA a, tableB b
where a.colx = b.colx(+)
AND 1 = (case
         when :param1 = 'true' and b.colx IS NOT NULL THEN 1
         when :param1 = 'false' and b.colx IS NULL    THEN 1
                                                      ELSE 0
         end)The DISTINCT should deal with those cases where b has multiple rows.

Similar Messages

  • XI testing for two SAP R/3 systems with same system id/logical system

    Hi
    We are currently in the process of upgrading our R/3 4.7 to ECC 6.0 and plan to maintain dual landscape for DEV & QA (4.7 & ECC 6.0) for a period  for testing and maintaining existing applications for fixes etc. The second DEV & QA (upgraded to ECC 6.0) are copy of respective systems and these systems are created automatically under technical systems in SLD by auto update (RZ70).
    The question is, can we use the same XI system for testing inbound/outbound interfaces for both the systems i.e 4.7 & ECC 6.0 at the same time.  I am aware of the fact that XI Technical/Business sytems dependent on unique logical systems, so we cannot create new business system for the upgraded DEV-II ECC 6.0 system. 
    For your information, we have two slds (one for XID/XIQ and second one for XIP).
    What are the options without disturbing & maintaining the current XI system set up?
    1) Can we change current Business systems e.g DEV010 to use new technical system i.e DEV-II ECC 6.0 for testing for a period and switch it back to DEV-I 4.7 technical system?
    2) or change logitical system name of DEV-II ECC 6.0 and create new business sytem in SLD without interfering the existing setup and modify/create interfaces to use this new business system?
    3) Do we need to refresh cache from time to time in XI ?
    4) Any other implications
    We will be upgrading XI to PI 7.1 after ECC 6. 0 Upgrade.
    Any views on this would be highly appreciated.
    Regards
    Chandu

    Hi
    Technical System was created in the SLD automatically after RZ70 configuration in the new DEV-II system. We then modified Business System to use the new Technical system and carried out following steps:
    1)     Original Idoc metadata was deleted from XID
    2)     The port definition  was deleted
    3)     A new port definition was created for new system
    4)     The metadata for each idoc type used was re-created in IDX2 , using METADATA -> CREATE
    5)     This brought in all known versions of the idoc segments, including the 7.1 version.
    I have already checked the guides suggested for our upgrade and we are thinking of going ahead with fresh installation and migrating the interfaces.
    Regards
    Chandu

  • How to test for différent Select into a single PL/SQL block ?

    Hi,
    I am relatively new to PL/SQL and I am trying to do multiple selects int a single PL/SQL block. I am confronted to the fact that if a single select returns no data, I have to go to the WHEN DATA_NOT_FOUND exception.
    Or, I would like to test for different selects.
    In an authentification script, I am searching in a table for a USER ID (USERID) and an application ID, to check if a user is registered under this USERID for this APPLICATION.
    There are different possibilities : 4 possibilities :
    - USERID Existing or not Existing and
    - Aplication ID found or not found for this particular USERID.
    I would like to test for thes 4 possibilities to get the status of this partiular user regardin this application.
    The problem is that if one select returns no row, I go to the exception data not found.
    In the example below you see that if no row returned, go to the exception
    DECLARE
    P_USERID VARCHAR2(400) DEFAULT NULL;
    P_APPLICATION_ID NUMBER DEFAULT NULL;
    P_REGISTERED VARCHAR2(400) DEFAULT NULL;
    BEGIN
    SELECT DISTINCT(USERID) INTO P_USERID FROM ACL_EMPLOYEES
    WHERE  USERID = :P39_USERID AND APPLICATION_ID = :APP_ID ;
    :P39_TYPE_UTILISATEUR := 'USER_REGISTERED';
    EXCEPTION
    WHEN NO_DATA_FOUND THEN
    :P39_TYPE_UTILISATEUR := 'USER_NOT_FOUND';
    END;I would like to do first this statement :
    SELECT DISTINCT(USERID) INTO P_USERID FROM ACL_EMPLOYEES
    WHERE  USERID = :P39_USERID Then to do this one if the user is found :
    SELECT DISTINCT(USERID) INTO P_USERID FROM ACL_EMPLOYEES
    WHERE  USERID = :P39_USERID AND APPLICATION_ID = :APP_ID ;etc...
    I basically don't want to go to the not found exception before having tested the 4 possibilities.
    Do you have a suggestion ?
    Thank you for your kind help !
    Christian

    Surely there are only 3 conditions to check?
    1. The user exists and has that app
    2. The user exists and doesn't have that app
    3. The user doesn't exist
    You could do this in one sql statement like:
    with mimic_data_table as (select 1 userid, 1 appid from dual union all
                              select 1 userid, 2 appid from dual union all
                              select 2 userid, 1 appid from dual),
    -- end of mimicking your table
             params_table as (select :p_userid userid, :p_appid appid from dual)
    select pt.userid,
           pt.appid,
           decode(min(case when dt.userid = pt.userid and dt.appid = pt.appid then 1
                           when dt.userid = pt.userid then 2
                           else 3
                      end), 1, 'User and app exist',
                            2, 'User exists but not for this app',
                            3, 'User doesn''t exist') user_app_check
    from   mimic_data_table dt,
           params_table pt
    where  pt.userid = dt.userid (+)
    group by pt.userid, pt.appid;
    :p_userid = 1
    :p_appid = 2
        USERID      APPID USER_APP_CHECK                 
             1          2 User and app exist   
    :p_userid = 1
    :p_appid = 3
        USERID      APPID USER_APP_CHECK                 
             1          3 User exists but not for this app
    :p_userid = 3
    :p_appid = 2
        USERID      APPID USER_APP_CHECK                 
             3          2 User doesn't exist  

  • How to test for existence of AcroXFA test objects?

    Hi -
    I'm writing scripts to test an XFA form with dynamic subforms.  For example, at the end of Part 4, the user hits a Validate button, and if their data is correct, then the Validate button disappears and a Part 5 subform appears.
    So my script looks something like this:
    Function GetButtonPart4Validate()
       Set GetButtonPart4Validate = PDFDoc("TestForm").AcroXFAForm("form").AcroXFAForm("form1")
    .AcroXFAForm("sfPart4").AcroXFAButton("sfValidate")
    End Function
    Function GetPart5()
       Set GetPart5 = PDFDoc("TestForm").AcroXFAForm("form").AcroXFAForm("form1").AcroXFAForm("sfPart5")
    End Function
    GetButtonPart4Validate().Click
    PDFDoc( "TestForm" ).WaitProperty "ready", true, 60000  ' Wait for event processing complete
    If DataTable("boolValidates", dtLocalSheet) = "TRUE"  Then
         If( GetPart5().Exist ) Then
              ' A: Checkpoint Succeeds: Validation was successful
         Else
              ' B: Checkpoint fails: Validation failed
         Endif
    Else
         If(  GetPart5().Exist ) Then
              ' C: Checkpoint Fails:  Validation was unexpected
         Else
               ' D: Checkpoint Succeeds:  Validation failed as expected
         Endif
    Endif
    Unfortunately it appears that XfaSubForm.Exist always returns TRUE.  In other QTP testing domains (eg "Exist Property (WinObject)" in QTP Help), the documented behaviour of the Exist property is to be true if the desired test object can be found in the application-under-test. Typically this means that when the script tries to access an XFA widget which doesn't exist (even something like GetPart5().getROProperty("visible") ), the script stops and thinks for a minute or so, and eventually produces a test error that the object doesn't exist then muddles onward. It is the "stops and thinks for a minute or so" which frustrates me, since these are delays which I am trying to avoid.
    Another possible angle I looked into was counting the subforms under Part 5's parent.
    PDFDoc("TestForm").AcroXFAForm("form").AcroXFAForm("form1").RefreshObject
    PDFDoc("TestForm").AcroXFAForm("form").AcroXFAForm("form1").AcroXFAForm("sfPart5").Refresh Object
    ' check to see if there is a 'sfPart5'
    Dim MyChildren, i
    Set MyChildren = PDFDoc("TestForm").AcroXFAForm("form").AcroXFAForm("form1").ChildObjects
    For i=0 to MyChildren.Count - 1
        print i & " name=" & MyChildren(i).GetROProperty("name")
    Next
    This also seems to fail:  Part5 doesn't appear among its parent's children (at least before QTP actually tries to use it).
    The PDF Test Toolkit User Guide doesn't specifically mention that Exist or RefreshObject or ChildObjects are implemented, so I can't say AcroQTP isn't working as designed, but if you're looking for suggestions for improvement, I'll vote for fulfilling these parts to the QTP.  Please confirm my conclusions that these are not properly implemented, or whether I'm missing something.
    In the meantime, do you have any recommendation on how to proceed?  My present workaround is to look for a "validation error" windows dialog that indicates Part 5 won't exist, but this won't work in future test scripts.
    Cheers,
    Brent

    Hi,
    816387 wrote:
    ... QUERY:-  Find all customers who have at most one account at the Perryridge branch.
    SOLUTION *1* :-
    select customer_name
    from depositor,account
    where account.account_number=depositor.account_number and
    branch_name='Perryridge'
    group by customer_name
    having count(account.account_number) <=1
    ok running correctly
    That finds customers who have exactly one account at Perryridge.
    The assignment is to find customers who have at most one account at Perryridge. You need to include customers with 0 accounts at Perryridge, as well. You could use an outer join, or MINUS, or a NOT IN subquery, or a NOT EXISTS sub-query (as mentioned above) to do that.
    Can there be customers who have no accounts at all, at any branch? If so, you'll need to use the customer table in this problem, as well as depositor and account.
    >
    SOLUTION *2* :-
    select D1.customer_name
    from depositor D1
    where unique
    (select customer_name
         from depositor D2,account A1
         where D1.customer_name=D2.customer_name
              D2.account_number=A1.account_number and
              branch_name='Perryridge'
    gives error:-
    where unique
    ..........*^*
    ERROR at line 3:
    ORA-00936: missing expression
    Logic of both solution are correct . But Solution 2 gives error in oracle. I want unique construct to work.Sorry, it doesn't in Oracle. I don't know of anything like that in Oracle.
    Does "WHERE UNIQUE (SELECT ...)" work in some other database system? Which?
    How to do it. Or How can i test for the absence of duplicate tuples ??????
    Your Solution 1 is the best way to find customers with exatly 1 account (rather than 0 or 1 accounts) at Perryridge. Is there any reason why you wouldn't want to use it, if you ever needed to find customers with exactly one account there?

  • Testing for IS NOT NULL with left join tables

    Dear Experts,
    The query is showing the NULL rows in the query below....
    Any ideas, advice please? tx, sandra
    This is the sql inspector:
    SELECT O100321.FULL_NAME_LFMI, O100321.ID, O100404.ID, O100321.ID_SOURCE
    , O100404.NAME, O100321.PERSON_UID, O100404.PERSON_UID, O100404.VISA_TYPE
    FROM ODSMGR.PERSON O100321
    , ODSMGR.VISA O100404
    WHERE ( ( O100321.PERSON_UID = O100404.PERSON_UID(+) ) ) AND ( O100404.VISA_TYPE(+) IS NOT NULL )

    Hi Everyone,
    I am understanding alot of what Michael and Rod wrote.... I am just puzzled over the following:
    the query below is left joining the STUDENT table to
    HOLD table.
    The HOLD table - contains rows for students who have holds on their record.
    a student can have more than one hold (health, HIPAA, basic life saving course)
    BUT, for this query: I'm only interested that a hold exists, so I'm choosing MAX on hold desc.
    Selecting a MAX, helps me, bec. it reduces my join to a 1 to 1 relationship, instead of
    1 to many relationship.
    Before I posted this thread at all, the LEFT JOIN below testing for IS NOT NULL worked w/o
    me having to code IS NOT NULL twice....
    Is that because, what's happening "behind the scenes" is that a temporary table containing all max rows is being
    created, for which Discoverer has no predefined join instructions, so it's letting me do a LEFT JOIN and have
    the IS NOT NULL condition.
    I would so appreciate clarification. I have a meeting on Tues, for which I have to explain LEFT JOINS to the user
    and how they should create a query. I need to come up with rules.
    If I feel "clear", I asked my boss to buy Camtasia videocast software to create a training clip for user to follow.
    Also, if any Banner user would like me to email the DIS query to run on their machine, I would be glad to do so.
    thx sooo much, Sandra
    SELECT O100384.ACADEMIC_PERIOD, O100255.ID, O100384.ID, O100255.NAME, O100384.NAME, O100255.PERSON_UID, O100384.PERSON_UID, MAX(O100255.HOLD_DESC)
    FROM ODSMGR.HOLD O100255, ODSMGR.STUDENT O100384
    WHERE ( ( O100384.PERSON_UID = O100255.PERSON_UID(+) ) ) AND ( O100384.ACADEMIC_PERIOD = '200820' )
    GROUP BY O100384.ACADEMIC_PERIOD, O100255.ID, O100384.ID, O100255.NAME, O100384.NAME, O100255.PERSON_UID, O100384.PERSON_UID
    HAVING ( ( MAX(O100255.HOLD_DESC(+)) ) IS NOT NULL )
    ORDER BY O100384.NAME ASC

  • How do I test for the presence of an active open document in Photoshop?

    I’m new to Adobe scripting, and one of my first scripts deals with the activeDocument in Photoshop.
    If there is no activeDocument, I want to display a message and terminate the script.  My efforts
    so far have been met with frustration.  While developing the script in ExtendScript Toolkit,
    I used the  test expression "activeDocument in app", and everything worked as expected. And when I installed the script
    in the Photoshop scripts folder and ran it from Photoshop with a document open, it also worked.
    But when I ran the script from Photoshop with no document open, it failed.
    Moreover, after that,the script failed when I tried to run it in ESTK.
    I did some testing and found that my test expression, "activeDocument in app"
    was returning true, even though no document was open.
    Still in ESTK, I replaced the “app” with ”Application” in the test expression.  That worked when
    I stepped through the script.  But when I tried to run it without stopping, it stopped at the
    test expression, and displayed the error message, “Application is undefined.”
    So how do I test for the presence of an open document in Photoshop ??

    After posting this, I discovered the Photoshop Scripting Forum, and I found my answer there.—
    I should have used “app.Documents.length” as my test expression.

  • Best practice standard User Acess Test for WIN2012 AD

    What is the Best practice standard User Acess Test  for WIN2012 AD

    Hello,
    as before, add a computer to the domain and log on with a domain user account to the computer.
    You should be able from the client machine to open the sharedfolders on the DCseither with:
    \\DCName\sysvol
    \\DCName\netlogonor \\NetBiosDomainName\sysvol
    \\NetBiosDomainName\netlogon
    Best regards
    Meinolf Weber
    MVP, MCP, MCTS
    Microsoft MVP - Directory Services
    My Blog: http://blogs.msmvps.com/MWeber
    Disclaimer: This posting is provided AS IS with no warranties or guarantees and confers no rights.
    Twitter:  

  • I was an apple beta tester for iOS7 and now my iPhone 5 shut down, it's unresponsive it gets recognized by iTunes when plugged into the computer but that's it. Since I was a beta tester is there any way to fix my iPhone??

    I was an apple beta tester for iOS7 and now my iPhone 5 shut down, it's unresponsive it gets recognized by iTunes when plugged into the computer but that's it. Since I was a beta tester is there any way to fix my iPhone??

    Are you still running iOS 7 bet?. If so go to the private developer section for help. We cannot help you here with beta software.

  • Linkage Error in Mapping and Operation mapping testing for Synchronous in NWDS

    Dear Experts,
    Hope you all are doing fine..
    I am working in a synchronous scenario Proxy via SAP PI 7.4 to JAVA Application supporting JSON.I wrote JAVA program to convert JSON to XML and while performing test for the JAVA mapping in response structure at Operation Mapping,I am receiving following error..
    LinkageError at JavaMapping.load(): Could not load class: json2xml/bin/pack/EsrJson2Xml
    java.lang.NoClassDefFoundError: json2xml/bin/pack/EsrJson2Xml (wrong name: pack/EsrJson2Xml) at
    java.lang.ClassLoader.defineClass1(Native Method) at java.lang.ClassLoader.defineClassCond(ClassLoader.java:735)
    at java.lang.ClassLoader.defineClass(ClassLoader.java:716) at java.lang.ClassLoader.defineClass(ClassLoader.java:537)
    at com.sap.aii.ib.server.mapping.execution.MappingLoader.findClass(MappingLoader.java:195)
    at java.lang.ClassLoader.loadClass(ClassLoader.java:372) at java.lang.ClassLoader.loadClass(ClassLoader.java:313)
    I followed some of discussions for the Linkagae error http://scn.sap.com/thread/1418477 but could not help..
    Following are details of my NWDS and PI server:
    SAP NetWeaver Developer Studio
    SAP Enhancement Package 1 for SAP NetWeaver Developer Studio 7.3 SP10 PAT0000
    Compiled the project with JAVA SE-1.6 as well as 1.5
    SAP PO 7.4 Java Only , Release: NW731CORE_10_REL
    SP: 05 JDK: jdk16 Latest Change: 353688
    I have taken care to export all the Jar files used in NWDS to be exported and then imported as Archived files in PI server.
    But could not see the 5 jar files in ESR. I hope there is some issue with name as can see in the log.Can the issue be solved?
    How to test the Operation mapping for Synchronous Message in NWDS?
    Regards
    Rebecca

    Dear Hareesh and Experts,
    I resolved the issue by doing the below steps.
    1. Downloaded the JDK5 and updated the Java console i.e. JRE 15.
    2. I had  created this project using the JAVA Compiler with JAVA SE1.6 initially. Changed this to 1.5 in the Properties of the Project.
    3. Uploaded the project again in ESR Imported Archive.
    The issue is solved.
    Thanks a lot for all your inputs.

  • HT201380 Yesterday this was automatically installed.  Today I can't access a document in Pages.  A prompt says I need a Pages update.  But the next screen tests for updates and informs me everything is up to date.  What's up?

    Yesterday this was automatically installed.  Today I can't access a document in Pages.  A prompt says I need a Pages update.  But the next screen tests for updates and informs me everything is up to date.  What's up?

    It's highly unlikely that the Pages update problem has anything to do with the ARD client update, since the client is not involved in any way with Software Update. I'd suggest asking for assistance with the update problem in the forum appropriate for your version of Mac OS X.
    Regards.

  • SESSION VARIABLES : HOW TO TEST FOR MULTIPLE USERS

    I have a username session variable set up on a localhost testing envirnoment.
    This works fine for one user, but when I open another occurence of the browser (or just another tab) to test for multiple users the system overwrites the session variable with the last username input.
    So the question is:
             Why doesn't dreamweaver hold an instance of the session variable for each browser session? and if not what are your suggestions?
    Thanks
    Adam.

    Thanks for that.
    After scouring the internet I found the only way of running 2 instances of firefox  without them sharing the session variables is to create 2 new firefox profiles in windows + set the MOZ_NO_REMOTE environment variable.
    Internet explorer is much easier as it has a 'new session' option in the file menu, but seems to have more trouble displaying tables correctly.
    Hope this helps anyone with a similar problem.

  • [svn:osmf:] 13916: Added DynamicDRMTrait, Composite Unit tests for parallel and serial compositions.

    Revision: 13916
    Revision: 13916
    Author:   [email protected]
    Date:     2010-02-01 16:42:09 -0800 (Mon, 01 Feb 2010)
    Log Message:
    Added DynamicDRMTrait, Composite Unit tests for parallel and serial compositions.  Bug fixes in CompositeDRMTrait.
    Modified Paths:
        osmf/trunk/framework/OSMF/org/osmf/composition/CompositeDRMTrait.as
        osmf/trunk/framework/OSMFTest/org/osmf/OSMFTests.as
        osmf/trunk/framework/OSMFTest/org/osmf/utils/DynamicMediaElement.as
    Added Paths:
        osmf/trunk/framework/OSMFTest/org/osmf/composition/TestParallelElementDRMTrait.as
        osmf/trunk/framework/OSMFTest/org/osmf/composition/TestSerialElementDRMTrait.as
        osmf/trunk/framework/OSMFTest/org/osmf/utils/DynamicDRMTrait.as

  • Unit tests for Swing models?

    Does anyone know if someone has made some unit test to test the various Swing models?
    I didn't find much in a search and checking the OpenJDK6 source bundle there are only about 20 tests (!) for specific bugs.
    Specifically I'm looking for a test for TreeModel to test Jide's FilterableTreeModel (I filed a bug so maybe they'll write a test though :) ). SwingX has a nice helper class TreeModelReport but the actual test is not that complete.

    Walter Laan wrote:
    SwingX has a nice helper class TreeModelReport but the actual test is not that complete.what do you mean by "not complete" - SwingX has no special TreeModel, so nothing much to test :-) should have some TreeTableModel related tests, though. Not sure how complete they are ...
    CU
    Jeanette

  • Automation testing for sap bw backend

    Hello Gurus,
               do you have some idea for automation testing of sap bw backend?
    Many thaniks

    Hi,
    If you are looking about data reconcolization or Data testing between ECC and BW  then I already given solution in your previous thread. i.e. Who will involve in UAT thread.
    Automation testing for sap bw backend: What testing?. We don't have such kind of concept, for Java, VB etc  applications they will test all fields and code, but we don't  have automation testing for sap bw backend.
    Thanks
    Reddy

  • How can I test for the bas unit enterd in a control?

    How can I to create a polymorphic vi where the user can enter either volume or temperature.
    how can Labwiev test for the base unit entered
    pseudocode example:
    input X
    if X.base_unit == m^3 do ....... 
    thanks for any suggestion to resolve or avoid my problem
    Solved!
    Go to Solution.

    Hi schaerm,
    you have to dig deeper.
    An idea is this one:
    The red marked word is containing the unit - in a coded way. Somewhere in the LV help you can find the description of this coding (I remember a chapter on memory representations of all LV datatypes...). (There surely is an easier or better way - but the example is done quic&dirty.)
    You can also format the number into a string and analyze the unit here...
    Message Edited by GerdW on 02-07-2010 07:21 PM
    Best regards,
    GerdW
    CLAD, using 2009SP1 + LV2011SP1 + LV2014SP1 on WinXP+Win7+cRIO
    Kudos are welcome

  • Mid 2007 24"imac test for bad capasitors

    mid 2007 24" imac test for bad capasitors

    I might recommend that you boot from your Original Installation Disk that came with your iMac and run the AHT (Apple Hardware Test) or the Extended Apple Hardware Test in order to check for hardware faults in your system.  That may put your mind at rest.
    Hope this helps

Maybe you are looking for

  • How to upload local photos to icloud photo library

    with the new icloud photo library(beta) that was introduced in iOS 8.1, I tried to turn it on to upload my photos on my iphone 6 to icloud drive, but it warned me those photos I uploaded from my mac to my iphone will be removed..... So does it only u

  • Mandatory fields to replicate vendor from ECC to SRM

    Hi all, I created a vendor in ECC with all mandatory fields. But when I tried to replicate the vendors to SRM from ECC, I am getting errors like mandatory fields are missing. Can you please tell me what are the mandatory fields in SRM when we replica

  • Can't download cc apps. They won't show up on the creative cloud app.

    After several problems trying to install the Creative cloud app I finally got it to install after booting into safe mode. Now that CC is installed when I click on the tabs application tab it doesn't work. I also tried downloading it from the website

  • Grafikfehler bei mavericks in safari und in andern Fenstern bei spielen

    Hallo Seit ich Update gemacht habe auf Mavericks, habe ich wenn ich safari nutze oder ein spiel spiele in dem fenster ein zucken der grafik im bildschirm beim scrollen hoch und runter was sehr auf die augen geht. Ist das ein bug oder stimmt was nicht

  • Help with column source_action_id in table pay_assignment_actions

    I've searched all over and cannot find the true meaning of column source_action_id in table pay_assignment_actions. More to the point, I've inherited code that runs a relatively simple query to retrieve all specific payroll dates from pay_payroll_act