1

Topic: Problem of copying from one table in another!

Good afternoon, all!
There is such problem. Help, please, with its decision.
There is a table:
In it there are fields:
id
fio
chet
There is table B:
In it there are fields:
id
fio
From table B the data is copied in the table And.
The table And still can be hammered into the manual.
Problem following: how to check there is such record and if there is that it not to add.
I.e. is:
id: 2
fio: Petrov
We copy them in the table And:
There is
id: 3
fio: Petrov
But it is the same person, it is simple in the table And it has been brought in manual and consequently it is not necessary to add it.
Fields, it will be finite more - I so for an example showed.
I.e. how to organize check about presence given  that on given person not to add again record.
Also there would be no two Petrovs!!!
Thanks

2

Re: Problem of copying from one table in another!

dima_18;

sele tableA
scan
lcfio=upper (allt (fio))
sele tableB
locate for upper (allt (fio)) == lcfio
if! found ()
insert into tableB (id, fio) values (tableA.id, tableA.fio)
endif
endscan

3

Re: Problem of copying from one table in another!

dima_18;
Again all depends on the task.
On mind, it is necessary to supervise not a surname.
There should be a reference manual "Petrovyh"
And this reference manual, is "as though conducted separately.
Then the structure looks so.
Table Client
ClientId
FIO
There is a table:
In it there are fields:
id
ClientId
chet
There is table B:
In it there are fields:
id
ClientId
Control variants - mass!!! (Depends on the task))))))
Than you (I am silent about ) is bad One Petrov, Pitrov, Ptrov etc. and foreheads writes all same.
There should be a reference manual whence it is selected.

4

Re: Problem of copying from one table in another!

Many thanks to all for helps, I will think now as well as that.
But variants which you offered me are pleasant - I will be though somehow them to adapt.
If that, I apologize, I will ask you questions.