validate/compare the 2 fields amount
Hi allI am using oracle 10 G on windows forms.
I need help on how to validate the amounts 2 fields.
I compare 2 amounts fields, if the amounts are equal, then all is good. However, if the amounts are $ 5, which is very good but I would like to display a warning to the user. And if the amounts are more than $ 5, then display a different message and do not allow additional processing.
Thanks for your help in advance,
Hello
Suppose you have a datablock named YOUR_BLOCK and the elements named S1 and S2.
You need to create an alert, it's easy, go to the object navigator palette, search alerts, and then click on the button create, give to alert a name, we named our alert CFG_ASK.
Try this in a trigger or a button, I suggest you to use when validating the trigger...
IF :YOUR_BLOCK.S1 IS NOT NULL AND :YOUR_BLOCK.S2 IS NOT NULL THEN
IF :YOUR_BLOCK.S1 <> :YOUR_BLOCK.S2 THEN
IF ABS(:YOUR_BLOCK.S1 - :YOUR_BLOCK.S2) <= 5 THEN
ALERT_CALL('CFG_ASK','ALERT','THERE IS A LITTLE DIFFERENCE');
ELSE
ALERT_CALL('CFG_ASK','ERROR','TOO MUCH DIFFERENCE!');
RAISE FORM_TRIGGER_FAILURE;
END IF;
END IF;
END IF;
Alert_call code (program unit):
PROCEDURE alert_call(alert_name varchar2, title_name varchar2, msg_name varchar2) IS
AL_ID ALERT;
AL_BUTTON NUMBER;
BEGIN
AL_ID := FIND_ALERT(alert_name);
IF ID_NULL(AL_ID) THEN
MESSAGE('There is no alert window '||alert_name); -- you must to create an alert
RAISE FORM_TRIGGER_FAILURE;
ELSE
Set_Alert_Property(AL_ID, TITLE, title_name);
Set_Alert_Property(AL_ID, ALERT_MESSAGE_TEXT, msg_name);
AL_BUTTON := SHOW_ALERT(AL_ID);
IF AL_BUTTON = ALERT_BUTTON1 THEN
NULL;
END IF;
END IF;
END;
It will be useful.
Points to keep in mind.
Tags: Oracle Development
Similar Questions
-
It is possible to compare the contact fields based on the value of data updated?
Hi all -
I would like to run a filter and compare my contact fields if the value in a field has been updated or changed.
for example if the data in the "first name" value changes to be empty to have a value, which would respect the requirement. Also if "phone number" 123-456-7890 to 999-000-0000 that would also meet the requirement.
Did anyone done this before? Any ideas of how to implement?
Any contribution is appreciated. Thank you!
If that's what you're talking about, there is no trace of audit in Eloqua.
It will be great if Oracle can verify the critical fields.
The solution is to create to the top of the field in another area, so when it changes, you can compare the values.
Good luck
-
Canvas campaign: filters common vs compare the Contact fields
HI -.
Is there a difference between using one or several Contact fields compare elements vs using a shared filter?
In my campaign, I need to check if one of the three fields is equal to something specific (and therefore remove them from the campaign). I couldn't achieve exactly the same results if I used a shared filter that sought the same criteria?
Thank you
Abe
1. the shared filter evaluates when someone passes through this point of decision. It is different from that of a Segment in which a Segment is your first point of qualification for a campaign (so why someone "stays in the segment"). They actually stay in the segment so that they did not leave the campaign yet. If the segment is more permissive, your filter shared between them, so that hardly leave the campaign according to your rule.
2. I saw your other post on the date field. You're right... when I try in the Web I get an error as well. Definitely a bug in the interface user, as you can do in a segment. I would say for now you use the shared empty contact filter and log a ticket with Support for the bug in the user interface.
-
By comparing the dynamic fields of objects using equals and hashCode methods
To compare the different objects of the same class with their content as jobTitleId, classificationId, deptId & classificationId had to be done and do a few steps later, using Set and the map. I was able to do it by simple substitution of equals and hashCode methods of the object class and was able to read the information (as in the map below).
Map < LocationData, list < LocationData > >
The following is the class I used (its been shown you so that it can be called for my problem statement):
Class LocationData
package com.astreait.bulkloader;
public class LocationData {}
String locId, deptId, jobTitleId, classificationId;
@Override
public boolean equals (Object obj) {}
LocationData ld = (LocationData) obj;
return this.deptId.equals (ld.deptId) & & this.jobTitleId.equals (ld.jobTitleId) & & this.classificationId.equals (ld.classificationId) & &
this.locId.equals (ld.locId);
}
@Override
public int hashCode() {}
return deptId.hashCode () + jobTitleId.hashCode () + classificationId.hashCode () + locId.hashCode ();
}
}
Problem:
I am already known to which all the fields of this object, I need to make the comparison.
IE I have to use the variables named classificationId, deptId, jobTitleId & locId etc.
Need:
I need to customize this logic such as names (classificationId, deptId, jobTitleId & locId etc.) fields can be learned, dynamically, as well as their values. So, as far as I understand, I've made use of 2 classes (TableClass and ColWithData), such as the list of the ColWithData is there in the TableClass object.
I think what will happen if I substitute the same two methods "equals() and hashCode();"
as the same thing is possible.
TableClass class #1
Class TableClass {}
The list < ColWithData > cwdList;
@Override
public boolean equals (Object obj) {}
Return Boolean = false;
I need to have the logic must be set such that
all dynamic fields can be compared
return return;
}
@Override
public int hashCode() {}
Return int = 0;
I need to have the logic must be set such that
All dynamic fields for their individual codes can be found
return return;
}
}
ColWithData class #2
Class ColWithData {}
Pass the string; Here, the jobTitleId, classificationId, deptId, locId or any other information fields more may come.
String data; The corresponding data or value for each jobTitleId, classificationId, deptId, locId or any other more fields.
}
Please let me know if I'm the procedure in the right direction or should I do a different approach. If it is allowed to use the current approach then what should be done to equals and hashCode methods?
Finally, I need to make the map as: (is not worried how I give you, but may be considered my goal sought this logic)
Map < TableClass, list < TableClass > > finalMap;
I'm sorry for that. Although the problem is resolved, on my side.
-
compare the 4 fields in a table
Hi, today my brain pains, can someone please tell me how to compare 4 fields in a table to see if they are all equal?
create table dm_test (n_1 number, n_2 number, n_3 number, n_4 number);
The result of my query must return onlyINSERT INTO dm_test (n_1, n_2, n_3, n_4) VALUES (1, 1, 1, 1); INSERT INTO dm_test (n_1, n_2, n_3, n_4) VALUES (3, 2, 2, 2); INSERT INTO dm_test (n_1, n_2, n_3, n_4) VALUES (0, 0, 0, 3);
first row
1 1 1 1
Thanks people...Maybe something like that?
SQL> SELECT * 2 FROM dm_test 3 WHERE n_1 = n_2 4 AND n_2 = n_3 5 AND n_3 = n_4 6 / N_1 N_2 N_3 N_4 -------------------- -------------------- -------------------- -------------------- 1 1 1 1
It won't however if you're concerned about NULL values. Do you want a row to return if they are NULL?
EDIT:
The version that supports the NULL:
SQL> INSERT INTO dm_test VALUES(NULL,NULL,NULL,NULL); 1 row created. SQL> SET NULL '(null)' SQL> SELECT * 2 FROM dm_test 3 WHERE NVL(n_1,-1) = NVL(n_2,-1) 4 AND NVL(n_2,-1) = NVL(n_3,-1) 5 AND NVL(n_3,-1) = NVL(n_4,-1) 6 / N_1 N_2 N_3 N_4 -------------------- -------------------- -------------------- -------------------- 1 1 1 1 (null) (null) (null) (null)
Edited by: Centinul May 14, 2010 07:07
-
By comparing the inputtext fields
Hello
I have a simple question. I'm usgin Jdev 11.1.2.2.0. My use case:
I have a VO with 3 fields (username, question and answer).
When the user enters the answer, I need to check in the database for the particular ANS if it is appropriate, the user be able to.
The steps I did:
(1) created read only VO.
(2) developed a method in the bean, which will be the username, answer.
(3) callin the method in the module of the application.
(4) but I always "result: error".
Bean code:
public String answerTabout (ValueChangeEvent valueChangeEvent) {}
String resultstr = "error";
User String = (String) username.getValue ();
Years = (String) checkAns.getValue ();
System.out.println ("Calling");
Links DCBindingContainer = ((DCBindingContainer) BindingContext.getCurrent () .getCurrentBindingsEntry ());
Method of the class OperationBinding = bindings.getOperationBinding ("checkUser");
Map params = method.getParamsMap ();
params.put ('years', years);
params.put ("user", user);
System.out.println ("Done");
Object result = method.execute ();
{if (!) Method.GetErrors (). IsEmpty())}
ResultStr = "success";
System.out.println ("result" + resultstr);
}
System.out.println ("returnStr =" + resultstr);
Return resultstr;
}
Code of the AOS:
' Public Sub checkUser (String years, String user)
{
AnswerVOImpl vo = (AnswerVOImpl) getAnswer1 ();
System.out.println ("frm applcaitoon");
System.out.println (years + "" + user);
System.out.println (VO);
vo.setNamedWhereClauseParam("check_user",user);
vo.executeQuery ();
int rowCount = vo.getEstimatedRangePageCount ();
int count = vo.getRowCount ();
System.out.println ("ROWCOUNT =" + RowCount);
{if(ROWCOUNT==0)}
System.out.println ("no match");
}
log file:
the call
fact
FRM applcaitoon
Jose ispl\dmptest
com.laurus.model.viewobject.readonly.AnswerVOImpl@188834e
number of lines = 1
returnStr = error
What's not in my code? Or is there another method better do?Your check condition after execution of the binding of the method is the wrong way autour:
if(!method.getErrors().isEmpty()) { resultstr = "succes"; System.out.println("result " + resultstr); }
should be
if(!method.getErrors().isEmpty()) { // you get here only if the method returns an error System.out.println("result " + resultstr); return; } int count = (int)method.getResult(); if (count > 0) resultstr = "succes"; System.out.println("result " + resultstr); return resultstr;
Next, you need to return something from the AM method. Otherwise, you cannot know if the answer matches.
// return no of rows found. If count == 0 no match found public int checkUser(String ans, String user ) { AnswerVOImpl vo = (AnswerVOImpl)getAnswer1(); System.out.println("frm applcaitoon"); System.out.println(ans + " " + user); System.out.println(vo); vo.setNamedWhereClauseParam("check_user",user); vo.executeQuery(); int rowCount=vo.getEstimatedRangePageCount(); System.out.println("rowCount="+rowCount); if(rowCount==0) { System.out.println("not matched"); return rowCount; }
You should check the AM method. It looks like, it does not check the answer, but only the user.
Timo
-
Disqualification: Compare the value list in another Table
I'm relatively new to the Disqualification.
I use the 11.1.1.7 version.
I have 2 tables Oracle. Table1.FieldA does not have a foreign key constraint (but should be) at Table2.FieldB.
I created a snapshot for Table1 that includes FieldA.
I created another cliché to Table2 which includes FieldB.
I am trying to compare the Table1.FieldA with Table2.FieldB value to make sure that there is.
I can think of a few processors that I could, but they seem to compare a value with another value in the same snapshot (table).
Any advice would be helpful.
Thank you.Ray
Hello
Use the search check if you want to just check between the tables. According to the reference database, you need create a list of choices on the table (can be either staged as you, or just a list of external choice provided the lookup columns are indexed). Use Lookup and return if you want to import data in the other table in your process. You can control if you want a 1:1 or from a 1:M relationship, and if you go back several records, you can use split chronogram: table with all the paintings of entry to create an intermediate join process.
Mike
-
Confirm the email address on the form field
Is there a simple way to add a field "Confirm email address" in our forms so that people don't accidentally send forms with an incorrect email? It would be just to compare the two fields to make sure they match.
Try this:
-
I have 2 fields that are calculated fields and I need display the higher value of the 2 fields in a third field
The field names must be in double - quotes. And if you change the value of any field, now, you will see error messages in the console.
-
I have a "Lock of all areas" set up button and it took to run only if some fields are filled. The code works fine... except TextField13 does not validate correctly. TextField13 is encapsulated in a subform, titled busjus. The busjus subform is hidden at the disposal of the default form (it becomes visible only when a user selects some text in a drop-down list). I want the code to check if TextField13 is null only if the busjus subform is visible.
The problematic part of the code that does not work as expected is listed below:
partiv.nonflow.busjus.presence == visible) && partiv.nonflow.busjus.TextField13 == null ||
Complete code is listed below:
if(partiandii.parti.TextField2.rawValue == null || partiandii.parti.TextField1.rawValue == null || partiandii.parti.DropDownList5.rawValue == null || //Part II: Current Job Details partiv.nonflow.busjus.presence == visible) && partiv.nonflow.busjus.TextField13 == null || partiandii.partii.NumericField2.rawValue == null ||) { app.alert('Please complete all fields marked with a red asterisk and try clicking the button again.'); } else { myScriptObject.LockAllFields(form1); }
Hello
At a glance, I believe that this piece must include the rawValue call
partiv.nonflow.busjus.TextField13
This should be
partiv.nonflow.busjus.TextField13.rawValue
so that you compare the text in the field instead of the actual field object.
Hope this helps
Malcolm
-
Compare the amount of the previous month based on the account number
Hi team,
In my table of the source, amount aggregated by month for a given account there
Now, I need to add a column more in this area, with logic below. There will be more than 1000 accounts available. For each account I need to achieve this.ACCOUNT_NUMBER YEAR MONTH AMOUNT --------------- ------- ------ ----------- 123456789 2012 01 450.00 123456789 2012 02 -234.00 123456789 2012 03 0.00 123456789 2012 04 890.00 123456789 2012 05 78.00 123456789 2012 06 44444.00 123456789 2012 07 450.00 123456789 2012 08 450.00 123456789 2012 09 450.00 123456789 2012 10 120.67 123456789 2012 11 176.88 123456789 2012 12 450.00 123456789 2013 01 340.00
CASE WHEN MONTH_AMOUNT = 0 THE CASE OTHERWISE 1-0 WHEN PREVIOUS_MONTH_AMOUNT = 0 THEN 0 1 OTHER)
On this basis, the objective should be
can someone help me how to compare the value of the previous month. All columns have the data varchar, except for the quantity type.ACCOUNT_NUMBER YEAR MONTH AMOUNT FLAG --------------- ------- ------ ----------- ------------- 123456789 2012 01 450.00 1 123456789 2012 02 -234.00 1 123456789 2012 03 0.00 -1 123456789 2012 04 890.00 1 123456789 2012 05 78.00 1 123456789 2012 06 44444.00 1 123456789 2012 07 450.00 1 123456789 2012 08 450.00 1 123456789 2012 09 450.00 1 123456789 2012 10 0.00 1 123456789 2012 11 0.00 0 123456789 2012 12 450.00 1 123456789 2013 01 340.00 1
Hello
I have not tried. But this desire.
SELECT ACCOUNT_NUMBER, YEAR, MONTH, AMOUNT, CASE WHEN AMOUNT = 0 THE 0 ELSE 1 - CASE WHEN LAG(AMOUNT, 1, 0) OVER (PARTITION BY ACCOUNT_NUMBER ORDER BY YEAR, MONTH) = 0 THEN 0 ELSE 1) AS FLAG FROM SOURCE_TABLE;
See you soon
DidierPublished by: Didier vishwakarma on 6 March 2013 12:36
-
Comparing the sum of the two tables and correct by difference of amount in its second t
Hello guys,.
I have a very difficult task that I can't get my head around.
The sample data looks like this:
Master table
Request - booking - debit - credit - MasterAmout
1------------1----------------D---------------------------------15.3
1------------2----------------D---------------------------------480.6
1------------3------------------------------C-------------------496.8
------------------------------------------- 0.9
The slave table
Demande---reservation---debit---credit---slaveamout---slavecorrection
1------------1------------D------------------------------------15.3---------------14.5
1------------2------------D------------------------------------480.6-------------480.6
1------------3-----------------------------C-------------------496---------------496
-------------------------------------------0.1--------------------------------------0.9
The reservation have a total amount of 0.1, but must be corrected to 0.9 because the main table has 0.9.
Reservation 1 requires a correction so the slave table also has a total of 0.9 (business rule is, only corrections on the first booking). So we have
to change the amount of 15.3 to 14.5. I plan my SQL like this:
1 reservations sum of two tables for each claim. Compare the two for each individual claim.
2. If Captain sum the amount shows a difference between master / slave
2.1 select top 1 table reservation slave for the specific claim and increase/decrease by the difference of these two amounts.
Who is?Hello
Use MERGE to actually do the UPDATE.
The ROW_NUMBER analytic function to identify the first booking in slave (unless you can count on which the reservation = 1).MERGE INTO slave dst USING ( WITH master_summary AS ( SELECT claim , SUM ( master_ampount * CASE WHEN debit = 'D' THEN -1 WHEN credit = 'C' THEN 1 END ) AS balance FROM master GROUP BY claim ) SELECT s.claim , s.booking , SUM ( s.slave_amount * CASE WHEN s.debit = 'D' THEN -1 WHEN s.credit = 'C' THEN 1 END ) OVER (PARTITION BY claim) - m.balance AS diff , ROW_NUMBER () OVER ( PARTITION BY claim ORDER BY booking ) AS r_num FROM master_summary m JOIN slave s ON m.claim = s.claim ) src ON ( src.claim = dst.claim AND src.r_num = 1 ) WHEN MATCHED THEN UPDATE SET dst.debit = CASE WHEN src.diff < 0 THEN 'D' ELSE NULL END , dst.credit = CASE WHEN src.diff < 0 THEN NULL ELSE 'C' END , dst.slaveamount = ABS (src.diff) ;
If you would care to CREATE TABLE and INSERT statements for the sample data (showing the two tables, as they exist before the DML) then I could test this.
The design of history seems very uncomfortable. Instead of the debit and credit columns, it would be much simpler to have positive and negative amounts. Is it really worth now both not corrected and corrected the amounts in the table on the slave, especially if you keep only versions corrected debit and credit columns?
-
By comparing the fields on a JSPX
OK, this should not be difficult, but I can't find anything on it.
I want to do is compare two fields, in this case the dates on a form.
Now, the tricky part seems to get values that are CURRENTLY in the form of type.
I need a way to see what the user has typed currently on the form. Why is it so difficult? (or apparently?)
He compares the value that was stored in the line, but this will only confuse the user:
' Public Sub StartDate_validator (FacesContext facesContext, UIComponent uIComponent object pObject)
{
RichInputDate vReturnDateComponent = uIComponent.findComponent ("id1") (RichInputDate);
VReturnDate = vReturnDateComponent.getValue () (Date);
Day vStartDate = pObject of (Date);
System.out.println ("to start date" + vReturnDate.compareTo (vStartDate));
If (vReturnDate.compareTo (vStartDate) < 0)
{
throw new ValidatorException (new FacesMessage (FacesMessage.SEVERITY_ERROR, "invalid leave", null));
}
}
' Public Sub ReturnDate_validator (FacesContext facesContext, UIComponent uIComponent object pObject)
{
RichInputDate vStartDateComponent = uIComponent.findComponent ("id2") (RichInputDate);
VStartDate = vStartDateComponent.getValue () (Date);
Day vReturnDate = pObject of (Date);
System.out.println ("on the date of return" + vReturnDate.compareTo (vStartDate));
If (vReturnDate.compareTo (vStartDate) < 0)
{
throw new ValidatorException (new FacesMessage (FacesMessage.SEVERITY_ERROR, "invalid return", null));
}
}
< af:panelGroupLayout id = "pghb" layout = "vertical" >
< af:inputDate value = "#{bindings." AutoSubmit DepartDate.inputValue}' = 'true '.
label = "#{bindings." DepartDate.hints.label}.
required = "#{bindings." DepartDate.hints.mandatory}.
shortDesc = "#{bindings." DepartDate.hints.tooltip}"id ="id2 ".
immediate = "true".
Validator = "#{backingBeanScope.UpdateTABean.StartDate_validator}" >
< f: validator binding = "#{bindings." DepartDate.validator} "/ >"
<!-->
< af:convertDateTime pattern = "#{bindings." DepartDate.format} "/ >"
< / af:inputDate >
< af:inputDate value = "#{bindings." AutoSubmit ReturnDate.inputValue}' = 'true '.
label = "#{bindings." ReturnDate.hints.label}.
required = "#{bindings." ReturnDate.hints.mandatory}.
shortDesc = "#{bindings." ReturnDate.hints.tooltip}"id ="id1"immediate ="true ".
Validator = "#{backingBeanScope.UpdateTABean.ReturnDate_validator}" >
< f: validator binding = "#{bindings." ReturnDate.validator} "/ >"
< af:convertDateTime pattern = "#{bindings." ReturnDate.format} "/ >"
< / af:inputDate >
< / af:panelGroupLayout >
Thank you
JetHello
Try to set up each component of entry as one partialTrigger on the other. I think it should work.
It has to do with the life cycle JSF/ADF. It becomes a bit complicated because of the autoSubmits and the immediate you have on components. Learn more about the cycle of life and its variants here: http://docs.oracle.com/cd/E15523_01/web.1111/b31973/af_lifecycle.htm
-
Validation - validate if the field has a date format appropriate or a number
Hello
I have 2 of my form fields... we're the date type and the other is of type number... may I know how to validate if the field has the correct date/number format...
Please advice how to write "Validation" of the APEX feature to accomplish the foregoing.
Thank youcan I know how to validate if the field has the correct date/number format...
The most effective way is simply to try to convert to the type required (using format masks there) in a function to return a Boolean validation:
declare n number; begin n := to_number(:p1_num_item); return true; exception when value_error or invalid_number then return false; end;
and
declare d date; begin d := to_date(:p1_date_item, 'DD-MON-YYYY'); return true; exception when others then if sqlcode between -1899 and -1800 then -- Date format error return false; else -- Unexpected error raise; end if; end;
my date is in the following format: DD-MMM-AA
There is no format 'MMM' model. And do not use 2-digit year formats: which caused bad enough already.
-
Validate if the field contains a specific text
Hi all
I want to make a script in my form that validate the a field for a specific word.
I have a domain where users can put it e-mail adres, but addresses with Yahoo that he should receive a warning that these addressen cannot be used.
I have now If (this.rawValue is 'Yahoo')
But I need advertising, a figure that it doesn't matter which text is based on this text, if it contains the warning must come from yahoo.
How can I do this?
Greetings,
Timo
Try the below. Choose the Java Script language.
var strText = TextField1.rawValue.toLowerCase ();
If (strText.IndexOf("Yahoo",0) > 0)
xfa.host.messageBox ("Yahoo email addresses cannot be used");Thank you
Srini
Maybe you are looking for
-
There is no "Privacy" in the menu drop-down Panel, how can I activate Do not track?
The support site says to click the menu button, then choose "Privacy panel. When I click the menu button, it has options to cut, copy, paste, zoom, new windows, printing, full screen, search, developer, log to synchronize, customize, help and close f
-
Two weeks ago, as Firefox was normal and kick ass as usual. Then I realized that Firefox has changed-when you do things in a tab for a particular Web site you're browsing, Firefox now this thing annoying hella where it hides see your other tabs to wo
-
Live photo not appearing icon does not
I've updated for iPhone 6 s more and have restored my phone to my backup iCloud however my live Webcam icon picture does not appear. Can anyone help?
-
It is added at the end of your program
Hi all I want to add sound recordings at the end of my code. I added the beep, but I want a pre-recorded voice rather than just a pager. Any ideas how I can import the voice to my code? Thank you
-
Of tab overflow menu BBUI.js not scrolliong
I noticed that the menu tab of overflow on the left of the screen if you have a number of options he doesn't parade not that which is bad, because it can run in portrait mode, but options can be hidden in landscape mode. Is there a workaround or a fi