set item in form

chalie001
chalie001 used Ask the Experts™
on
how can i set value to this after insert
6210-14-242-8258
 
set item emp to be in this format after i insert which trigger must i use
Comment
Watch Question

Do more with

Expert Office
EXPERT OFFICE® is a registered trademark of EXPERTS EXCHANGE®
Most Valuable Expert 2012
Distinguished Expert 2018

Commented:
Isn't this the same as your previous question:
https://www.experts-exchange.com/questions/29008102/inserting-value-in-table-in-oracle-form.html

I remember other questions that were very similar about screen masking versus inserting the data.

Author

Commented:
no is not the same i just what to display value in this form in oracle form 6210-14-242-8258
Most Valuable Expert 2012
Distinguished Expert 2018

Commented:
If you want to physically update the data to add the dashes in the table on insert, then the form should just be able to display what it receives without any format masking.

If this is what you want to do, you should be able to apply the formatting inside the form and insert the data in the desired format.  I remember you asked a question on how to do that.  I just cannot find it.

I've not used forms for many years but are you wanting forms triggers or database level triggers?

If database level triggers:
If you cannot get forms to insert the data correctly, as a last resort you should be able to create a before insert trigger.  You might need an after insert trigger if forms interferes with the before trigger.
Ensure you’re charging the right price for your IT

Do you wonder if your IT business is truly profitable or if you should raise your prices? Learn how to calculate your overhead burden using our free interactive tool and use it to determine the right price for your IT services. Start calculating Now!

awking00Information Technology Specialist

Commented:
Can you show some sample values that get inserted and how you would like them to be after an update?

Author

Commented:
FM0999-99-999-9999
Most Valuable Expert 2012
Distinguished Expert 2018
Commented:
Between this question and your other one, I'm not sure what you are trying to do and where you are trying to do it so I'll post this in both questions and hope it helps.

If you want to turn a set of numbers and apply a mask to add dashes at specific places, a regexp_replace will do that.

Here is an example:
with mydata as (
	select '8745155258732' mycol from dual
	union all
	select '9874166787831' mycol from dual
	union all
	select '3748177602234' mycol from dual
)
select regexp_replace(mycol,'([0-9]{4})([0-9]{2})([0-9]{3})([0-9]{4})','\1-\2-\3-\4')
from mydata;

Open in new window

Author

Commented:
select regexp_replace(mycol,'([0-9]{4})([0-9]{2})([0-9]{3})([0-9]{4})','\1-\2-\3-\4')

Do more with

Expert Office
Submit tech questions to Ask the Experts™ at any time to receive solutions, advice, and new ideas from leading industry professionals.

Start 7-Day Free Trial