If this is your first visit, be sure to check out the FAQ by clicking the link above. You may have to register before you can post: click the register link above to proceed. To start viewing messages, select the forum that you want to visit from the selection below.

 
Go Back  dBforums > Data Access, Manipulation & Batch Languages > ANSI SQL > Now I know!

Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1 (permalink)  
Old 07-01-04, 15:20
kicker22 kicker22 is offline
Registered User
 
Join Date: Apr 2004
Location: Michigan
Posts: 44
Now I know!

I've been trying to find a match between two tables by using SID as criteria.

So anyway, first table has the following input mask: 000\-00\-0000;;_

so it appears like this: xxx-xx-xxxx
so the original format that is stored is like this: xxxxxxxx

while the other table SID field format is like this: xxx-xx-xxx
what I mean, that the numbers were entered with dashes into the db.

so is there anyway to fix table2 by removing the dashes?

let me know what you guys think..

thanks

p.s. By the way, I know how to use function (trim) in php to get rid of things like that.. but is there another way? if anyones knows ASP function that would do that...that would be great...
or some intense update query that will fix that..

thanks

Last edited by kicker22; 07-01-04 at 15:22. Reason: about php..
Reply With Quote
  #2 (permalink)  
Old 07-01-04, 15:28
Pat Phelan Pat Phelan is offline
Resident Curmudgeon
 
Join Date: Feb 2004
Location: In front of the computer
Posts: 12,605
In MS-SQL, you could use:
Code:
UPDATE myTable
   SET myColumn = Replace(myColumn, '-', '')
-PatP
Reply With Quote
  #3 (permalink)  
Old 07-01-04, 15:28
LKBrwn_DBA LKBrwn_DBA is offline
Registered User
 
Join Date: Jun 2003
Location: West Palm Beach, FL
Posts: 2,455
In Oracle:

UPDATE Table2 SET sid=REPLACE(sid,'-','');
__________________
The person who says it can't be done should not interrupt the person doing it. -- Chinese proverb
Reply With Quote
  #4 (permalink)  
Old 07-01-04, 16:45
kicker22 kicker22 is offline
Registered User
 
Join Date: Apr 2004
Location: Michigan
Posts: 44
yep it worked

thanks guys...
I am new into DB field, and I am learning every day from you guys..

I guess my networking experience has no use in DB

Morad
Reply With Quote
  #5 (permalink)  
Old 07-01-04, 17:01
Pat Phelan Pat Phelan is offline
Resident Curmudgeon
 
Join Date: Feb 2004
Location: In front of the computer
Posts: 12,605
The two skills (networking and database management) are pretty much unrelated, other than the network has to work before the database can communicate over it.

Kind of like carpentry and plumbing. The plumbing doesn't work well without the carpentry. That doesn't mean that I want a carpenter doing my plumbing, or a plumber doing my carpentry. While the skill depend on each other, they are NOT interchangable!

-PatP
Reply With Quote
Reply

Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On