[comp.databases] Clipper 'S87 TYPE MISMATCH

mcormier@micor.OCUnix.On.Ca (Michel B. Cormier) (01/25/91)

Hi netters,

I've encountered an interesting problem with clipper S87.  Here it goes:

First we have a database, say junky, containing only deleted records 
(not yet packed!)

I have a routine that basically does a SELECT JUNKY (the databases are all
opened a long time before) followed by some more works.  This routines works 
MOST of the time.  In one particular instance however I get a 
TYPE MISMATCH ERROR on the select statement.  Changing that particular 
SELECT to SELECT 8 makes the problem vanish.  Also, marking at least one 
record as non-deleted (which I don't want to do) solves the problem.

I am at lost (... even in trying to describe the problem  ... ), anybody
has any ideas ????  Please e-mail and I will summarize.


MBC
--
Michel B. Cormier              | UUCP: mcormier@micor.uucp
Computer Consultant            | Internet: mcormier@micor.ocunix.on.ca
DOS/Unix/MPE V/MPE XL          | BBS:   (613) 237-5077
=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=+=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=

tleylan@pegasus.com (Tom Leylan) (01/28/91)

In article <1991Jan25.031035.4546@micor.OCUnix.On.Ca> mcormier@micor.OCUnix.On.Ca (Michel B. Cormier) writes:
>
>I have a routine that basically does a SELECT JUNKY (the databases are all
>opened a long time before) followed by some more works.  This routines works 
>MOST of the time.  In one particular instance however I get a 
>TYPE MISMATCH ERROR on the select statement.  Changing that particular 
>SELECT to SELECT 8 makes the problem vanish.  Also, marking at least one 
>record as non-deleted (which I don't want to do) solves the problem.
>
Michel,

It has to be something major that is in your code since it isn't caused
by anything Clipper is doing wrong.  For the most part you will want to
always reference a file by it's alias.  The only reason I can see that
you lose an alias is that the file got closed somehow.  Could it be that
it doesn't happen when you're testing the SELECT 8 but that if you used
the program longer it might ?

You can setup a test as you enter the module and before you do the SELECT
command.  Add a line similar to @ 0, 0 SAY JUNKY->(USED()) which will
print a .T. or .F. in the corner of the screen.

JUNKY by the way has to be an ALIAS and not a string variable, you wouldn't
happen to be doing  JUNKY = "myfile"    USE &JUNKY.  are you ?

Keep looking, trace through your code.

tom leylan
ex-senior systems analyst / Nantucket Corp.

mcormier@micor.OCUnix.On.Ca (Michel B. Cormier) (01/29/91)

In article <1991Jan28.125745.19241@pegasus.com> tleylan@pegasus.com (Tom Leylan) writes:
>In article <1991Jan25.031035.4546@micor.OCUnix.On.Ca> mcormier@micor.OCUnix.On.Ca (Michel B. Cormier) writes:
>>
>>I have a routine that basically does a SELECT JUNKY (the databases are all
>>opened a long time before) followed by some more works.  This routines works 
>>MOST of the time.  In one particular instance however I get a 
>>TYPE MISMATCH ERROR on the select statement.  Changing that particular 
>>SELECT to SELECT 8 makes the problem vanish.  Also, marking at least one 
>>record as non-deleted (which I don't want to do) solves the problem.
>>
>Michel,
>
>It has to be something major that is in your code since it isn't caused
>by anything Clipper is doing wrong.  For the most part you will want to
>always reference a file by it's alias.  The only reason I can see that
>you lose an alias is that the file got closed somehow.  Could it be that

You got it!  I had time to trace thru my code today and found this awful
CLOSE statement lying in the middle of my code.  Of course, once the file
was closed, the alias was not working anymore.  I still don't remembering
putting that CLOSE statement there but I'll take the blame for this one.

However, I still don't understand why the SELECT 8 was working even with
the file being closed... Am I missing something???

Thanks also to the other suggestion I received by mail.

MBC
-- 
Michel B. Cormier              | UUCP: mcormier@micor.uucp
Computer Consultant            | Internet: mcormier@micor.OCUnix.On.Ca
DOS/Unix/MPE V/MPE XL          | BBS:   (613) 237-5077
=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=+=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=

tleylan@pegasus.com (Tom Leylan) (01/30/91)

In article <1991Jan28.233729.10049@micor.OCUnix.On.Ca> mcormier@micor.OCUnix.On.Ca (Michel B. Cormier) writes:
>
>However, I still don't understand why the SELECT 8 was working even with
>the file being closed... Am I missing something???
>
Michel,  Just luck I guess... obviously SELECT 8 is impervious to the 
missing ALIAS problem but why the file was opened there ... it's possible
that you had the file opened twice.  Once in the "real" area where you
used it all the time and accidentally in workarea 8.  You might take a
moment and see if the file is opened in more than one area just for kicks.

tom

timk@wynnds.xenitec.on.ca (Tim Kuehn) (01/31/91)

In article <1991Jan30.094848.6304@pegasus.com> tleylan@pegasus.com (Tom Leylan) writes:
>In article <1991Jan28.233729.10049@micor.OCUnix.On.Ca> mcormier@micor.OCUnix.On.Ca (Michel B. Cormier) writes:
>>
>>However, I still don't understand why the SELECT 8 was working even with
>>the file being closed... Am I missing something???
>>
>Michel,  Just luck I guess... obviously SELECT 8 is impervious to the 
>missing ALIAS problem but why the file was opened there ... 

the reason "Select 8" works is that doing so gets you work area #8, which 
doesn't look for a database alias. 

   ------------------------------------------------------------------------ 
   Tim Kuehn			    TDK Consulting Services  (519)-888-0766
   timk@wynnds.xenitec.on.ca  -or-  !{watmath|lsuc}!xenitec!wynnds!timk
   Valpo EE turned loose on unsuspecting world! News at 11!