Re: Mask Account Number in Query

From: Malcolm Dew-Jones <yf110_at_vtn1.victoria.tc.ca>
Date: 8 Sep 2005 09:25:23 -0700
Message-ID: <432065f3$1_at_news.victoria.tc.ca>


brett.birschbach_at_cellcom.com wrote:
: In response to DA Morgan, That works fine if I know the length of the
: account number. However, it doesnt work with varying lengths. The
: replacement would be hardcoded to a certain number of asterisks, so in
: my previous example, the accounts would show as

: 123456 -> ******3456
: 1234567890 -> ******7890

Oracle SQL has lots of string manipulation functions. (Heck I think that even generic SQL has these functions.)

One basic idea is to use one of those functions to find the length of the string, and then subtract four from that length, and then replace that many characters at the start of the string with the * character.

--

This programmer available for rent.
Received on Thu Sep 08 2005 - 18:25:23 CEST

Original text of this message