dbTalk Databases Forums  

VFP 9: Filters Implemented with SQL

comp.databases.xbase.fox comp.databases.xbase.fox


Discuss VFP 9: Filters Implemented with SQL in the comp.databases.xbase.fox forum.



Reply
 
Thread Tools Display Modes
  #1  
Old   
Gene Wirchenko
 
Posts: n/a

Default VFP 9: Filters Implemented with SQL - 01-03-2008 , 07:45 PM






The client billing app that I maintain has many browses. My boss
is used to the presentation, so I have stretched their use, probably
overstretched. The latest is definitely kludgy, if not somewhat of a
travesty.

My boss wants to be able to see which Work Function Codes (what
is done) exist in a given year that do not have a later version. (Work
Function Codes have a date that they are valid until (validtil).) A
browse is better for our purposes than a cursor because it is
updatable to the base table.

I have implemented a proof-of-concept kludge^Wtravesty^Wsomething
to do this. Undoubtedly, there are better ways. It is somewhat slow
to start up, but is generally fine after.

MY QUESTION: Am I relying on any potentially undefined behaviour
to get what appear to be correct results?

(cbs2.h defines some values used in the client billing system as
a whole. The only one used in this program is "SQLSEL" which maps to
"select".)

********** Start of Included Program **********
* r477filt
* Check for Missing New WFCs by Filter
* Last Modification: 2008-01-03

? "*** Execution begins."
? program()

close all
clear all

set talk off
set exact on
set ansi on
set deleted on

*

#include "cbs2.h"

use cwkf exclusive

index on upper(clcode+funccode+wccode)+dtos(validtil) tag r477filt
index on clcode tag r477clc
index on funccode tag r477wfc
index on wccode tag r477wcc
index on validtil tag r477vt

use cwkf order tag r477filt
set filter to livefilter()

browse normal

use in cwkf

*

close all
clear all
? "*** Execution ends."
return



procedure livefilter

oldlow={^2007.01.01}
oldhigh={^2007.12.31}

infunccode=funccode
inclcode=clcode
inwccode=wccode
invalidtil=validtil

SQLSEL * from cwkf;
where;
funccode=infunccode and clcode=inclcode and wccode=inwccode and;
validtil=;
(;
SQLSEL max(validtil) from cwkf;
where;
funccode=infunccode and clcode=inclcode and wccode=inwccode;
);
and validtil>=oldlow and validtil<=oldhigh;
into cursor checker

retval=.t.
select checker
goto top
rowcount=reccount()
ckvalidtil=validtil
use in checker

return rowcount=1 and ckvalidtil=invalidtil

endproc
********** End of Included Program **********

Sincerely,

Gene Wirchenko

Computerese Irregular Verb Conjugation:
I have preferences.
You have biases.
He/She has prejudices.

Reply With Quote
  #2  
Old   
Gene Wirchenko
 
Posts: n/a

Default Re: VFP 9: Filters Implemented with SQL - 01-06-2008 , 01:30 AM






Gene Wirchenko <genew (AT) ocis (DOT) net> wrote:

[snip]

Quote:
MY QUESTION: Am I relying on any potentially undefined behaviour
to get what appear to be correct results?
I thought I had things working just fine. Suddenly, I am getting
C*5 errors. I do not always get them, but I can not see what it is
that is causing the problem.

What do you do to track down C*5 errors? The normal debugging
approaches do not work when VFP itself goes south.

[snip]

Sincerely,

Gene Wirchenko

Computerese Irregular Verb Conjugation:
I have preferences.
You have biases.
He/She has prejudices.


Reply With Quote
  #3  
Old   
Gene Wirchenko
 
Posts: n/a

Default Re: VFP 9: Filters Implemented with SQL - 01-06-2008 , 01:30 AM



Gene Wirchenko <genew (AT) ocis (DOT) net> wrote:

[snip]

Quote:
MY QUESTION: Am I relying on any potentially undefined behaviour
to get what appear to be correct results?
I thought I had things working just fine. Suddenly, I am getting
C*5 errors. I do not always get them, but I can not see what it is
that is causing the problem.

What do you do to track down C*5 errors? The normal debugging
approaches do not work when VFP itself goes south.

[snip]

Sincerely,

Gene Wirchenko

Computerese Irregular Verb Conjugation:
I have preferences.
You have biases.
He/She has prejudices.


Reply With Quote
  #4  
Old   
Gene Wirchenko
 
Posts: n/a

Default Re: VFP 9: Filters Implemented with SQL - 01-06-2008 , 01:30 AM



Gene Wirchenko <genew (AT) ocis (DOT) net> wrote:

[snip]

Quote:
MY QUESTION: Am I relying on any potentially undefined behaviour
to get what appear to be correct results?
I thought I had things working just fine. Suddenly, I am getting
C*5 errors. I do not always get them, but I can not see what it is
that is causing the problem.

What do you do to track down C*5 errors? The normal debugging
approaches do not work when VFP itself goes south.

[snip]

Sincerely,

