Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Not Accepting .NULL.
Message
De
25/01/2001 07:51:50
 
 
À
25/01/2001 07:15:30
Information générale
Forum:
Visual FoxPro
Catégorie:
Autre
Divers
Thread ID:
00468365
Message ID:
00468374
Vues:
37
Jeff,
I don't see where the actual replace takes place. Try something like this:

FOR i = 1 TO FCOUNT()
REPLACE ALL (FIELD(i)) WITH NVL(EVAL(FIELD(i)), GetEmptyValue(TYPE(FIELD(i))) )
ENDFOR

FUNCTION GetEmptyValue(tcType)
DO CASE
CASE INLIST(tcType, "C","M")
luRetVal = SPACE(0)
etc.
ENDCASE
RETURN luRetVal

Note that there are many more TYPEs than the ones you check in your code.
Hope this helps.


>>I build an cursor from a sql database and I would like to append it to a 6.0 table to report from. I do not want .NULL. to appear in my table. How can I go about checking the resulting cursor to convert any field types that have null to their respective empty, blank {//} field types. Here is what I have so far

sele yada from sql table into table tone1

sele tone1
FOR gncount = 1 to Fcount() && get how many fields exist
VAR1 = Type(field(fncount))
DO CASE
CASE VAR1 = "N"
var2 = 0
CASE VAR1 = "T"
var2 = {//}
CASE VAR1 = "L"
var2 = .f.
CASE VAR1 = "C"
var2 = " "
ENDCASE

IIF(ISNULL(FIELD(GNCOUNT)),VAR2,FIELD(GNCOUNT))
ENDFOR

But when I try to appen tone1 to my 6.0 table, it tells me that one of the fields do not accept null values...apparently the code above doesn't work properly....what am i missing?
Thanks in Advance.<<
Daniel
Précédent
Répondre
Fil
Voir

Click here to load this message in the networking platform