Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Error 1494 when Requery()
Message
 
 
À
14/09/2001 17:24:14
Information générale
Forum:
Visual FoxPro
Catégorie:
Base de données, Tables, Vues, Index et syntaxe SQL
Divers
Thread ID:
00556311
Message ID:
00557019
Vues:
16
Hi!

No, not the VAL(). You require to return either the character string (the last function is PADR() to make the result exact the same length), or you require to use something like following:

IIF(C108.haber,VAL("0000000000000000.0000"),C108.monto)+0000000000000000.0000 AS debem,;
IIF(C108.haber,C108.monto,VAL("0000000000000000.0000"))+0000000000000000.0000 AS haberm,;

Of course, of haber or monto fields are currency, you require to convert all values to currency:

IIF(C108.haber,VAL("$0000000000000000.0000"),C108.monto)+$0000000000000000.0000 AS debem,;
IIF(C108.haber,C108.monto,VAL("$0000000000000000.0000"))+$0000000000000000.0000 AS haberm,;

Finally, be sure - you require to set up the field type in the view in the properties dialog box. This way when you open the view with NODATA option or query returns no result, VFP will be sure type of the field is correct and the same as defined in the database. The error message you got is because different queries for view return different types of the values for that field. When difference from what is stored in the database, such error occur.

HTH.



>Thanks a lot Vlad, (You don’t sleep?)
>
>I thought that the Val function would do the trick of getting exact size results.
>
>Regards
>
>Oscar Corte
>
>
>>Hi!
>>
>>When view is built, VFP preview it just by running the query for it. When view returns no result, what field type should get VFP for the value debem and haberm? Also, these fields should have the same length across the entire query result, otherwise you will get such errors. It is good idea to change the expressions for these fields to something like following:
>>
>>PADR(IIF(C108.haber,VAL("0000000000000000.0000"),C108.monto),25) AS debem,;
>>PADR(IIF(C108.haber,C108.monto,VAL("0000000000000000.0000")),25) AS haberm,;
>>
>>And in the view designer open the field properties dialog box, select these expression fields and set their field type to C(25).
>>
>>HTH.
>>
>>
>>>I’ve created a view based on the next SQL statement:
>>>
>>>SELECT C101.no, C101.cuenta,;
>>> IIF(C108.haber,VAL("0000000000000000.0000"),C108.monto) AS debem,;
>>> IIF(C108.haber,C108.monto,VAL("0000000000000000.0000")) AS haberm,;
>>> C108.ic101;
>>> FROM aca!c107 INNER JOIN aca!c108;
>>> INNER JOIN aca!c101 ;
>>> ON C108.ic101 = C101.ic101 ;
>>> ON C107.ic107 = C108.ic107;
>>> WHERE C107.fecha >= {01/07/2001};
>>> AND C107.fecha <= {31/07/2001};
>>> AND C101.no >= "1 ";
>>> AND C101.no <= "1103-014-002 ";
>>> GROUP BY C108.ic101
>>>
>>>It works ok at preview, buy when I open with the nodata argument:
>>>
>>>use Myview nodata
>>>
>>>an then requery(), I get error 1494 “Table definition has changed”.
>>>
>>>The error started to happen when I added the filter conditions for table c101:
>>>C101.no >= "1 ";
>>> AND C101.no <= "1103-014-002 "
>>>
>>>Any hints about what is happening are appreciated.
>>>
>>>Thanks in advance and regards.
>>>
>>>Oscar Corte
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.
Précédent
Répondre
Fil
Voir

Click here to load this message in the networking platform