Discussion:
"Data type mismatch" error on FoxPro "Select tablealias" Command
(too old to reply)
Paul Pedersen
2009-01-14 18:55:17 UTC
Permalink
Is there a relation set somewhere? Check data types in the involved columns.
Perhaps nulls are causing the problem.

Reindexing wouldn't hurt either.
Hello and thanks in advance for any help you can provide on this problem.
We
have a large FoxPro 9 SP2 project that has started receiving "Data type
mismatch" errors on several different "Select tablealias" statements
within
the same procedure. This procedure is used frequently throughout the day,
but the error generally only occurrs once every several days. Once the
user
has seen the error, they can reprocess the same data and the program works
correctly as designed. The error has occurred on three different "Select"
statements involving three different aliases. I have captured "Show
Status"
and "Show Memory" information from an "On Error" routine and everything
looks
to me like it should. The table aliases are listed and the correct index
is
marked as "master" in the "Show Status" output. I have reviewed the
memory
variables as reported in "Show Memory" and I do not see anything out of
place. My questing is why would you get a "Data type mismatch" on a
"Select
tablealias" statement? I am using the actual alias name with the Select -
there are no variables involved. Has anyone had similar experiences? Any
ideas of where I should go from here?
Richard Stecenko
2009-01-14 18:51:10 UTC
Permalink
Is it possible that one of the indices is compound and uses a field
that is null in the table when it is selected.

Or an index that uses a variable that is out of scope. I know that you
should never, ever do this, but sometimes these little contretemps
creep into code.

Or if you are selecting a cursor rather than a table, could there be a
calculated field based on a null.

If it happens only occasionally, then I'd bet it's the data in the
record that you are sitting on when the error occurs.

Richard Stecenko
Interactive Computer Services Inc.
Winnipeg, Canada
204.453.2052
Moshe Deutsch
2011-02-23 17:56:51 UTC
Permalink
I have the same problem, what was you solution?

Thanks
Hello and thanks in advance for any help you can provide on this problem. We
have a large FoxPro 9 SP2 project that has started receiving "Data type
mismatch" errors on several different "Select tablealias" statements within
the same procedure. This procedure is used frequently throughout the day,
but the error generally only occurrs once every several days. Once the user
has seen the error, they can reprocess the same data and the program works
correctly as designed. The error has occurred on three different "Select"
statements involving three different aliases. I have captured "Show Status"
and "Show Memory" information from an "On Error" routine and everything looks
to me like it should. The table aliases are listed and the correct index is
marked as "master" in the "Show Status" output. I have reviewed the memory
variables as reported in "Show Memory" and I do not see anything out of
place. My questing is why would you get a "Data type mismatch" on a "Select
tablealias" statement? I am using the actual alias name with the Select -
there are no variables involved. Has anyone had similar experiences? Any
ideas of where I should go from here?
Post by Richard Stecenko
Is it possible that one of the indices is compound and uses a field
that is null in the table when it is selected.
Or an index that uses a variable that is out of scope. I know that you
should never, ever do this, but sometimes these little contretemps
creep into code.
Or if you are selecting a cursor rather than a table, could there be a
calculated field based on a null.
If it happens only occasionally, then I'd bet it's the data in the
record that you are sitting on when the error occurs.
Richard Stecenko
Interactive Computer Services Inc.
Winnipeg, Canada
204.453.2052
Post by Paul Pedersen
Is there a relation set somewhere? Check data types in the involved columns.
Perhaps nulls are causing the problem.
Reindexing would not hurt either.
Submitted via EggHeadCafe
ASP.NET- How to Raise Custom Events from a UserControl
http://www.eggheadcafe.com/tutorials/aspnet/d5f6cb27-dc1b-4233-86c0-aa8437138e47/aspnet-how-to-raise-custom-events-from-a-usercontrol.aspx
Loading...