hi,
I have 15 tables that have NULLS entered in most of the records for 10 different fields in each of those tables. Is there a stored procedure I can make that would go in each of the record for each field and replace those nulls with 0.
I have this stored procedure that does not replaces the nulls with 0 or blanks..
PROCEDURE SetNullInv
USE Inv EXCLUSIVE
FOR i = 1 TO FCOUNT()
fieldname = FIELD(i)
IF TYPE('inv.'+ fieldname) = 'C' then
for j = 1 to 1000
REPLACE ('inv.'+ fieldname)with ' ' FOR ISNULL(('inv.'+ fieldname))
next j
ENDIF
IF TYPE('inv.'+ fieldname) = 'N' then
for j = 1 to 1000
REPLACE ('inv.'+ fieldname)with 0 FOR ISNULL(('inv.'+ fieldname))
next j
ENDIF
next i
ENDPROC
I have 15 tables that have NULLS entered in most of the records for 10 different fields in each of those tables. Is there a stored procedure I can make that would go in each of the record for each field and replace those nulls with 0.
I have this stored procedure that does not replaces the nulls with 0 or blanks..
PROCEDURE SetNullInv
USE Inv EXCLUSIVE
FOR i = 1 TO FCOUNT()
fieldname = FIELD(i)
IF TYPE('inv.'+ fieldname) = 'C' then
for j = 1 to 1000
REPLACE ('inv.'+ fieldname)with ' ' FOR ISNULL(('inv.'+ fieldname))
next j
ENDIF
IF TYPE('inv.'+ fieldname) = 'N' then
for j = 1 to 1000
REPLACE ('inv.'+ fieldname)with 0 FOR ISNULL(('inv.'+ fieldname))
next j
ENDIF
next i
ENDPROC