DBF a DAT -URGENTE POR FAVOR
&& En el siguiente ejercicio se crea un cursor para simular un archivo DBF y se le
&& ingresan datos, luego se pasan los datos a un archivo llamado Datos.txt, por ultimo
&& se cierra el cursor creado
***// Crear un cursor y agregar datos
CREATE CURSOR Cur (cod c(4), nom c(30), tel c(10), nivel n(2,0)) && Se crea un cursor simulando un archivo DBF
INSERT INTO Cur (cod, nom, tel, nivel) VALUES ("0001", "Sergio Jimenez", "3014586450", 1) && Agregando un registro
INSERT INTO Cur (cod, nom, tel, nivel) VALUES ("0002", "Sandra Martinez", "3104598450", 8) && Agregando un registro
INSERT INTO Cur (cod, nom, tel, nivel) VALUES ("0003", "Dagoberto Garcia", "6208953457", 12) && Agregando un registro
***\\ Crear un cursor y agregar datos
***// Se pasan los datos al archivo Datos.txt
SELECT Cur && Selecciona el archivo DBF del cual se tomarán los datos
DISPLAY FIELDS Cur.cod, Cur.nom, Cur.tel, PADL(ALLTRIM(STR(Cur.nivel)),2,"0") ALL NOCONSOLE TO Datos.txt
***\\ Se pasan los datos al archivo Datos.txt
***// Se cierra el cursor creado
USE IN cur && Cierra el cursor creado
***\\ Se cierra el cursor creado