Discussion:
Comparing Table Structures
Gene Wirchenko
2018-04-06 22:19:47 UTC
Permalink
Hello:

I wish to compare two tables' structures. I have a transaction
table, and I wish to check that an import table matches up well enough.

Well enough? All columns in the transaction table must be in
the import table and of the same type and size. If there are
additional column in the import table or if the columns are in a
different order, it does not matter.

It would be nice to able to copy each structure into an array
and then compare them using scan().

Instead, I think that I have to copy structured extended to a
temporary table -- I would prefer a cursor -- and then copy from that
to an array for each of the two tables and only then compare. That
seems rather Rube-Goldbergian.

I could be missing something. I hope I am.

What is a good way of doing this?

Sincerely,

Gene Wirchenko


_______________________________________________
Post Messages to: ***@leafe.com
Subscription Maintenance: http://mail.leafe.com/mailman/listinfo/profox
OT-free version of this list: http://mail.leafe.com/mailman/listinfo/profoxtech
Searchable Archive: http://leafe.com/archives/search/profox
This message: http://leafe.com/archives/byMID/profox/***@mtlp000086
** All postings, unless explicitly stated otherwise, are the opinions of the author, and do not constitute legal or medical advice. This statement is added to the messages for those lawyers who are too stupid to see the obvious.
Frank Cazabon
2018-04-06 22:32:26 UTC
Permalink
Would afields() do what you want?
Post by Gene Wirchenko
I wish to compare two tables' structures. I have a transaction
table, and I wish to check that an import table matches up well enough.
Well enough? All columns in the transaction table must be in
the import table and of the same type and size. If there are
additional column in the import table or if the columns are in a
different order, it does not matter.
It would be nice to able to copy each structure into an array
and then compare them using scan().
Instead, I think that I have to copy structured extended to a
temporary table -- I would prefer a cursor -- and then copy from that
to an array for each of the two tables and only then compare. That
seems rather Rube-Goldbergian.
I could be missing something. I hope I am.
What is a good way of doing this?
Sincerely,
Gene Wirchenko
[excessive quoting removed by server]

_______________________________________________
Post Messages to: ***@leafe.com
Subscription Maintenance: http://mail.leafe.com/mailman/listinfo/profox
OT-free version of this list: http://mail.leafe.com/mailman/listinfo/profoxtech
Searchable Archive: http://leafe.com/archives/search/profox
This message: http://leafe.com/archives/byMID/profox/9C0052C8-EA7D-4BA7-9AAA-***@gmail.com
** All postings, unless explicitly stated otherwise, are the opinions of the author, and do not constitute legal or medical advice. This statement is added to the messages for those lawyers who are too stupid to see the obvious.
Gene Wirchenko
2018-04-07 03:42:24 UTC
Permalink
Post by Frank Cazabon
Would afields() do what you want?
Yes. Someone else on Foxite just suggested it, too. I missed
that afields() returns an array, and having a near-solution with
arrays, I blindsided myself.

Thank you.

[snip]

Sincerely,

Gene Wirchenko



_______________________________________________
Post Messages to: ***@leafe.com
Subscription Maintenance: http://mail.leafe.com/mailman/listinfo/profox
OT-free version of this list: http://mail.leafe.com/mailman/listinfo/profoxtech
Searchable Archive: http://leafe.com/archives/search/profox
This message: http://leafe.com/archives/byMID/profox/***@mtlp000085
** All postings, unless explicitly stated otherwise, are the opinions of the author, and do not constitute legal or medical advice. This statement is added to the messages for those lawyers who are too stupid to see the obvious.
Stephen Russell
2018-04-07 11:10:50 UTC
Permalink
I would have listed them out, copied and pasted into excel where I could
sort, edit and move content for missing columns. My last column would be
IsDifferent between the two.

Using a column to explain the column as well is always nice.
Post by Frank Cazabon
Would afields() do what you want?
Yes. Someone else on Foxite just suggested it, too. I missed that
afields() returns an array, and having a near-solution with arrays, I
blindsided myself.
Thank you.
[snip]
Sincerely,
Gene Wirchenko
[excessive quoting removed by server]

_______________________________________________
Post Messages to: ***@leafe.com
Subscription Maintenance: http://mail.leafe.com/mailman/listinfo/profox
OT-free version of this list: http://mail.leafe.com/mailman/listinfo/profoxtech
Searchable Archive: http://leafe.com/archives/search/profox
This message: http://leafe.com/archives/byMID/profox/CAJidMY+***@mail.gmail.com
** All postings, unless explicitly stated otherwise, are the opinions of the author, and do not constitute legal or medical advice. This statement is added to the messages for those lawyers who are too stupid to see the obvious.
Kurt at VR-FX
2018-04-07 12:31:11 UTC
Permalink
Well, Gene - you know how it is! We get old - and sometimes we me the
obvious...

:-)

-K-
Post by Frank Cazabon
Would afields() do what you want?
     Yes.  Someone else on Foxite just suggested it, too.  I missed
that afields() returns an array, and having a near-solution with
arrays, I blindsided myself.
     Thank you.
[snip]
Sincerely,
Gene Wirchenko
[excessive quoting removed by server]

_______________________________________________
Post Messages to: ***@leafe.com
Subscription Maintenance: http://mail.leafe.com/mailman/listinfo/profox
OT-free version of this list: http://mail.leafe.com/mailman/listinfo/profoxtech
Searchable Archive: http://leafe.com/archives/search/profox
This message: http://leafe.com/archives/byMID/profox/58ffd96d-6732-1092-81f0-***@optonline.net
** All postings, unless explicitly stated otherwise, are the opinions of the author, and do not constitute legal or medical advice. This statement is added to the messages for those lawyers who are too st
Andrew Stirling
2018-04-07 02:38:20 UTC
Permalink
You could try the evaluation copy of CMCOMPARE
https://www.cmstory.com/



Andrew Stirling
     I wish to compare two tables' structures.  I have a transaction
table, and I wish to check that an import table matches up well enough.
     Well enough?  All columns in the transaction table must be in the
import table and of the same type and size.  If there are additional
column in the import table or if the columns are in a different order,
it does not matter.
     It would be nice to able to copy each structure into an array and
then compare them using scan().
     Instead, I think that I have to copy structured extended to a
temporary table -- I would prefer a cursor -- and then copy from that to
an array for each of the two tables and only then compare.  That seems
rather Rube-Goldbergian.
     I could be missing something.  I hope I am.
     What is a good way of doing this?
Sincerely,
Gene Wirchenko
[excessive quoting removed by server]

_______________________________________________
Post Messages to: ***@leafe.com
Subscription Maintenance: http://mail.leafe.com/mailman/listinfo/profox
OT-free version of this list: http://mail.leafe.com/mailman/listinfo/profoxtech
Searchable Archive: http://leafe.com/archives/search/profox
This message: http://leafe.com/archives/byMID/profox/34008668-66db-d67a-fed5-***@calcpay.co.uk
** All postings, unless explicitly stated otherwise, are the opinions of the author, and do not constitute legal or medical advice. This statement is added to the messages for those lawyers who are
Continue reading on narkive:
Loading...