-
Aug 22nd, 2017, 12:20 PM
#1
Thread Starter
Enjoy the moment
[RESOLVED] merging customer how is it done?
hi,
i have 2 clients with the same name and phone number
now this client(s) are in a lot of places in the database
i need to know how can i merge the 2 clients
without losing any old data of the client name
by changing or merging it.
tnx for any help
salsa
-
Aug 22nd, 2017, 12:28 PM
#2
Re: merging customer how is it done?
it's all custom based on the schema.
you have to update all the related records that reference the copy record, with the primary key of the first customer record.
Then delete the second copy of the customer.
-
Aug 22nd, 2017, 12:41 PM
#3
Thread Starter
Enjoy the moment
Re: merging customer how is it done?
hey dex
so you suggest to copy and update all the data then delete it ?
no primary key for the customer
-
Aug 22nd, 2017, 12:48 PM
#4
Re: merging customer how is it done?
I can only generalize without knowing the schema. Like how is it that the customer is all over the database without a primary key?
-
Aug 22nd, 2017, 01:03 PM
#5
Re: merging customer how is it done?
This is why a normalized database design up front is so important.
Trying to normalize after the database has been populated often involves a lot of data cleansing effort to cope with things like variations in the way a name was typed in, typos or changes in things your phone numbers, etc.
But it sounds like you don't want to normalize the database now either. Instead you want to somehow "combine" different records.
If "Jack Black, 123-4567" has two unnormalized haircut records in what way would you "combine" them?
-
Aug 22nd, 2017, 01:11 PM
#6
Thread Starter
Enjoy the moment
Re: merging customer how is it done?
Originally Posted by DEXWERX
I can only generalize without knowing the schema. Like how is it that the customer is all over the database without a primary key?
by fullname
-
Aug 22nd, 2017, 01:12 PM
#7
Thread Starter
Enjoy the moment
Re: merging customer how is it done?
Originally Posted by dilettante
This is why a normalized database design up front is so important.
Trying to normalize after the database has been populated often involves a lot of data cleansing effort to cope with things like variations in the way a name was typed in, typos or changes in things your phone numbers, etc.
But it sounds like you don't want to normalize the database now either. Instead you want to somehow "combine" different records.
If "Jack Black, 123-4567" has two unnormalized haircut records in what way would you "combine" them?
jack black 944555
jack black 944555
combine it in to 1 and then updte all records based on the changed
-
Aug 22nd, 2017, 01:15 PM
#8
Re: merging customer how is it done?
It has nothing to do with normalization - that's about how your data is modelled (i.e. the tables you created and how inter-relate). You can have a fully normalised database design and still encounter this problem, because it has to do with how you have defined your primary keys. Relying on uniqueness of name is obviously very bad. Something like a National Insurance Number (or whatever that is, in Spain) is very good.
btw, Salsa, I believe you have been warned about the potential for this happening in the past (more than once). Can't say I'm over-flowing with sympathy right now!
If you don't know where you're going, any road will take you there...
My VB6 love-children: Vee-Hive and Vee-Launcher
-
Aug 22nd, 2017, 01:16 PM
#9
Re: merging customer how is it done?
Salsa
DEX seems to be onto it, but just to be sure ..
When you say ..
i have 2 clients with the same name and phone number
now this client(s) are in a lot of places in the database
i need to know how can i merge the 2 clients
without losing any old data of the client name
by changing or merging it.
.. it sparks a couple of questions :
1. is it really just one client that appears 2 times in, say Table-1 Clients?
2. if so, what other fields appear in Table-1?
3. how many other tables do you have where this "one" client appears .. what are table names?
Correct me where I went wrong.
EDIT-1:
FWIW, posts #6, 7 and 8 came in while I was composing.,
Spoo
Last edited by Spooman; Aug 22nd, 2017 at 01:19 PM.
-
Aug 22nd, 2017, 01:25 PM
#10
Thread Starter
Enjoy the moment
Re: merging customer how is it done?
hey spoo
well i just found a solution
i will copy same data change the name and then update in all the tables the client is with the older name and the new
name.
-
Aug 22nd, 2017, 01:56 PM
#11
Re: [RESOLVED] merging customer how is it done?
Salsa, a solution would be making sure it cannot happen again not fixing the data afterwards!
If you don't know where you're going, any road will take you there...
My VB6 love-children: Vee-Hive and Vee-Launcher
-
Aug 22nd, 2017, 02:34 PM
#12
Re: merging customer how is it done?
Originally Posted by salsa31
hey spoo
well i just found a solution
i will copy same data change the name and then update in all the tables the client is with the older name and the new
name.
Glad to hear you found a solution.
Spoo
-
Aug 22nd, 2017, 05:18 PM
#13
Re: [RESOLVED] merging customer how is it done?
FWIW, posts #6, 7 and 8 came in while I was composing.,
You must type (or think) slowly!
-
Aug 22nd, 2017, 05:23 PM
#14
Re: merging customer how is it done?
@salsa
What are you doing to prevent something like this in the future? Let's just say someone (else) types in a fullname and his/her telephone number for a hair dye appointment. He/she comes in, gets it done, and pays. (I am sure someone then records that transaction.) But then, the next day, the same dude/dudette shows up and wants a haircut. A different employee, not knowing if Jack/Jane Black is already a customer, types in his/her fullname and telephone number. Then cuts the hair, and completes the update of this 'new' customer. You will be right back where you were at the beginning of this Thread. SO, what ARE you doing to prevent something like this in the future? (Remember, hair 'clerks' probably don't have IQ's like Einstein!)
-
Aug 23rd, 2017, 07:37 AM
#15
Re: [RESOLVED] merging customer how is it done?
Originally Posted by SamOscarBrown
You must type (or think) slowly!
Har har har
But give me a break .. those 3 posts occurred within a 4 minute time stretch.
I thought it was a VBForums rule to take at least 5 minutes to compose a reply.
Spoo
-
Aug 23rd, 2017, 11:57 AM
#16
Re: [RESOLVED] merging customer how is it done?
Originally Posted by Spooman
Har har har
But give me a break .. those 3 posts occurred within a 4 minute time stretch.
I thought it was a VBForums rule to take at least 5 minutes to compose a reply.
Spoo
Nah. You are thinking of the 1 minute rule for composing a question. Such a tight deadline that it can only be achieved by typing in text speak and omitting as much information as possible.
If you don't know where you're going, any road will take you there...
My VB6 love-children: Vee-Hive and Vee-Launcher
-
Aug 23rd, 2017, 04:27 PM
#17
Re: [RESOLVED] merging customer how is it done?
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|