sincronizacion de tablas con FWHMariadb SOLUCIONADO

sincronizacion de tablas con FWHMariadb SOLUCIONADO

Postby jose_murugosa » Tue Oct 19, 2021 1:20 pm

Buenos días,
Estoy experimentado y haciendo mis primeras armas con mysql con las clases nativas de fivewin.
No he podido sacar este listado que debería tener un dato procedente de una tabla vinculada a la principal, y no me doy cuenta que es lo que estaría mal.

La tabla principal es mantenimientos, y la vinculada es maquinas estan vinculadas por el campo mantmaq_id de la tabla mantenimientos y maq_id (primary key) de maquinas.

Este es el codigo:
Code: Select all  Expand view

FUNCTION ListMantAg(oCn)
    LOCAL oFont1, oFont2, oFont3, oReport, oMant
    DEFINE FONT oFont1 NAME "Arial" SIZE 0,-10
    DEFINE FONT oFont2 NAME "Arial" SIZE 0,-10 BOLD
    DEFINE FONT oFont3 NAME "Arial" SIZE 0,-20 BOLD
         
         oMant :=oCn:RowSet( "mantenimientos" )
         oMant:SetFilter(  "mant_Tipo <> ?", { 5 } )
         oMant:AddChild( "SELECT * FROM maquinas WHERE maqid = mantenimientos.mantmaq_id" )
         oMant:GoTop()
         oMant:SyncChild()
         PRINTER FROM USER
         
    REPORT oReport;
        TITLE  "**Listado de Mantenimientos Agendados**", "" ;
        HEADER "SIRSIL S.A." + " - Fecha: " + transform(date(),"@d") + " Hora: " + time() RIGHT  ;
        FOOTER "Pagina: " + str(oReport:nPage,3) CENTERED ;
        FONT oFont1, oFont2, oFont3 ;
        CAPTION "Listado de Mantenimientos" ;
        PREVIEW
                  //no sacar
                  COLUMN TITLE "#Mantenim.:" ;
            DATA  oMant:Mant_id ;
            PICTURE  "99" ;
            SIZE 3
                  COLUMN TITLE "Detalle:" ;
            DATA  omant:mant_nombre ;
            PICTURE  "!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!" ;
            SIZE 38
        COLUMN TITLE "Tipo:";
            DATA  TipoMant(oMant:Mant_Tipo) ;
            PICTURE "XXXXXXXXXXX" ;
            SIZE 10
        COLUMN TITLE "Plazo:" ;
            DATA PlazoMant(oMant:Mant_Plazo) ;
            PICTURE "XXXXXXXXXXX" ;
            SIZE 10
                  COLUMN TITLE "Días:" ;
            DATA  oMant:Mant_Dias ;
            PICTURE "99999" ;
            SIZE 6                                    
                  COLUMN TITLE "Máquina:" ;
                           DATA  oMant:MantMaq_id ;
            PICTURE "9999" ;
            SIZE 7
                   COLUMN TITLE "Máquina:" ;
                           DATA  maquinas:maq_Desc  ;
            PICTURE "!!!!!!!!!!!!!!!!!!!!!!!!!" ;
            SIZE 23
                   //no sacar
    END REPORT
 


Y este es el error:

Code: Select all  Expand view

Application
===========
   Time from start: 0 hours 10 mins 41 secs
   Error occurred at: 19/10/2021, 10:09:43
   Error description: Error BASE/1004  No existe el m‚todo: REQUERY
   Args:
     [   1] = U  
     [   2] = A   {{"mantmaq_id",82}} length: 1

Stack Calls
===========
   Called from:  => REQUERY( 0 )
   Called from: .\source\internal\FWMARIA.PRG => FWMARIAROWSET:SYNCCHILD( 5561 )
   Called from: c:\maquinas\source\Listados.prg => LISTMANTAG( 83 )
   Called from: c:\maquinas\source\Maquinas.prg => (b)HAGOMENU( 134 )
   Called from: .\source\classes\MENU.PRG => TMENU:COMMAND( 1563 )
   Called from: .\source\classes\WINDOW.PRG => TWINDOW:COMMAND( 1141 )
   Called from:  => TWINDOW:HANDLEEVENT( 0 )
   Called from: .\source\classes\WINDOW.PRG => _FWH( 3560 )
   Called from:  => WINRUN( 0 )
   Called from: .\source\classes\WINDOW.PRG => TWINDOW:ACTIVATE( 1097 )
   Called from: c:\maquinas\source\Maquinas.prg => MAIN( 76 )
 


No me doy cuenta cual es el error que cometo. Agradezco toda ayuda.
Saludos/Regards,
José Murugosa
FWH + Harbour + Bcc7. Una seda!
User avatar
jose_murugosa
 
Posts: 1145
Joined: Mon Feb 06, 2006 4:28 pm
Location: Uruguay

Re: sincronizacion de tablas con FWHMariadb SOLUCIONADO

Postby jose_murugosa » Wed Oct 20, 2021 7:14 pm

El problema pasaba el uso de la tabla hija, utilizando oMant:oChild:campo, funcionó perfecto.
Saludos/Regards,
José Murugosa
FWH + Harbour + Bcc7. Una seda!
User avatar
jose_murugosa
 
Posts: 1145
Joined: Mon Feb 06, 2006 4:28 pm
Location: Uruguay


Return to FiveWin para Harbour/xHarbour

Who is online

Users browsing this forum: richard-service and 37 guests