Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations strongm on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Formatted field

Status
Not open for further replies.

anju123

Programmer
Jun 6, 2003
33
CA
Hi Friends,
I have one problem. There is a data base block and its multi line displayed item property is set to true (4). In post query I have written a code to display one of the items (phone number) in a format ((xxx)-xxx-xxxx). Phone number is base table item and its data type is number in table but in form I have changed it to varchar as I have to display it in formatted form. My problem is when I try to make any changes in that form and when queried item is more than one then it creates problem (unable to insert record). That’s because phone data type has changed to varchar and in table it number. In key-commit I have written a code to change that formatted phone number to number data type but that changes only one record not all of them. Can anyone help me how can I change those all phone number in varchar format to number format.
Thanks in advance.

Anju
 
Apparently you shouldn't use this triger, because it fires only once: on pressing commit key. Your task may be done in different ways:
1. You may add invisible "original" base table item (if not already done) and copy [casted] value to it during before-insert trigger. The drawback is that you can not serach by that field or should add pre-query trigger
2. You may base your block on view, not on table. Updating may be done by instead-of trigger
3. You may use '000G000G0000' format mask, that is not completely the same as you need, but still is quite descriptive.

Regards, Dima
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top