Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Unexpected results from EXE
Message
From
19/04/2001 09:47:19
 
 
To
19/04/2001 09:28:16
Fausto Garcia
Independent Developer
Lima, Peru
General information
Forum:
Visual FoxPro
Category:
Databases,Tables, Views, Indexing and SQL syntax
Miscellaneous
Thread ID:
00496973
Message ID:
00497235
Views:
9
This message has been marked as a message which has helped to the initial question of the thread.
Hi!

Some more questions:
- Are data different in different runs (local/remote)?
If different, here are my notes about SQL Statement:

E.tiporela = 'A'
This comparison may return .T. if E.tiporela=='' in some cases. Take a look to SET ANSI and SET EXACT. I always use expressions like E.tiporela == 'A ', whene 'A ' have a number of spaces required to expand string to match the length of the field. THis is also concerned to many other character fields.

If character fields lengths different, comparison is always .F. when SET EXACT ON. This means, for example, that in case M.codmodal and H.codmodal have different field size, they will never match. In VFP all character fields expanded by spaces to the length of the field.

Check your data. Sometimes above things cause developers confused by query results.

- phpoliza table is included into EXE or not?
if yes, possible cause is that included table is used, not a real results table. INTO does nothing in such case because such table is read-only.

- I wondered, did you get any error messages? Do you use any errors trapping in this process? Did you tries to step through these commands and see if there are no errors?

Some other notes:
IIF(H.codfpago = '9','PU',ALLTRIM(STR(H.durpri))) AS durpri - bad use of ALLTRIM. In such case you should use following:
PADR(IIF(H.codfpago = '9','PU',ALLTRIM(STR(H.durpri))),10) AS durpri
where 10 is a size of the result of the character field. If you do not do this, the size of the character field will be a size of the first string evaluuated by expression. When it is 'PU', all other fields will be truncated to the 2 characters. Review your query for other such expressions.


>Hi Vlad,
>
>Thanks for your attention. The problem is focused on a method which performs the following clause:
>
>
>SELECT MAX(V.fecierre) AS pivote, ;
>	H.numpoliz, H.codmodal,M.codrease, C.nombre, ;
>	C.apellid1, C.apellid2,C.tipdocid, C.numident, ;
>	C.fecnacim,(H.edactuin + H.anualida)-1 AS edactuin, ;
>	C.sexo,H.fecinpol AS fecinief,H.durseg, ;
>	H.fecfinef, ;
>	IIF(H.codfpago = '9','PU',ALLTRIM(STR(H.durpri))) AS durpri, ;
>	H.codfpago,H.fecefsit,H.anualida,H.moneda, ;
>	H.sitpoliz, ;
>	IIF (H.sitpoliz = '10','NO','SI') AS vigreduc, ;
>	H.motsitua,H.fecanula,H.fecbaja AS fecconan, ;
>	E.codclien ;
>FROM ppolizas P, phpoliza H, pmodalid M, phpolper E, pcligrls C, pprovpol V ;
>WHERE P.numpoliz = V.numpoliz and ;
>	(P.sitpoliz = "00") and ;
> 	(H.numpoliz = V.numpoliz) and ;
>	(H.numsuple = V.numsuple) and;
>	(M.codmodal = H.codmodal) and (!EMPTY(M.codrease)) and ;
>	((E.numpoliz = V.numpoliz) and (E.tiporela = 'A')) and;
>	(E.codclien = C.codclien);
>GROUP BY H.numpoliz ;
>ORDER BY H.numpoliz, H.codmodal, H.numsuple DESC ;
>INTO CURSOR cur_cartera_vig
>
>
>The difference is that I get incorrect values for the H.fecefsit and H.anualida cursor fields. Both values (correct and wrong) are saved on the phpoliza table, so it's like my original WHERE clause was distorted in some way.
>
>
>>Hi!
>>
>>What is that difference? Can you describe more how results are different?
>>
>>>Hi,
>>>
>>>I have an application (EXE file) written in VFP which is supposed to extract data from our database (using SQL-SELECT clauses) and put it in a set of DBFs (which are re-created by the app each and every time it runs). The fact is that when I run it over a local database in stand-alone mode it gets the expected results, but when I run it against the production database the app produces a different result.
>>>Has anyone had the same problem? I do not understand why is this happening, maybe I need to open the database in exclusive mode?
>>>
>>>TIA,
Vlad Grynchyshyn, Project Manager, MCP
vgryn@yahoo.com
ICQ #10709245
The professional level of programmer could be determined by level of stupidity of his/her bugs

It is not appropriate to say that question is "foolish". There could be only foolish answers. Everybody passed period of time when knows nothing about something.
Previous
Next
Reply
Map
View

Click here to load this message in the networking platform