>Cetin/Sergey, When my new joined table is created based on a main table 1 and a second table 2 (that may have either 1 or no records in it related to table 1), the Select function adds NULLs to the new file when the table 2 records are missing. Ideally, I would like to have empty fields of the same type in file 2. I suspect this is rather basic stuff! Denis
Denis,
IMHO just 'set nulldisplay' would be sufficient :
select ... into cursor crsMyCursor
set nulldisplay to ''
brow
If no and provided you really want blanks instead of nulls then blank the right table fields for null ones :
select * from customer ;
left join orders on customer.cust_id = orders.cust_id ;
into cursor myCursor nofilter
use dbf('myCursor') in 0 again alias 'myCursorRW'
use in 'myCursor'
select 'myCursorRW'
lcFields = ''
for ix=fcount('customer')+1 to fcount()
lcFields = lcFields + iif(empty(lcFields),'',',')+field(ix)
endfor
blank fields &lcFields for isnull(eval(field(fcount('customer')+1)))
brows
PS: Being null might be realted for really right table had a null, better use FKId :
select *, orders.cust_id as FKID ...
..
blank fields &lcFields for isnull(FKID)
Cetin