I have a field I want to have a sql statemnet validate the data entered....

What I have is a field that I want 5 acceptable entries, and only those entries able to be submitted. So if the acceptable entry is dog and someone enters cat, I want to force an error.
Anyone want to show me how easy it is?

One way the function could be written is: (this returns a BOOLEAN, so select a function that returns BOOLEAN)...also, there are many other ways to write the same thing, you could use exists or an exception that uses the no_data_found error, too....You can specify your error message in the validation process.
This is one way...using FIELD1 as the field from ITEMS that you are testing against, assuming that you have 5 records in ITEMS, that each are valid for your P1_TEST_ITEM field:
declare
v_cnt number;
begin
select count(rownum) from ITEMS
where FIELD1 in (:P1_TEST_ITEM);
if v_cnt>0 then
return true;
else
return false;
end if;
exception
when others
return false;
end;
Now, if you have a list of 5 items that never change, you could also do it like this:
declare
v_cnt number;
begin
if :P1_TEST_ITEM in ('DOG','ITEM2','ITEM3'...)
then
return true;
else
return false;
end if;
exception
when others
return false;
end;
I guess I am not exactly sure why you don't want to use a LOV, that would be simple if all of your items are in your ITEMS table, then all you would have to do is create the LOV as
select item_no d, item_no r
from ITEMS
order by 1
you could further limit this to 5 items with a where clause ... where item_no in ('DOG','ITEM2'...)
Message was edited by:
DJMiller

