t'is not a credit card number, but that's ok, doesn't matter.
really its just for readability sake on a printed label.
:) so, basically im working with an old label making program, formatting
some data, sending it to a csv, odbc on the client pc, to the csv file,
and then the label program works from the csv, I need to get this in
this way each time, and still store the Number in my sql database, as a
number, not as a varchar...
make sense?
need quick and dirty way, on the fly, each time, to format those
numbers, or don't do it at all, and tell the higher ups, I cant ;)
...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
-----Original Message-----
From: Ryan Duckworth [mailto:[EMAIL PROTECTED]
Sent: Friday, July 02, 2004 12:07 PM
To: CF-Talk
Subject: RE: sql question
>>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]
- RE: SQL QUESTION Bruce, Rodney S HQISEC/Veridian IT Services
- SQL Question Kelly Keith
- RE: SQL Question Burns, John D
- RE: SQL Question Kelly Keith
- Re: SQL Question Carolyn Foster
- sql question Tony Weeg
- Re: sql question Ian Potts
- RE: sql question Dave Watts
- Re: sql question Dick Applebaum
- RE: sql question Ryan Duckworth
- Re: sql question Tony Weeg
- Re: sql question Joe Rinehart
- sql question Tony Weeg
- Re: sql question Thomas Chiverton
- Re: sql question Stephen Moretti (cfmaster)
- Re: sql question Tony Weeg
- Re: sql question Tony Weeg
- Re: sql quest... Tony Weeg
- Re: sql question Tony Weeg
- Re: sql question Joe Rinehart
- Re: sql question Deanna Schneider