Menghapus selain number pada kolom varchar2 di oracle

ya . aneh memang terdengar. kolomnya varchar2 tapi pengennya terisi hanya number saja.

ya anggap saja anda membuat kesalahan dengan tipe data yang terlanjur varchar2 dan data – data udah masuk semua.. hmm

bagaimana caranya di oracle ? begini caranya :

jalankan query :

“DELETE FROM <nama_tabel> WHERE instr(translate(<nama_kolom>,

        ‘abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ’,

‘XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX’),’X’) > 0″;

 

done.

Advertisements

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