Validation of a field with data in a database

Hey guys I was wondering if you could help me please. I currently have a domain in which the user between a number, but until that number is allowed to be registered in the database should be checked to determine if the number is already stored in another field in the database. By example, if the number is not in the database the user can not put this number in the field.

Maybe I'll thereon completely in the wrong direction well, I don't want it to be entered so I don't want a LOV user linked to the appropriate field in the database.

Is less close to the way it should be done anyway? For some reason, seq_rec.seq seems to give me 3 and doesn't seem to compare with each of the values in the database.


DECLARE
cursor seq_curs IS SELECT SEQ OF ZZJOB;
seq_rec seq_curs % rowtype;
none_existing_seq EXCEPTION;
invalid_seq EXCEPTION;
return_alert NUMBER;

BEGIN
IF (: CREATED_BY >: SEQ) THEN
RAISE invalid_seq;

END IF;

Open seq_curs;
extract seq_curs INTO seq_rec;
close seq_curs;

If: created_by! = seq_rec.seq THEN
RAISE none_existing_seq;
End if;

EXCEPTION
WHEN none_existing_seq then
return_alert: = SHOW_ALERT ('CREATED_BY_INVALID');
RAISE form_trigger_failure;

WHEN invalid_seq then
return_alert: = SHOW_ALERT ("CREATED_BY_ALERT");
RAISE FORM_TRIGGER_FAILURE;
END;

Published by: user13390506 on August 6, 2010 08:07

There is a simple way

Write a when-validate-item on your property

if :myfield is not null then
  declare
     v_val mytable.myfeild%type;
    value_exsists_in_table; EXCEPTION;
  begin
    select myvfield
      into v_val
    from mytable
    where myfeidl = :myfeild;
    raise value_exsists_in_table;
exception when no_data_found then
     null;
  when value_exsists_in_table then
        message('Value exsists');
        raise form_trigger_failure;
end;
end if;

hope it works...

Tags: Oracle Development

