>>is there a function in transact sql that allows something like the
cfmx insert() function?


To display it, just use mid and call your CFC function that returns the
decrypted CC number.


#mid(objCreditCard.getCcNumberDecrypted(),1,4)#-#mid(objCreditCard.getCc
NumberDecrypted(),5,4)#-#mid(objCreditCard.getCcNumberDecrypted(),9,4)#-
#mid(objCreditCard.getCcNumberDecrypted(),13,4)#


If you want to convert all of them from 1234567891234567 to
1234-5678-9123-4567 I would just:
1. Change the type of your DB field
2. Use a regular _expression_ to add the dashes
3. Run an update on each Credit Card number.  Even with 10,000 records,
CF would blaze through the list in a few minutes.


Note: Amex and a few other cards have different lengths, so be careful

Ryan Duckworth
Macromedia Coldfusion Certified Professional
Uhlig Communications
10983 Granada Lane
Overland Park, KS 66207
(913) 754-4272

-----Original Message-----
From: Tony Weeg [mailto:[EMAIL PROTECTED]
Sent: Friday, July 02, 2004 10:42 AM
To: CF-Talk
Subject: sql question


is there a function in transact sql that allows something like
the cfmx
insert() function?

I have a number field, 1236547852145632, that I want to display
like:

1236-5478-5214-5632

and don't want to do this...

<cfset myNum = 4103346331>

<cfloop from = 4 to = #len(myNum)# index = i step = 5>
<cfset myNum = insert('-',myNum,i)>
</cfloop>

too many times in a 10000 query recordset :)
if I can pass it off to sql server, GREAT!

thanks.

...tony

tony weeg
senior web applications architect
navtrak, inc.
www.navtrak.net
[EMAIL PROTECTED]
410.548.2337

visit www.antiwrap.com to send long url emails to your friends!

-- dont mistake my perfection as arrogance
anonymous
  _____
[Todays Threads] [This Message] [Subscription] [Fast Unsubscribe] [User Settings] [Donations and Support]

Reply via email to