Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
SQL-SELECT clause not working properly at runtime
Message
 
 
Information générale
Forum:
Visual FoxPro
Catégorie:
Problèmes
Divers
Thread ID:
00473670
Message ID:
00473769
Vues:
17
>>Hi,
>>
>>I have written a SQL-SELECT clause that I use to extract data to a cursor and COPY it TO a DBF file. When I run it on the VFP environment it retrieves the data as expected, but on runtime it does not. The complete clause is:
>>
>Fausto,
>
>I changed this SQL a little bit. My guess that it's because of length of this SQL. You may try to simplify it, if it's possible. For instance, if field name is unique, you don't have to specify table name.
>
>
>SELECT ;
>MAX(t6.fecierre) AS pivote, t2.numpoliz, t2.codmodal, ;
>t3.codrease, t5.nombre, t5.apellid1, t5.apellid2, t5.tipdocid, t5.numident, t5.fecnacim, ;
>(t2.edactuin + t2.anualida)-1 AS edactuin, t5.sexo, t2.fecinpol AS fecinief, t2.durseg, t2.fecfinef, ;
>IIF(t2.codfpago = '9','PU',PADR(STR(t2.durpri),2)) AS durpri, ;
>t2.codfpago, t2.fecefsit, t2.anualida, t2.moneda, ;
>t2.sitpoliz, IIF (t2.sitpoliz = '10','NO','SI') AS vigreduc, ;
>t2.motsitua, t2.fecanula, t2.fecbaja AS fecconan, ;
>t4.codclien;
>FROM ppolizas  t1, phpoliza t2, pmodalid t3, phpolper t4, pcligrls t5, pprovpol t6 ;
>WHERE (t6.numpoliz = t1.numpoliz and t1.sitpoliz = "00") and ;
>(t6.numpoliz = t2.numpoliz and t6.numsuple = t2.numsuple) and ;
>(t3.codmodal = t2.codmodal and !EMPTY(t3.codrease)) and ;
>(t6.numpoliz = t4.numpoliz and t4.tiporela = 'A') and ;
>t4.codclien = t5.codclien ;
>GROUP BY t2.numpoliz ;
>ORDER BY t2.numpoliz, t2.codmodal, t2.numsuple ;
>INTO CURSOR cur_cartera_vig
>
>Still I don't like this SQL, but at least now it's simpler to follow and modify

It also may be that you have different settings for SET EXACT, SET ANSI, SET DELETED in your development and run-time environment. Check this too.
If it's not broken, fix it until it is.


My Blog
Précédent
Répondre
Fil
Voir

Click here to load this message in the networking platform