Similar Questions

  • problem with validation in the field with the radio button type in create profile jsp page

    Hello

    Kindly help me with the validation of a field with the type option button in the createProfile jsp page. Its actually not to validate the sex with radio button field.

    The code is as follows...

    < % @ page language = "java" contentType = text/html"; charset = ISO-8859-1"

    pageEncoding = "ISO-8859-1" % >

    <! – this taglib used to access dsp tags - >

    < %@taglib uri = "" / dspTaglib "prefix ="dsp"% >"

    < dsp:page >

    < dsp:importbean bean = "/ atg/userprofiling/ProfileFormHandler" / >

    < dsp:importbean bean = "/ atg/dynamo/drop/ErrorMessageForEach" / >

      <! DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional / / IN" "http://www.w3.org/TR/html4/loose.dtd" > ""

    < html >

    < head >

    < meta http-equiv = "Content-Type" content = text/html"; charset = utf-8 "/ >"

    < title > < /title > user registration Page

    < / head >

    < body >

    < dsp:form id = "registerForm" method = "post" action = "registration.jsp" >

    < div >

    < div > if please fill in all fields below and click Save

    button. < / div >

    < br / >

    < table >

    < tbody >

    < b >

    < td width = "150" > name < table >

    < td > < dsp:input bean = "ProfileFormHandler.value.firstName"

    MaxLength = "30" size = "25" type = "text" required = "true" / > < table >

    < /tr >

    < b >

    Last name < td > < table >

    < td > < dsp:input bean = "ProfileFormHandler.value.lastName"

    MaxLength = "30" size = "25" type = "text" required = "true" / > < table >

    < /tr >

    < b >

    < td > username < table >

    < td > < dsp:input bean = "ProfileFormHandler.value.login"

    MaxLength = "30" size = "25" type = "text" required = "true" / > < table >

    < /tr >

    < b >

    password < td > < table >

    < td > < dsp:input bean = "ProfileFormHandler.value.password"

    MaxLength = "30" size = "25" type = "password" required = "true" / > < table >

    < /tr >

    < b >

    < td > confirm password < table >

    < td > < dsp:input bean = "ProfileFormHandler.value.password"

    MaxLength = "30" size = "25" type = "password" required = "true" / > < table >

    < /tr >

    < b >

    Identification of Email < td > < table >

    < td > < dsp:input bean = "ProfileFormHandler.value.email"

    MaxLength = "30" size = "25" type = "text" required = "true" / > < table >

    < /tr >

    < b >

    Sex < td > < table >

    < td > < dsp:input bean = "ProfileFormHandler.value.gender"

    Type = "radio" required = "true" > male < / dsp:input > < dsp:input

    Bean = "ProfileFormHandler.Value.Gender" type = "radio" "

    required = "true" > female < / dsp:input > < table >

    < /tr >

    < b >

    < td colspan = "2" > < dsp:input bean = "ProfileFormHandler.create"

    Type = "submit" value = "Save" / > < dsp:input

    Bean = "ProfileFormHandler.createSuccessURL" type = "hidden"

    value = "index.jsp" / > < table > "

    < /tr >

    < b >

    < td colspan = "2" >

    < ul >

    < dsp:droplet name = "ErrorMessageForEach" >

    < dsp:param bean = "ProfileFormHandler.formExceptions"

    name = 'exceptions' / >

    < name dsp:oparam = "output" >

    < li > < dsp:valueof param = "message" / > < /li >

    < / dsp:oparam >

    < / dsp:droplet >

    < /ul >

    < table >

    < /tr >

    < / tbody >

    < /table >

    < / div >

    < / dsp:form >

    < / dsp:page >

    < / body >

    < / html >

    Use code next, may be you do not value attribute set and causing a problem (data inconsistency problem) or case mismatch while storing data in the repository.

    <%Boolean checked = true;%>

    Sex:

    Male

    Female

    I do not know what will radio back button if the value is specified: a boolean value or the value aim to display (in your male cases),.

    If the problem is fixed, undo the change and please let me know what value he sent in your case.

    Please

    Thank you

    Nitin.

  • How can I update form field with data using "on Blur.


    Perhaps also very easy for all the experts out there that you but I'm trying to update a form field with data in another field in the form when they come out the first form field.

    Basically creating a "billing" and a form "shipping" I want to be updated automatically.

    Any help would be extremely Grateful.

    Thank you

    Steve

    He does!

    shipFirstNameText.value = this.value

    It worked

  • Is it possible to define the validation on a form field with data from another field in Adobe Acrobat?

    Thanks in advance for any help and advice. I am defining a validation for a field that ensured that the amount entered is 25% from another domain. I tried implementing a validation, but were unsuccessful. Can anyone offer any idea or solution? Thank you!

    You will need to use a script to do it. Something like this should do it:

    If {(event.value)

    Event.RC = true;

    var v1 = + this.getField ("NameOfOtherField") .value;

    If (event.value +! =(v1*0.25)) {}

    App.Alert ("the value entered must be 25% of the value of NameOfOtherField.");

    Event.RC = false;

    }

    }

    (This will check if the value is exactly 25% of the value of other... If you meant something else, please specify)

  • Conditional fields with data merge

    I have, I think, would be a common question for people using Data Merge in InDesign for cards.

    I have several fields phone, with a letter from small caps to indicate what type (mobile, direct, fax, etc.), that is:

    M < < phone > >

    D < < Tel Direct > >

    If an employee has only one phone line, how can I do so that the entire line is omitted from the final merged doc?

    In the past, I just went in the game final and quickly deleted lines / extra characters, but I know that there is a way!

    Thank you.

    mavenlink cards1.1_Page_1.jpg

    The main character must be included in the paragraph style, even if it's a Word. If deleting empty lines turned on, these main characters are removed too.

    To add the main characters in a paragraph style, you can define a list numbered without numbers but with the main character and space or tab between.

  • JavaScript - fill out the text field with data entered

    Hello

    I am learning javascript and need help to put in place a script that will do the following:

    I have three text fields where users enter data. I would like to take this data and provide a summary in a 4th text field. If a field is null, it should be ignored.

    TextField1

    textfield2

    textfield3

    Summary data entered above must be posted in textfield4.

    Text1

    Text2

    Text3

    Your help would be much appreciated.

    Thank you!

    Varns

    Hello

    On the calculate event of the textfield4 put the following text (or something like that):

    var str1 = "";

    var str2 = "";

    var str3 = "";

    var str4 = "";

    If (TextField1.rawValue! = null)

    {

    str1 = TextField1.rawValue + "\u000a";

    }

    If (TextField2.rawValue! = null)

    {

    str2 = TextField2.rawValue + "\u000a";

    }

    If (TextField3.rawValue! = null)

    {

    str3 = TextField3.rawValue;

    }

    STR4 = str1, str2 + str3;

    If (str4 > "")
    {
    this.rawValue = str4;
    }
    on the other
    {
    this.rawValue = "";
    }

    You may need to adjust to your exact needs - good luck!

    Stephen

  • Backup VM "outside the field" with data recovery?

    Hello

    When I try to make a backup of Virtual Machine for the domain, I get the following error:

    "error 3960 - (cannot suspend virtual machine).

    VMTools are installed properly, and the other series of properly backup jobs.

    I think it is the problem is with the VSS service, and user... more, this virtual machines are in DMZ, but FW does not blook no matter what connection.

    Any suggestion on this subject?

    Best regards

    Pedro Velasco

    Tarragona, Spain

    We have solved the same problem with this procedure:

    http://www.Petri.co.il/forums/ShowPost.php?p=186408&postcount=2

    If this post was useful/solved your problem, please mark the points of wire and price as seem you. Thank you!

  • You want to varify each form field with the value from database?

    Hello Experts,

    I have to implement a feature that will confirm the change for each text field on the form.

    Scenario:

    I have a form with several fields of database tables.

    We have set the indicator for each column of each table to Yes or no in a master table to access.

    When users navigate to any text field in any database block, procedure, or a function will varify that access is granted for the amendment of this column.

    If the access flag is set to yes, user can change. otherewise fast with the message, you are nor allow to change this field.

    I don't want to call this procedure and a function in each field.

    Also, if in the future if a new field will add to this form, there is no need to change in the code or we should not require to remember to check the indicator of access to this column.

    Please help me.

    Thank you

    Yoann

    NEXT-KEY is always triggered, then you can try to put that code in WHEN-VALIDATE-ITEM trigger. This way you can navigate on this field if it's empty DB, but can not force the user to enter data in a new record. Alternatively, you can ask again priviledge change data in your trigger KNI.

  • Image list of JavaScript (with data from a database)

    Hello

    I'm trying to get a list created on a database.  I use Webworks and ripple (for testing).

    So far, I have this code:

    
    

    This creates my database to contain items from my list.

    Once my page is pushed into the view, I use this code to read the database and complete my list.

    
    

    Then, I have a section (on the same screen) that looks like this:

    My idea was that, for each element in my database, it would create a separate post in the list, however, nothing works I spent more than 10 hours trying to make it work, does not.  I am new at this and would appreciate the help.

    I know for a fact that the database is filled but I can see the data in it.

    You are right: the missing button does not affect your error.

    When you call this function (and the following lines)?

    document.getElementById('mylist').clear()
    

    You must wait for the DOM to finish rendering, before you can access it via the function "getElementById".

    The easiest way is probably by using the integrated bbUI of bb.init trigger in the ondomready section:

    bb.init({
                    actionBarDark: true,
                    controlsDark: true,
                    listsDark: false,
                    // LOTS OF OTHER STUFF HERE...
                    ondomready: function(element, id) {
                        // The ID should match the one from pushScreen (second parameter)
                        if (id == 'yourfile') {
                            initYourStuff(); // CALL YOUR LIST.JS INIT HERE!
                        }
                    }
                })
                bb.pushScreen('yourfile.html', 'yourfile')
    
  • f: Validator field with dependencies on line table

    Hi guys,.

    I have a built with a custom SQL view object. I created a page with a table jsf, users can edit all fields and later this information he was send by webservice.

    A field has a validator. This validator check if not equal 0. Now, I add a new condition, when the other field equals 0 then should not see the error.

    Example:

    Field1 Field2

    2 0-> error, Field2 0 and Field1 is not 0.

    Change Field2

    2 1-> OK-> Field2 is not equal 0

    Change Field2

    2-> 0 error, Field2 0 and Field1 is not 0

    Change Field1

    0 0-> OK, Field2 0 but field1 0

    I added a validator attribute, but it does work very well. I thought of using required field with groovy expression but it is not working properly, but when field2 is 0, it is compelled value.

    I don't know how this implementation.

    Any idea?

    Thank you!

    Kind regards.

    Hello AlfreNet,

    Sorry for the delay, but he questions and I m there (maybe all) do not get warnings in my Inbox (Inbox does not).

    For the table, you can iterate trought the lines as its explained Timo Hahn in this post: Hello, I am using j developer 12.1.3 ;

    On the action of the button, I think you can do as explained on that: Re: conditional Navigation on the CommandButton Action use EL? to only return the string to navigate when there are no validation errors, otherwise return null and show the message; (I have a request that the action of the button returns a string based on the review of the method and redirects accordingly, but I m not finding any to show you, sorry).

    Kind regards

    Carlos

  • How to fill a field of date with today's date when the signature field is signed?

    How to fill a field of date with today's date when the signature field is signed? In the LCD, I insert a signature field and a date field, what parameters in these two fields are necessary to make this work? Is the date field, the value calculated? I tried different JS suggestions I found, but none work. In the form, I named the signature ClaimSignature field and the date in the ClaimSigDate field.

    The thought of her with a little help. In the script editor window, I selected the postSign event and added the following JS:

    Form1.Page1.ClaimSignature::postSign - (JavaScript, client)

    var date = new Date();

    var day = date.getDate ();

    var month = date.getMonth () + 1;

    var monthstring = (month, 10?) ('0' + month: month)

    year var = date.getFullYear ();

    var = year DateString + '-' + monthString + '-' + (day< 10="" "0"="" +="" day="" :="">

    ClsimSigDate.rawValue = dateString;

    I hope this helps someone else save time.

  • How to make a list of question field with the data type DATE?

    I have a column with the DATE data type. Using forms 6i I want to generate a poplist field of list item with this column while the value of the items in the list of names of days like SATURDAY, SUNDAY, MONDAY. If we change the date to a char data type, it won't work properly, but now with the data type DATE behind him, it gives the following error message

    "FRM-32082: invalid value for given the type of element."
    List WEEKREST
    Article: WEEKREST
    Block: EMPRESTS
    Form: module 3
    FRM-30085: unable to adapt to the shape for the release. »


    Using forms 6i how a list item field type DATE data which may contain names of days?

    Set your date as a hidden field (not shown) column. Create your item list with the names of day of varchar2. Create the list item as a base table field that accepts the values of text in the names of the days. On this area, create a when-validate-item trigger that translated the text into an actual date that it then uses to set the value of the real object of the base table.

  • Create a Multiple Signature and Date fields with a custom toolbar button

    First of all, thank you in advance!  I'm a newbie script and I trudged my way through with very little experience with the scripts of any kind.  I'm good at taking and other scripts and them forming into something I need, but I can't seem to find something to do what I want.

    Use Adobe Acrobat X, I am trying to create a button in toolbar that I can press to create several signature fields and date with predetermined places.

    Here is the script that I have which strives to create a unique signature box, but I can't seem to understand the exact syntax to have this same button create several fields.  In total, it's 9 signature fields and 9 date fields must be created.  If you can give me just one example of what the button would look like with several scripts?  I'm assuming that I put multiple variables, then in ownership cExec toolbar button that I could just scream all these variables?

    var sigswm = "addField ('sigSWM', 'signature', '0', [108, 198, 494.64, 72])"

    app.addToolButton ({cName: "dotbutton", cExec: sigswm, cLabel: "place Signature and Date blocks",});

    Thanks in advance for any help you can provide.

    Billy Sweeney

    This is what works for me:

    function addSignatureAndDateFields (doc) {}

    Add a signature field and a date field

    var swmsig = doc.addField ('sigSWM', 'signature', '0', [108, 198, 494.64, 72]);

    swmsig.setAction ("MouseDown", "getField(\"dateSWM\").value = util.printd (\"mm/dd/yyyy\ ', Date() ");" ') new;

    doc.addField ('dateSWM', 'text', '0', [162, 72, 234, 54]);

    }

    app.addToolButton({)

    cName: "dotbutton."

    cLabel: "place Signature and Date blocks."

    cExec: "addSignatureAndDateFields (this)."

    cEnable: ' event.rc = app.doc; "

    cTooltext: "blocks of Signature and Date place.

    });

  • How to have data entered in a form and validated by a field data card?

    We are conducting a campaign in which recipients will receive a code by post. So we wish them to visit a web page where they will enter the code to launch a hunt for treasure. When the contact between the code, we want the form to validate the code against a data card to determine if it is valid. How do I put this in place?

    Hi Barry,.

    You could use a table of correspondence in Eloqua for this kind of validation (can be case sensitive or not), or otherwise doing the validation server before posting any data of Eloqua.

  • Problems with the filling of a text field with 2 other fields data


    I have 3 domains Tools_1a_pri, Tools_1a_pri_other, Tools_1a_pri_txt.

    Tools_1a_pri is a drop-down list box with a predefined list. One of the options is the 'other '.  If 'Other' is selected, the text Tools_1a_pri_other field becomes visible for users to enter the name of the other tool.

    The Tools_1a_pri_txt is a text field with a calculation that shows a text indicating that no tool has been selected or the Tools_1a_pri & or Tools_1a_pri_other.

    When I select one of the predefined tools, everything works.  When I choose the other, it seems that nothing has changed.  Must I click another field before.  It's confusing for the user.

    Tools_1a_pri validate code
    this.getField("Tools_1a_pri_Other").display = event.value is "Other"? Display.visible: display.hidden;

    Computer Tools_1a_pri_txt code
    If nothing is selected, follow these steps
    If (getField("Tools_1a_pri").value.length < 2) {}
    event.target.textColor = color.red
    Event.Value = "no identified main tool";
    } else if (getField("Tools_1a_pri").value! = 'Other') {}
    If not do that if the other is selected
    event.target.textColor = color.black
    Event.Value = getField("Tools_1a_pri").value;
    } else if (getField("Tools_1a_pri").value = 'Other') {}
    If not do so if the other is not selected
    event.target.textColor = color.black
    GetField("Tools_1a_pri").value = Event.Value + "-" + getField("Tools_1a_pri_Other").value;
    }

    You have made the classic mistake of using the assignment operator in a statement instead of the comparison operator. Change this line:
    } else if (getField("Tools_1a_pri").value = 'Other') {}

    To do this:

    } Else if (getField("Tools_1a_pri").value == 'Other') {}

Maybe you are looking for

  • How to remove the plug-in: Shockwave for Director

    I got a new pc a few weeks and recently downloaded Firefox. I don't know if shockwave for Director came with the download. But he is listed in the PLUGINS. It displays a warning that they are vulnerable and must be updated. I don't want to do that. A

  • Play voice mail

    Apologies to crosspost, but this seems to be a widespread problem. You have received a voice message. You have email notification. You try to read the message, but nothing happens. You have successfully updated to Skype.You have verified that your st

  • How can I change the fingerprint logon?

    I had a local guru clean my Dell laptop. He called and said he was not able to connect and I gave him the password to get connected. When I took the computer he told me that he had changed the fingerprints to a fingerprint logon. I want to erase her

  • "Error message: out of memory". Save or close any files or applications"when you try to print the Works spreadsheet

    Original title: receive in Microsoft Works Spreadsheet click on print, I receive this message. "Out of memory. Save or close any files or applications "Whats wrong?" Same as above

  • How to exclude recipients who have already opened an e-mail

    New to Eloqua, but I had a question.Usually my divisions to remove recipients who have already opened an email and re-post for those who have not opened. How do you this?