Home » Developer & Programmer » Application Express & MOD_PLSQL » Create Validation on Item Level (Oracle 11g,XP)
Create Validation on Item Level [message #614005] Wed, 14 May 2014 05:51 Go to next message
Xandot
Messages: 112
Registered: January 2014
Location: India
Senior Member
Hello Experts,
I am going to create validation on item level and the validation are following:--

I have filed like "data size" and two other fields like "upper limit" and "lower limit" ,so my validation is when the data size are greater or lower than the data size than the error message should be popup.. My region type is HTML ..
so How can i do this ..
Please help me out ....

Thanks
Re: Create Validation on Item Level [message #614006 is a reply to message #614005] Wed, 14 May 2014 06:03 Go to previous messageGo to next message
Littlefoot
Messages: 19694
Registered: June 2005
Location: Croatia, Europe
Senior Member
Account Moderator
What kind of an item is it? If it is a NUMBER item, you don't have to write any validation as NUMBER items already contain "Minimum value" and "Maximum value" property so - use them. The same goes for DATE items.

If it is a TEXT item (should be used for alphanumeric values, such as 'May 14th' or 'Xandot'), what do you call "upper/lower limit" in this case?
Re: Create Validation on Item Level [message #614009 is a reply to message #614006] Wed, 14 May 2014 06:18 Go to previous messageGo to next message
Xandot
Messages: 112
Registered: January 2014
Location: India
Senior Member
Thanks for reply ...


Both the fields are number and there is no default upper and lower limit. it'll change according to the data type
like data type "string 20" and if it's size is 128 than the user only able to put the value within the range of 0 to 128 (max upper limit is 128 not greater than 128 and lower limit is 0 not less than that)..

There are so many types of data types are there its a list item of data type so when user is selecting particular data type into the list than the upper limit and lower limit set according to that ..




Re: Create Validation on Item Level [message #614011 is a reply to message #614009] Wed, 14 May 2014 06:26 Go to previous messageGo to next message
Littlefoot
Messages: 19694
Registered: June 2005
Location: Croatia, Europe
Senior Member
Account Moderator
Are you talking about value's length? For example, if - as you said - its size is 128, you can't enter a string longer than 128 characters?

If so, then create a validation (a rather simple PL/SQL block), for example a function that returns Boolean, such as
return length(:PX_YOUR_ITEM) not between :PX_LOWER_LIMIT and :PX_UPPER_LIMIT;


Don't forget about the ultimate limit, represented by underlying table's column data type. If it is, for example,
create table your_table (some_column varchar2(100))
no matter what you put into PX_UPPER_LIMIT item, you won't be able to store values longer than 100 characters into YOUR_TABLE.SOME_COLUMN.
Re: Create Validation on Item Level [message #614057 is a reply to message #614011] Thu, 15 May 2014 03:30 Go to previous message
Xandot
Messages: 112
Registered: January 2014
Location: India
Senior Member
you are absolutely right...
I got my answer ...

Thanks you so much Littlefoot...Smile
Previous Topic: dynamic action to email chart image
Next Topic: Add Column in Interactive Report
Goto Forum:
  


Current Time: Thu Oct 23 11:52:34 CDT 2014

Total time taken to generate the page: 0.10114 seconds