*!* utility to retreive all nullable fields *!* 02.27.06 bxk LOCAL lcTable, lnRow, lnElem, laFields[1], lnFields, lcNumericType lcNumericType = 'NIYR' CLOS DATA ALL USE YourDatabase.DBC NOUPDATE USE YourDatabase.DBC IN 0 AGAIN ALIAS child NOUPDATE SET DELETED ON SELECT ; .F. AS lUpDatable, ; .F. AS lAllowNull, ; SPACE(32) AS cDefault, ; YourDatabase.objecttype, ; PADR(TRIM(YourDatabase.objectname) + "." + child.objectname, 64) AS cField, ; YourDatabase.objectname AS ctable, ; child.objectname ; FROM child ; INNER JOIN YourDatabase ; ON child.parentid = YourDatabase.objectid ; WHERE child.objecttype = 'Field' ; ORDER BY 4, 5 ; INTO TABLE AllFields CLOS DATA ALL OPEN DATABASE YourDatabase SET DELETED OFF USE AllFields IN 0 SELECT AllFields SCAN IF objecttype = 'View' lcTable = TRIM(ctable) IF 'NULL' $ DBGETPROP(lcTable + '.' + TRIM(objectname), 'FIELD', 'DefaultValue') REPLACE lUpDatable WITH DBGETPROP(lcTable, 'VIEW', 'SendUpdates') REPLACE lAllowNull WITH DBGETPROP(lcTable, 'VIEW', '') REPLACE cDefault WITH '.NULL.' ELSE DELETE NEXT 1 ENDIF ENDIF IF objecttype = 'Table' USE(TRIM(cTable)) IN 0 ALIAS Current lnFields = AFIELDS(laFields, 'Current') IF lnFields > 0 lnElem = ASCAN(laFields, TRIM(UPPER(objectname))) IF lnElem > 0 lnRow = ASUBSCRIPT(laFields, lnElem, 1) && get the row IF laFields[lnRow, 2] $ lcNumericType REPLACE lAllowNull WITH laFields[lnRow, 5] IN AllFields ELSE DELETE NEXT 1 ENDIF ENDIF ENDIF USE IN SELECT('Current') ENDIF ENDSCAN SELECT AllFields BLANK FIELD lupdatable FOR ! lUpdatable BLANK FIELD lallownull FOR ! lAllowNull SELECT * ; FROM AllFields ; WHERE lAllowNull ; OR cDefault = '.NULL.' ; INTO TABLE NullFields CLOS DATA ALLHTH