Find a record that doesnt exist and display a message

When I run the following query why wont it display the word 'FAIL'.
SELECT
  CASE
    WHEN table_name IN('DBA_OBJECTS') THEN 'PASS'
    ELSE 'FAIL'
  END TABLE_EXISTS
FROM dictionary
WHERE table_name = 'DBA_OBJECT'
;Ben

Hi Benton,
The query filter (WHERE table_name = 'DBA_OBJECT') cause zero record to be returned.
To trick you can use aggregate function which always return single record even if record is found or not. If no record is found then NULL is returned.
SQL> SELECT CASE WHEN MAX(table_name) IN('DBA_OBJECTS') THEN 'PASS' ELSE 'FAIL' END TABLE_EXISTS -- OR NVL2(MAX(table_name),'PASS','FAIL') TABLE_EXISTS
  2  FROM dictionary
  3  WHERE table_name = 'DBA_OBJECT'
  4  AND ROWNUM = 1
  5  /
TABLE_EXISTS
FAIL
{code}                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                           

Similar Messages

  • Scan through the records in the Form and display the message!

    Hello Everyone,
    We have a requirement, I do not know how to achieve it.
    In a Forms 6i, 2 fields Type, Comment.
    Type is a list of Values (1,2,3)
    Comment - Free Text Field.
    User can enter as much rows of data, but while user saves the data we have to validate that all the records of Same Type(Say 1). If not we have to display a Message.
    So how to achieve this? How to scan through the records in the Form. Any comments on it would be great.
    Thanks.

    User can enter as much rows of data, but while user saves the data we have to validate that all the records of Same Type(Say 1). If not we have to display a Message.I am assuming that you want to check from the first record. Suppose in first record the user coosed 1 and you will check for all the entries for 1.
    Couple of ways to do this.
    1. While user is entering first record. You can keep that selected type value in GLOBAL variable and while he is entering further records you can match type with that global variable. If it is not matching then you can display message.
    2. On KEY-COMMIT trigger you can start loop from first record and can check for all the records one by one. Like.
    DECLARE
      vVal DATATYPE;
    BEGIN
      GO_BLOCK('BLOCK_NAME');
      FIRST_RECORD;
      vVal:=:FORM_TYPE_FIELD;
      LOOP
        IF vVal!=:FORM_TYPE_FIELD THEN
          MESSAGE(..);
          EXIT;
        END IF;
        EXIT WHEN :SYSTEM.LAST_RECORD='TRUE';
        NEXT_RECORD;
      END LOOP;
    END;I would go for earlier approach and will use WHEN-VALIDATE-ITEM / PRE-INSERT for type field for this purpose. Because in KEY-COMMIT the system is doing same thing again.
    -Ammad
    Edited by: Ammad Ahmed on May 15, 2010 12:23 AM
    changes not equal sign to !=

  • When i try to instal itunes on pc i get this message.      This installation pack could not be opened. Verify that package exists and that you can access it or contact application vendor to verify that this is a valid windows installation pack.  HELP

    when i try to instal itunes on pc i get this message. This installation pack could not be opened. Verify that package exists and that you can access it or contact application vendor to verify that this is a valid windows installation pack. PLEASE HELP

    Hello annesmith1954,
    Thank you for using Apple Support Communities. 
    You can use the information in the following article to troubleshoot your installation issues with installing iTunes on your PC. 
    "Could not open key" message when installing iTunes or Apple components for Windows
    Regards,
    Jeff D. 

  • My Ipad is locked and display a message that says " The Ipad hasnt been backed up in 2 weeks...........connected to wifi".  How do I come out of it?

    My Ipad is locked and display a message that says " The Ipad hasnt been backed up in 2 weeks...........connected to wifi".  How do I come out of it?

    Reset iPad
    Hold down the Sleep/Wake button and the Home button at the same time for at least ten seconds, until the Apple logo appears
    Note: Data will not be affected.

  • Can't reinstall osx lion from internet, and display a message"cannot find installation information ,please contact applecare, what should i do?

    hello
    I can't reinstall osx lion from internet, and display a message"cannot find installation information ,please contact applecare, what should i do?
    thanks

    I'm no Lion expert, but I believe you can boot from the Recovery partition by pressing the Command and R keys on startup, then reinstall.

  • Hi today i bought an itun gft card from shop  ,but i found it doesnt work and display "the code has not been proprly activted". why and how to fix it up

    hi today i bought an itun gft card from shop  ,but i found it doesnt work and display "the code has not been proprly activted". why and how to fix it up

    The people at the store the gift card came from didn't activate it. Ask them or the iTunes Store staff for assistance.
    (122684)

  • I tried to import a perfectly crisp unpixelated screen recording to iMovie and when it imported it became very pixelated and fuzzy I tried exporting it but it was still fuzzy! I looked back at the original recording that wasnt imported and it wasnt fuzzy.

    I tried to import a perfectly crisp unpixelated screen recording to iMovie and when it imported it became very pixelated and fuzzy I tried exporting it but it was still fuzzy! I looked back at the original recording that wasnt imported and it wasnt fuzzy.

    I solved it. When I imported I hit the optimise large button instead just stay to the original.

  • How to stop a process from running and display a message

    I have a button that inserts data into a table based on bind variable selected on the page. I would like to add code to that button that will check to see if certain data already exists in the table, for that bind variable, and if that data already exists, stop the process and display a message that says "you have already inserted that information - bla bla bla". If not, continue inserting. What would be the best way to do this?
    Currently, the button is a plsql that inserts the data.
    Any help or examples would be greatly appreciated!
    mholman
    Edited by: user10488561 on Jul 27, 2009 8:48 AM

    Use a validation process for that. If the validation fails (data exists) the processes will not be run. If it doesn't then the processing will continue.
    Denes Kubicek
    http://deneskubicek.blogspot.com/
    http://www.opal-consulting.de/training
    http://apex.oracle.com/pls/otn/f?p=31517:1
    ------------------------------------------------------------------------------

  • How to validate VO result and display error message?

    Hi,
    I have created 2 pages:
    Page 1: User to enter employee number and click 'Go' button to search (redirect to Page 2)
    Page 2: To display employee details
    In situation where employee is suspended, employee detail will be display as blank in Page 2.
    At the same time, we would like to display error message which inform user to refer to HR Department for this scenario.
    Need guidance on how to perform the validation and display error message.
    Thanks and Regards,
    Shiau Chin

    Hi Shiau,
    In this case instead of redirecting to next page, throw an exception on the same page.
    If you want redirect it to next page then while redirecting it to next page pass some info that can indicate that employee is suspended, get this value in Process request if it has value then throw exception else query details.
    Regards,
    Reetesh Sharma

  • I have created a DVD via iMovie and burned several copies. When played the DVD's will stop and display a message SKIPPING DAMAGED Part. It is not the DVD. When trying to export the project, I get an error message.

    I have created a DVD via iMovie and burned several copies. It is a large file. When played the some DVD's will stop and display a message SKIPPING DAMAGED Part but will not resume. Some work fine.  It is not the DVD. I have burned from several batches. When trying to export the project, I get an error message with the following message: The project could not be prepared for publishing because an error occured (-108).

    TV video typically is copyrighted content.  We'd be breaking several rules trying to help you.  Good luck!

  • I have been using CS6 for two years without incident.  Suddenly the Media Encoder stops working, showing APPCRASH and displaying error message about WatchFolder.dll - I tried uninstalling and re-installing to no avail - can anyone help

    I have been using CS6 for two years without incident.  Suddenly the Media Encoder stops working, showing APPCRASH and displaying error message about WatchFolder.dll - I tried uninstalling and re-installing to no avail - can anyone help?

    Hi Mylenium,
    Thanks for your response.
    Here is the error information showing up:
    Problem signature:
      Problem Event Name: APPCRASH
      Application Name: Adobe Media Encoder.exe
      Application Version: 6.0.0.382
      Application Timestamp: 4f62fcf1
      Fault Module Name: WatchFolder.dll
      Fault Module Version: 6.0.0.382
      Fault Module Timestamp: 4f62f37f
      Exception Code: c0000005
      Exception Offset: 0000000000007899
      OS Version: 6.1.7601.2.1.0.768.3
      Locale ID: 4105
      Additional Information 1: 9a62
      Additional Information 2: 9a620826d8ae4a2fa8b984b39290a503
      Additional Information 3: 1fb3
      Additional Information 4: 1fb304eee594288faeefbf1271b70d37
    I am using a PC Windows 7

  • Pacman -Ss dont find a package that actually exists -gstreamer0.10-mad

    Hi everyone. I'm new to Archlinux but not to Linux. I had problems to play mp3s on rhythmbox cause the appropiate gstreamer plugin to decode mp3 was not installed, so i search with pacman:
    pacman -Ss gstreamer
    . And it find some packages related to gstreamer but not gstreamer0.10-mad and some others like *-vorbis for instance. So i tried installing one by one gstreamer packages appearing in pacman results and openning rhythmbox to see if it works, but it didnt with some tries, so searching google realized that the package gstreamer0.10-mad was neccesary to play mp3s by gstreamer and installed it by pacman -S ... The thing is that when i need a new package or app but didnt know package's name, i obviously search it by pacman -Ss, but problems like this would make my mind to say that searched app or package doesnt exists in archlinux repositories.
    So, there's another pacman option to correctly do that?, or its just a bug with some packages?. Thanks a lot

    Nope.
    "Provides" here just means that the "gstreamer0.10-ugly-plugins" provides the same functionality as "gstreamer0.10-mad". When an application says "I need gstreamer0.10-mad", "gstreamer0.10-ugly-plugins" steps in and says "I can do everything that "...-mad" can do and more, use me instead.
    In your case you need certain libraries. Those libraries are in the "...-ugly-plugins" package. There is no way to search each package for every single library it contains without downloading it, but in this case because there's a "provides" line, pacman is able to figure out what will do what you need when you search for "...-mad" directly, even though there is no such package (nor group).
    I agree that you should be able to search for "provides" equivalents though.

  • Trying to find a record that does not have an event created for it

    Post Author: tzinser
    CA Forum: Formula
    A little background on how it works....
    We create a record, and everytime it is created, a number of "events" within that record are automatically created.  The specific event I am trying to run a report on is "REC".  I can run a report and get the information entered into the REC event no problem, but my problem is that if someone deletes the "REC" event it does not show up in my report.
    So my question is, what is the best way to write a function that displays all records that have the "REC" event, and all records that the "REC" event is missing.
    I'm using the generic funtion {EVENT.EventCode} = "REC"  right now....any suggestions?

    Post Author: tzinser
    CA Forum: Formula
    Okay, I left off a lot of important information...
    I'm using two tables
    TWDATA
    EVENT
    From TWDATA I'm pulling the fields TWDATA.OrderNumber and TWDATA.DisbursementDate
    From EVENT I'm pulling the fields EVENT.EventCode and EVENT.CompletedDate
    The two tables are linked by OrderNumber.

  • Find duplicate records withouyqusing group by and having

    I know i can delete duplicate records using an analytic function. I don't want to delete the records, I want to look at the data to try to understand why I have duplicates. I am looking at tables that don't have unique constraints (I can't do anything about it). I have some very large tables. so I am trying to find a faster way to do this.
    for example
    myTable
    col1 number,
    col2 number,
    col3 number,
    col4 number,
    col5 number)
    My key column is col1 and col2 (it is not enforced in the database). So I want to get all the records that have duplicates on these fields and put them in a table to review. This is a standard way to do it, but it requires 2 full table scans of very large tables (many, many gigabtytes. one is 150 gbs and not partitioned), a sort, and a hash join. Even if i increase sort_area_size and hash_area_size, it takes a long time to run..
    create table mydup
    as
    select b.*
    from (select col1,col2,count(*)
    from myTable
    group by col1, col2
    having count(*) > 1) a,
    myTable b
    where a.col1 = b.col1
    and a.col2 = b.col2
    I think there is a way to do this without a join by using rank, dense_rank, or row_number or some other way. When I google this all I get is how to "delete them". I want to analyze them a nd not delete them.

    create table mytable (col1 number,col2 number,col3 number,col4 number,col5 number);
    insert into mytable values (1,2,3,4,5);
    insert into mytable values (2,2,3,4,5);
    insert into mytable values (3,2,3,4,5);
    insert into mytable values (2,2,3,4,5);
    insert into mytable values (1,2,3,4,5);
    SQL> ed
    Wrote file afiedt.buf
      1  select * from mytable
      2   where rowid in
      3  (select rid
      4      from
      5     (select rowid rid,
      6              row_number() over
      7              (partition by
      8                   col1,col2
      9               order by rowid) rn
    10          from mytable
    11      )
    12    where rn <> 1
    13* )
    SQL> /
          COL1       COL2       COL3       COL4       COL5
             1          2          3          4          5
             2          2          3          4          5
    SQL>Regards
    Girish Sharma

  • Deployment Package fail to copy on an update that doesnt exist

    I have a deployment package that is getting a error saying the source directory for a update doesnt exist. I look at the members of the deployment package and there are no errors in the package itself. I look at the ID that was provided in the error but
    it doesnt match any of the Unique Update IDs in the package or any update in my All software update list at all. I am wondering how I can clear this? Am I missing something on the IDs that I should be looking elsewhere for the answers? Or am I stuck recreating
    the deployment package?
    Any thoughts or ideas would be helpful.

    The update was in my server package but not in my workstation package for some reason. We had this setup for many of other without any problems. With Torsten's query I was able to get the update that was having the problem and copied it from the server
    download folder to the workstation and it worked. Thanks Torsten for the help

Maybe you are looking for