Home » Developer & Programmer » Forms » Trim functionality in Oracle forms 10g
Trim functionality in Oracle forms 10g [message #629431] Tue, 09 December 2014 03:36 Go to next message
tara_260985
Messages: 46
Registered: November 2014
Member
Hi all,

I have a text item named "'Item Xref Number', in db its dataype is varchar2(25),If the 'Item Xref Num' is entered with leading/trailing spaces from the form ,then I want to trim the leading/trailing spaces before storing into DB.
how can I use this functionality in oracle forms as I want to trim the blank spaces before it gets added to the database.
Re: Trim functionality in Oracle forms 10g [message #629436 is a reply to message #629431] Tue, 09 December 2014 03:50 Go to previous messageGo to next message
Littlefoot
Messages: 21807
Registered: June 2005
Location: Croatia, Europe
Senior Member
Account Moderator
Trim it in WHEN-VALIDATE-ITEM trigger. Alternatively, PRE-INSERT and PRE-UPDATE might be candidates.
Re: Trim functionality in Oracle forms 10g [message #629438 is a reply to message #629436] Tue, 09 December 2014 03:53 Go to previous messageGo to next message
tara_260985
Messages: 46
Registered: November 2014
Member
how to make the text field case insenstive in oracle forms
Re: Trim functionality in Oracle forms 10g [message #629439 is a reply to message #629438] Tue, 09 December 2014 04:01 Go to previous messageGo to next message
Littlefoot
Messages: 21807
Registered: June 2005
Location: Croatia, Europe
Senior Member
Account Moderator
By setting the appropriate item's property.
Re: Trim functionality in Oracle forms 10g [message #629441 is a reply to message #629439] Tue, 09 December 2014 04:07 Go to previous messageGo to next message
tara_260985
Messages: 46
Registered: November 2014
Member
its like if I have entered a value in text field as "test123" and its saved in database.
If the user tries to enter a new value as "TEST123" or "Test123" it should prompt the user that value already exists.
so that there is no duplicate values saved in DB.
In oracle forms ,for that particular item in property palette the case restriction is as of now "MIXED"
Re: Trim functionality in Oracle forms 10g [message #629443 is a reply to message #629441] Tue, 09 December 2014 04:13 Go to previous messageGo to next message
Littlefoot
Messages: 21807
Registered: June 2005
Location: Croatia, Europe
Senior Member
Account Moderator
I see; that's not what you asked previously.

Create a function-based unique index on that column, such as
create unique index ui_upper_col on your_table (upper(col));
Re: Trim functionality in Oracle forms 10g [message #629445 is a reply to message #629443] Tue, 09 December 2014 04:25 Go to previous messageGo to next message
tara_260985
Messages: 46
Registered: November 2014
Member
its not necessary uppercase,the comparison should be case insensitive.
if similar data exists irrespective of upper or lower or mixed characters,user should not be allowed to enter the same data to avoid duplicate records getting inserted in the DB
Re: Trim functionality in Oracle forms 10g [message #629446 is a reply to message #629445] Tue, 09 December 2014 04:27 Go to previous messageGo to next message
Littlefoot
Messages: 21807
Registered: June 2005
Location: Croatia, Europe
Senior Member
Account Moderator
Obviously, you didn't test what I suggested, did you?
Re: Trim functionality in Oracle forms 10g [message #629447 is a reply to message #629446] Tue, 09 December 2014 04:41 Go to previous messageGo to next message
tara_260985
Messages: 46
Registered: November 2014
Member
there is already a unique key index on this col
Re: Trim functionality in Oracle forms 10g [message #629448 is a reply to message #629447] Tue, 09 December 2014 04:51 Go to previous message
Littlefoot
Messages: 21807
Registered: June 2005
Location: Croatia, Europe
Senior Member
Account Moderator
This is pointless. Why are you asking for assistance and then refuse to do as instructed?
Previous Topic: What version of Oracle forms am i running (merged)
Next Topic: how pass all parameter
Goto Forum:
  


Current Time: Sat Apr 20 02:30:42 CDT 2024