Set relation to
Buenos días:
Gracias por la atención, estoy tratando de generar un archivo en formato XML tipo anidado, partiendo de las tablas dbf (ver archivo adjunto) para transmitir información de un área a otra, según leo en la web, tengo que relacionar las tablas y luego aplicar XMLADAPTOR, he desarrollado la siguiente rutina en PRG, la cual me funciona ok:
Set talk off
Set safe off
Close data
Use articulo
index on artcod to articulo
Use clientes
index on cliente to clientes
Use factura
index on factura to factura
Use detalle
index on factura to detalle
index on artcod to detalle2
close data
se le 0
use articulo inde articulo
se le 0
use detalle index detalle,detalle2
SELECT 0
use clientes index clientes
se le detalle
set orde to 2
SET RELATION TO ARTCOD INTO ARTICULO
set orde to 1
BROWSE FIELDS FACTURA,ARTCOD,ARTICULO.NOM_ART,CANTIDAD
sele 0
use factura
sele factura
SET RELATION TO factura INTO detalle
SET SKIP TO DETALLE
SET RELATION TO CLIENTE INTO CLIENTES ADDI
brow fields FACTURA.factura,FACTURA.cliente,FACTURA.total,detalle.artcod,ARTICULO.NOM_ART,detalle.cantidad,CLIENTES.NOMBRE
set relation to
close data
Pero pregunto a ver si me ayudan puedo obtener lo mismo aplicando select -sql., si así fuera, me podrain ayudar con el código.
Gracias.
jrcoronado
Trabajo con VFP9
Gracias por la atención, estoy tratando de generar un archivo en formato XML tipo anidado, partiendo de las tablas dbf (ver archivo adjunto) para transmitir información de un área a otra, según leo en la web, tengo que relacionar las tablas y luego aplicar XMLADAPTOR, he desarrollado la siguiente rutina en PRG, la cual me funciona ok:
Set talk off
Set safe off
Close data
Use articulo
index on artcod to articulo
Use clientes
index on cliente to clientes
Use factura
index on factura to factura
Use detalle
index on factura to detalle
index on artcod to detalle2
close data
se le 0
use articulo inde articulo
se le 0
use detalle index detalle,detalle2
SELECT 0
use clientes index clientes
se le detalle
set orde to 2
SET RELATION TO ARTCOD INTO ARTICULO
set orde to 1
BROWSE FIELDS FACTURA,ARTCOD,ARTICULO.NOM_ART,CANTIDAD
sele 0
use factura
sele factura
SET RELATION TO factura INTO detalle
SET SKIP TO DETALLE
SET RELATION TO CLIENTE INTO CLIENTES ADDI
brow fields FACTURA.factura,FACTURA.cliente,FACTURA.total,detalle.artcod,ARTICULO.NOM_ART,detalle.cantidad,CLIENTES.NOMBRE
set relation to
close data
Pero pregunto a ver si me ayudan puedo obtener lo mismo aplicando select -sql., si así fuera, me podrain ayudar con el código.
Gracias.
jrcoronado
Trabajo con VFP9
1 respuesta
Respuesta de Alonso Jarrín Solís
1