Similar Messages

  • Don't have proper privilege to change the date and time. Group Policy does not work

    Hello All,
    I have configure group policy to change date and time only administrator. The problem is Windows XP machine cannot view the calendar but windows 7 can. So i need to view the calender for windows XP machine.
    Error: you do not have proper privilege to change the date and time.  
    Please suggest.
    Thanks

    Hi Parvez,
    Before going further:
    I applied a VM Windows XP pro. When I logged in as a local admin, I can view the calendar from the right corner of desktop or from control
    panel. However, when I logged in as a normal user account, I received the same message as yours.
    For now:
    I know this is not what you want. However, for normal users to view calendar, we can consider to give
    Change System Time permissions to these users.
    In addition, regarding this topic, the following article and thread can be referred to for more information.
    You cannot set the date, time, or time zone on your computer
    http://support.microsoft.com/kb/300022/en-us
    Check windows calendar in XP pro without admin rights
    http://community.spiceworks.com/topic/100116-check-windows-calendar-in-xp-pro-without-admin-rights
    Please Note: Since the second website is not hosted by Microsoft, the link may change without notice. Microsoft does not guarantee the accuracy of this information.
    Best regards,
    Frank Shen

  • I need to rebuld the "C" drive on my computer will need to reinstall adobe cs6 when I am done, but have moved recently and lost the data to get that done. Help!

    I need to rebuld the "C" drive on my computer will need to reinstall adobe cs6 when I am done, but have moved recently and lost the data to get that done! Help!

    Downloads available:
    Suites and Programs:  CC 2014 | CC | CS6 | CS5.5 | CS5 | CS4 | CS3
    Acrobat:  XI, X | 9,8 | 9 standard
    Premiere Elements:  13 |12 | 11, 10 | 9, 8, 7
    Photoshop Elements:  13 |12 | 11, 10 | 9,8,7
    Lightroom:  5.7| 5 | 4 | 3
    Captivate:  8 | 7 | 6 | 5
    Contribute:  CS5 | CS4, CS3
    Download and installation help for Adobe links
    Download and installation help for Prodesigntools links are listed on most linked pages.  They are critical; especially steps 1, 2 and 3.  If you click a link that does not have those steps listed, open a second window using the Lightroom 3 link to see those 'Important Instructions'.window using the Lightroom 3 link to see those 'Important Instructions'.

  • HT1212 My ipod is disabled and the message requests to try again in 223004 minutes.  I think it might have something to do with the date being set wrong before it went into disabled mode.  Can you assist in enabling.

    My ipod is disabled and the message requests to try again in 223004 minutes.  I think it might have something to do with the date being set wrong before it went into disabled mode.  Can you assist in enabling.

    You'll need to connect it to the iTunes library you normally sync it with and restore it.  If iTunes asks you for this passcode before it will let you proceed, connect the iPod to iTunes in recovery mode instead using the instructions in this Apple support document.
    iOS: Unable to update or restore
    B-rock

  • We are using EBS 12.1.3.  When we input a sales order from a customer we input the sales order and specify the date the customer wants it.  This isn't always the date that we intend on manufacturing it though.  I need to put a customer due date in, but be

    We are using EBS 12.1.3.  When we input a sales order from a customer we input the sales order and specify the date the customer wants it.  This isn't always the date that we intend on manufacturing it though.  I need to put a customer due date in, but be able to put a date in another field that MRP can read in the event we choose to manufacture based on another date.  For example, early.
    Any help would be appreciated.

    What you are experiencing is 100% related to Malware.
    Sometimes a problem with Firefox may be a result of malware installed on your computer, that you may not be aware of.
    You can try these free programs to scan for malware, which work with your existing antivirus software:
    * [http://www.microsoft.com/security/scanner/default.aspx Microsoft Safety Scanner]
    * [http://www.malwarebytes.org/products/malwarebytes_free/ MalwareBytes' Anti-Malware]
    * [http://support.kaspersky.com/faq/?qid=208283363 TDSSKiller - AntiRootkit Utility]
    * [http://www.surfright.nl/en/hitmanpro/ Hitman Pro]
    * [http://www.eset.com/us/online-scanner/ ESET Online Scanner]
    [http://windows.microsoft.com/MSE Microsoft Security Essentials] is a good permanent antivirus for Windows 7/Vista/XP if you don't already have one.
    Further information can be found in the [[Troubleshoot Firefox issues caused by malware]] article.
    Did this fix your problems? Please report back to us!

  • How to enable/disable the input fields based on the data entered/user action in the web dynpro abap?

    How to enable/disable the input fields based on the data entered in the web dynpro application abap?  If the user enters data in one input field then only the next input field should be enabled else it should be in disabled state. Please guide.

    Hi,
    Try this code.
    First create a attribute with the name readonly of type wdy_boolean and bind it read_only property of input field of which is you want to enable or disable.
    Next go to Init method.
    Set the readonly value as 'X'.
    DATA lo_el_context TYPE REF TO if_wd_context_element.
         DATA ls_context TYPE wd_this->element_context.
         DATA lv_visible TYPE wd_this->element_context-visible.
    *   get element via lead selection
         lo_el_context = wd_context->get_element( ).
    *   @TODO handle not set lead selection
         IF lo_el_context IS INITIAL.
         ENDIF.
    *   @TODO fill attribute
    *   lv_visible = 1.
    *   set single attribute
         lo_el_context->set_attribute(
           name =  `READONLY`
           value = 'X').
    After that Go to the Action  ENTER.
    First read the input field ( first input field, which is value entered field) , next give a condition
    if input value is not initial  then set the readonly value is '  '.
    DATA lo_nd_input TYPE REF TO if_wd_context_node.
         DATA lo_el_input TYPE REF TO if_wd_context_element.
         DATA ls_input TYPE wd_this->element_input.
         DATA lv_vbeln TYPE wd_this->element_input-vbeln.
    *   navigate from <CONTEXT> to <INPUT> via lead selection
         lo_nd_input = wd_context->get_child_node( name = wd_this->wdctx_input ).
    *   @TODO handle non existant child
    *   IF lo_nd_input IS INITIAL.
    *   ENDIF.
    *   get element via lead selection
         lo_el_input = lo_nd_input->get_element( ).
    *   @TODO handle not set lead selection
         IF lo_el_input IS INITIAL.
         ENDIF.
    *   get single attribute
         lo_el_input->get_attribute(
           EXPORTING
             name =  `VBELN`
           IMPORTING
             value = lv_vbeln ).
    if lv_vbeln IS not INITIAL.
        DATA lo_el_context TYPE REF TO if_wd_context_element.
        DATA ls_context TYPE wd_this->element_context.
        DATA lv_visible TYPE wd_this->element_context-visible.
    *  get element via lead selection
        lo_el_context = wd_context->get_element( ).
    *  @TODO handle not set lead selection
        IF lo_el_context IS INITIAL.
        ENDIF.
    *  @TODO fill attribute
    *  lv_visible = 1.
    *  set single attribute
        lo_el_context->set_attribute(
          name =  `READONLY`
          value = ' ' ).

  • HT1918 I changed the card and i want to know how make to change the data from itunes. I tried and doesn't work.

    I changed the card and i want to know how make to change the data from itunes. I tried and doesn't work. Please, Help Me!

    No. That's not what I said. You can get an out of warranty replacement, which will be exactly the same model, color, and will be locked in exactly the same way the original is. If you want an iPhone 5, get the 4S replaced, sell it, and use the money to put toward a new phone.

  • Do we have option not to refresh the data in AP invoice while copying from GRN and change the date of the invoice in SAP 9 PL 0

    Hi
    I have update tax details in GRPO but while copy to AP invoice system pick posting date/ document date as system date and if i change the date the screen refresh and the tax details i have updated it change. that i do not want.
    Is there any option so that GRPO date will copy in ap invoice so that i need not to refresh the screen
    regards
    Ashish Garg 

    Hi,
    Please provide an example for tax details. Make note on these,
    1. Whenever copy GRPO to AP invoice, posting and document date is system date. This is default design system
    2. If you change these dates in AP invoice, your payment to vendor leads to confusion.
    For example:
    You have received items on 25-03-2014. But vendor raised invoice on 03/04/2014.
    Thanks & Regards,
    Nagarajan

  • I have a problum in inserting the data through form9i

    Hi All
    i have a form which contains many fields
    examle
    x y z total
    1 4 7 12
    when i enter the data and saveing it the only the total field get null all are database items and rest of the fields saved properly
    please help
    oracle9i,forms9i
    window-xp
    thanks a lot
    Regards
    vikas
    Edited by: vikas singhal on Jan 10, 2009 5:23 AM

    Is the total field a Calculated item ?
    Forms ignores the property "database item" for calculated items.
    Workaround:
    - Create another non-database-item in the block and use that as your formula-item and for displaying the total.
    - Add PRE-INSERT and/or PRE-UPDATE-triggers to the block and take over the calculated Total into your databasefield:
    :BLOCK.TOTAL:=:BLOCK.CALCULATED_TOTAL;

  • How Can i send the data entered in Input text fields to e-mail?

    Iam Jennifer, Iam having a doubt in Flash, I hope that you
    are going to solve my problem, Iam taking 3 Static text fields as
    Name, Age and Country and besides each and every static text fields
    i have taken 3 input text fields with different instance names,
    when i enter my Name, Age and Country details in the input text
    fields and after entering those details if user clicks the submit
    button the data should be send to some mail address, is it possible
    Im not so good at action script, but i hope that any one can
    help me...
    Iam attaching the action script code also, please find the
    attachment below, the actions are given to button.
    Attach Code
    Btn.onPress = function ()
    mail_lv = new LoadVars();
    mail_lv.dummy1 = "";
    mail_lv.subject = "Details";
    mail_lv.message = "hi";
    mail_lv.username = "name_txt".text;
    mail_lv.age = "age_txt".text;
    mail_lv.country = "country_txt".text;
    mail_lv.onLoad = function ()
    trace("Sent successfully...");
    trace("mail_lv.subject = " + mail_lv.subject);
    trace("mail_lv.message = " + mail_lv.message);
    mail_lv.send("mailto:[email protected]", "_blank");

    The names of your variables, "name_txt", for instance, should
    NOT have quotes around them. Use:
    mail_lv.username = name_txt.text;
    mail_lv.age = age_txt.text;
    mail_lv.country = country_txt.text;

  • I want popup Message when i successfully update the data

    Hi Expert
                    My requirment is update the data in the database using Bapi.I successfully update the data in the database.when i successfully update the data it will show the popup message.whether is it possible please tell me how to do it..urgent.
    Regards
    Sundaresan

    Hi SUNDARESAN BALARAMAN,
    Given link explains the steps to develop the Pop up iView in Visual Composer.
    http://help.sap.com/saphelp_nw2004s/helpdata/en/9c/ffdb4269b2f340e10000000a1550b0/frameset.htm
    Please have a look.
    Regards,
    Prashant.
    Please do rewards points for useful answers.
    Edited by: Prashant Jagdale on Jan 23, 2008 5:48 AM
    Edited by: Prashant Jagdale on Jan 23, 2008 5:50 AM

  • I want to print a calendar by specifying the date range

    I want to be able to print from ICal in a 4 week block but not by month. Our calendar is updated regularly and I want to be able to print out the forward 4 weeks, not this month which gives me dates already past.
    And I do not want to print out 4 individual weeks.
    I know how to print Month and Week but these don't do it for me.
    How can I specify a date range?
    Cheers
    Rusty

    Hello @jgolf ,
    I would like to direct your attention to the following post by PrintApper .
    HP Apps Service Retired on several printers
    Aardvark1
    I work on behalf of HP
    Please click “Accept as Solution ” if you feel my post solved your issue, it will help others find the solution.
    Click the “Kudos Thumbs Up" on the right to say “Thanks” for helping!

  • Why does BC have so many issues in the data center?

    It just seems there are site connection and email problems way too often? I just don't have much confidence in up-time promises my clients need. Is this something engineering is trying to address or are there big changes going on that are causing temporary instability?

    Thank you for your "copy and paste" reply. It is very obvious that you did NOT read my original post.
    If you had you would have noticed:
    a) I stated: "I run the default theme"
    and that
    b)I stated: "I have disabled "hardware acceleration""
    c)I stated: "changed the value for "dom.max_script_run_time" to 20 "
    (both of which are in response to the linked help article that you recommended - and neither of which did any good)
    d) I also stated: "The only plugin I use is Flash"
    (which is the latest up-to-date version and if Firefox cannot run with Flash it is of no use as a browser)
    I will try "Safe Mode" and post how that works after browsing Facebook - but it should not be necessary to do this.
    I had reported similar issues with Firefox two or three builds back (Firefox 19.0.2) then the issue was fixed for a couple of builds - and now with the release of Firefox 22.0 (on Mac) it is as bad or worse than ever.

  • I did some file maintenance and now my itunes icon on my computer cannot find the songs.  I have to show were all the data for the individul songs are located in the computer.  How do I remap the location of the actual songs, so the computer list can find

    did file maint on computer, not ipod list in computer not linked with actual place of songs in computer.  What can I do to remap the itunes list in the computer to find actual songs.

    You didn't move the library or rename the folder or drive it was in?  Are your songs IN the library or are did the library point to them elsewhere on your drive? Obviously something happened, any idea what?

  • I cannot print or send a fileI downloaded Adobe yesterday and have spend 7 hours putting together a document I cannot print or send. If I print it out it only prints the template and not the data entered. I am very frustrated.

    I cannot print or send a file I spend 7 hours putting together and am becoming very frustrated. I downloaded this software yesterday and can only print out the template and the data entered does not appear. Please help.

    This forum is about the Cloud as a delivery process, not about using individual programs
    If you start at the Forums Index https://forums.adobe.com/welcome
    You will be able to select a forum for the specific Adobe product(s) you use
    Click the "down arrow" symbol on the right (where it says All communities) to open the drop down list and scroll

Maybe you are looking for

  • Sound not working Notebook Envy 15 TS windows 8 and windows 8.1 - problem continues

    Hello, My computer sound stopped again. I posted previously:  http://h30434.www3.hp.com/t5/Notebook-PC-Sound-and-Audio/Sound-not-working-Notebook-Envy-15-TS-windo... After I`ve followed David`s  steps my computer`s sound started working again. But it

  • [SOLVED]Can't build dansguardian. Any alternative content filter?

    I can't build dansguardian in yaourt. Not sure what the problem is but here is the whole output of the build: ==> Starting build()... patching file src/downloadmanagers/fancy.cpp checking for a BSD-compatible install... /usr/bin/install -c checking w

  • What adapter for monitor?

    My friend here at work just purchased a Dual 2.0 PowerMac G5. She went to hook up her new LCD 19 inch display and the connector supplied with the Xerox monitor and the PowerMac are not correct. Which adapter will she need to connect her monitor to he

  • Viewing multiple thumbs before importing?

    Hi, I am going through photo discs trying to accumulate relevent photos to make a Photo Book. I don't want to import every single photo on each disc in order to look at and them in iPhoto - and would prefer not to have to click on each photo to see w

  • Subvi and input

    The diagram function "Flatten To String" takes any datatype on its input connector. Is it possible to create a subvi that takes any datatype on its input connector? Thanks for yor answer Petter Kristiansen Industriell Informasjonsteknologi AS P.O.B 8