local fso, ofile
fso = createobject("Scripting.FileSystemObject")
ofile = fso.createtextefile("c:prueba.csv")
=sqlexec(hconex,"exec sp_devregs","vcursor")
select alltrim(campo1) + "|" + ;
alltrim(campo2) + "|" + ;
.
.
.
alltrim(campon) as linea;
from vcursor ;
into vcursor
select vcursor
scan
ofile.writeline(vcursor.linea)
endscan
ofile.close