Oracle, Web, Script, SQLserver, Tips & Trick

March 22, 2013

Example Format mask for varchar2 (PL/SQL or Oracle Developer 6i)

Filed under: dev6i,oracle — sikathabis @ 2:45 pm
Tags: , ,

For example if you want to automate format mask 0000009 or 0000000 for a field on oracle dev6i (FORM) which that field not number, but varchar2 (alfanumerik)

PL/SQL how to create format mask on varchar2 (example field length 7 char)

if length(:NO_SERI)<7 then
   begin
     :NO_SERI := LTRIM(TO_CHAR(TO_NUMBER(:NO_SERI),'0000009')); 
   exception when others then
         :NO_SERI := substr('0000000',1,7-length(:NO_SERI))||:NO_SERI;
   end;
end if;   

Input
A
200

Result
000000A
0000200

Leave a Comment »

No comments yet.

RSS feed for comments on this post. TrackBack URI

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s

Blog at WordPress.com.

Teknologi Pendidikan

Just another WordPress.com weblog

KATAKAMI

Jurnalisme Yang Dapat Dipercaya

Tonk Kosonk Baonk Bunyinya

Penampungan Serapah Tanpa Sumpah

Qey050489's Blog

Ayo Bangkit sobat..!!!!!

B. S. Totoraharjo

Orang Bodoh Yang Tak Kunjung Pandai

culturekitchen foodlab

New Food and Art in Yogyakarta

Wahyu Catur Wibowo

Musafir Dunia Maya

SQL.... Still Learning

My Reference on SQL Server

neinframe

Street Photography is like a box of a chocolates, you're never know what you're gonna get - Thomas Leuthard -

Keluarga Andrivito

-- Andrivito's Journal --

DRK™

This site is about Latest NEWS, Articles, Videos, Books, Course, Presentations, Tips & Tricks related to I.T Pro's

Gaurav Saxena

|| तत् त्वम् असि ||

Be a good Moeslim

Menuju Pribadi Muslim Sejati yang Bertaqwa

TuanSUFI

Manajemen Sholat, renungan spiritual, Teknologi Informasi

Pelangi di khatulistiwa....

Mari berbagi kebaikan, pengalaman dan senyum denganku

angkasa13

Ceritanya saya, Pikirannya saya, Hatinya saya

sikathabis

sikathabis semua informasi disini

%d bloggers like this: