Home » Developer & Programmer » Forms » How to apply the format mask to number contains character (oracle)
How to apply the format mask to number contains character [message #337660] Thu, 31 July 2008 09:33 Go to next message
rajesh4851
Messages: 89
Registered: January 2007
Member
Hi,
Iam struggling with one issue,how to apply format mask to a character value. I hope it is not possible to apply any built-ins.

Please let me know how to apply the format mask to number contains characters.
For example : 12345ABCD6
I have to print this value like 1234.5AB.CD6
Another example ZU12345ABCD6
output should be -> 1234.5AB.CD6

Please provide me the logic or example code.
Thanks in advance.

Regards,
Rajesh
Re: How to apply the format mask to number contains character [message #337672 is a reply to message #337660] Thu, 31 July 2008 10:31 Go to previous messageGo to next message
cvs_1984
Messages: 136
Registered: August 2007
Location: Punjab, INDIA
Senior Member

Try it

select substr(Columnname,1,4)||'.'||substr(Columnname,5,3)||'.'||substr(Columnname,8,3) from tablename;


Re: How to apply the format mask to number contains character [message #337674 is a reply to message #337672] Thu, 31 July 2008 10:40 Go to previous messageGo to next message
rajesh4851
Messages: 89
Registered: January 2007
Member
Hi Thanks for your concern.
But the length of the column is not fixed. It can contain upto 14 digits and can contain points already. Infact we have to read the number from left to right and check the points availble in 4th, 8th places, if not put the point like that.
So please give such example. There is no restriction you can provide function/procedure.
Re: How to apply the format mask to number contains character [message #337684 is a reply to message #337674] Thu, 31 July 2008 11:34 Go to previous message
Littlefoot
Messages: 21823
Registered: June 2005
Location: Croatia, Europe
Senior Member
Account Moderator
OK, we could do that for our amusement, but - what piece of code did YOU produce in order to solve the problem? Why did it not work? Was there any error? If so, which one?
Previous Topic: Leading Zeros when exporting from forms
Next Topic: Map checkbox to database-items (Was: One-Time-Only Procedure)
Goto Forum:
  


Current Time: Mon Feb 03 09:44:55 CST 2025