Gene Wirchenko

Computerese Irregular Verb Conjugation:
I have preferences.
You have biases.
He/She has prejudices.


Reply With Quote
  #5  
Old   
Gene Wirchenko
 
Posts: n/a

Default Re: VFP 9: Filters Implemented with SQL - 01-06-2008 , 01:30 AM



Gene Wirchenko <genew (AT) ocis (DOT) net> wrote:

[snip]

Quote:
MY QUESTION: Am I relying on any potentially undefined behaviour
to get what appear to be correct results?
I thought I had things working just fine. Suddenly, I am getting
C*5 errors. I do not always get them, but I can not see what it is
that is causing the problem.

What do you do to track down C*5 errors? The normal debugging
approaches do not work when VFP itself goes south.

[snip]

Sincerely,

Gene Wirchenko

Computerese Irregular Verb Conjugation:
I have preferences.
You have biases.
He/She has prejudices.


Reply With Quote
  #6  
Old   
Gene Wirchenko
 
Posts: n/a

Default Re: VFP 9: Filters Implemented with SQL - 01-06-2008 , 01:30 AM



Gene Wirchenko <genew (AT) ocis (DOT) net> wrote:

[snip]

Quote:
MY QUESTION: Am I relying on any potentially undefined behaviour
to get what appear to be correct results?
I thought I had things working just fine. Suddenly, I am getting
C*5 errors. I do not always get them, but I can not see what it is
that is causing the problem.

What do you do to track down C*5 errors? The normal debugging
approaches do not work when VFP itself goes south.

[snip]

Sincerely,

Gene Wirchenko

Computerese Irregular Verb Conjugation:
I have preferences.
You have biases.
He/She has prejudices.


Reply With Quote
  #7  
Old   
Gene Wirchenko
 
Posts: n/a

Default Re: VFP 9: Filters Implemented with SQL - 01-06-2008 , 01:30 AM



Gene Wirchenko <genew (AT) ocis (DOT) net> wrote:

[snip]

Quote:
MY QUESTION: Am I relying on any potentially undefined behaviour
to get what appear to be correct results?
I thought I had things working just fine. Suddenly, I am getting
C*5 errors. I do not always get them, but I can not see what it is
that is causing the problem.

What do you do to track down C*5 errors? The normal debugging
approaches do not work when VFP itself goes south.

[snip]

Sincerely,

Gene Wirchenko

Computerese Irregular Verb Conjugation:
I have preferences.
You have biases.
He/She has prejudices.


Reply With Quote
  #8  
Old   
Gene Wirchenko
 
Posts: n/a

Default Re: VFP 9: Filters Implemented with SQL - 01-06-2008 , 01:30 AM



Gene Wirchenko <genew (AT) ocis (DOT) net> wrote:

[snip]

Quote:
MY QUESTION: Am I relying on any potentially undefined behaviour
to get what appear to be correct results?
I thought I had things working just fine. Suddenly, I am getting
C*5 errors. I do not always get them, but I can not see what it is
that is causing the problem.

What do you do to track down C*5 errors? The normal debugging
approaches do not work when VFP itself goes south.

[snip]

Sincerely,

Gene Wirchenko

Computerese Irregular Verb Conjugation:
I have preferences.
You have biases.
He/She has prejudices.


Reply With Quote
  #9  
Old   
Gene Wirchenko
 
Posts: n/a

Default Re: VFP 9: Filters Implemented with SQL - 01-06-2008 , 01:30 AM



Gene Wirchenko <genew (AT) ocis (DOT) net> wrote:

[snip]

Quote:
MY QUESTION: Am I relying on any potentially undefined behaviour
to get what appear to be correct results?
I thought I had things working just fine. Suddenly, I am getting
C*5 errors. I do not always get them, but I can not see what it is
that is causing the problem.

What do you do to track down C*5 errors? The normal debugging
approaches do not work when VFP itself goes south.

[snip]

Sincerely,

Gene Wirchenko

Computerese Irregular Verb Conjugation:
I have preferences.
You have biases.
He/She has prejudices.


Reply With Quote
  #10  
Old   
Gene Wirchenko
 
Posts: n/a

Default Re: VFP 9: Filters Implemented with SQL - 01-06-2008 , 01:30 AM



Gene Wirchenko <genew (AT) ocis (DOT) net> wrote:

[snip]

Quote:
MY QUESTION: Am I relying on any potentially undefined behaviour
to get what appear to be correct results?
I thought I had things working just fine. Suddenly, I am getting
C*5 errors. I do not always get them, but I can not see what it is
that is causing the problem.

What do you do to track down C*5 errors? The normal debugging
approaches do not work when VFP itself goes south.

[snip]

Sincerely,

Gene Wirchenko

Computerese Irregular Verb Conjugation:
I have preferences.
You have biases.
He/She has prejudices.


Reply With Quote
Reply




Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off



Powered by vBulletin Version 3.5.3
Copyright ©2000 - 2012, Jelsoft Enterprises Ltd.