FiveTech Support Forums

FiveWin / Harbour / xBase community
Board index FiveWin para Harbour/xHarbour FWMariaDB y XBrowse - Consulta Query
Posts: 1279
Joined: Mon Feb 06, 2006 04:28 PM
FWMariaDB y XBrowse - Consulta Query
Posted: Tue Dec 21, 2021 11:09 AM
Code (fw): Select all Collapse
#include "Fivewin.ch"
#include "xbrowse.ch"

function PlanillaMantDiarios( oCn )
聽 聽 聽LOCAL oDlg, oFont1, oFont2, oFont3, oBrw, oRs, wmes, wanio, csql, oGet:={}
聽 聽 聽LOCAL ii
聽 聽 聽wmes := 11
聽 聽 聽wanio:= 2021
聽 聽 聽oGet:=Array(2)
聽 聽 聽
聽 聽 聽cSql := "SELECT * FROM mantenimientos JOIN planilla JOIN maquinas JOIN sectores ON ( mantenimientos.mant_id = planilla.plaMant_id and mantenimientos.mantMaq_id = maquinas.Maq_id and mantenimientos.mantSector_id = sectores.Sector_ID ) WHERE ( planilla.pla_mes = 11 and planilla.pla_anio = 2021 )"
聽 聽 聽oRs := oCn:RowSet( cSql )

聽 聽 聽DEFINE DIALOG oDlg RESOURCE "DLG_PLAMDIARIOS" TITLE "Planilla de Mantenimientos Diarios"
聽 聽 聽
聽 聽 聽 聽 聽 REDEFINE GET oGet[1] VAR wmes id 101 picture "99" of oDlg 
聽 聽 聽 聽 聽 REDEFINE GET oGet[2] VAR wanio id 102 picture "9999" of oDlg

聽 聽 聽 聽 聽 REDEFINE XbROWSE oBrw id 201 of oDlg DATASOURCE oRs 聽 聽 聽 聽 ;
聽 聽 聽 聽 聽 聽 聽 聽COLUMNS "mant_nombre", "pla_mes", "pla_anio", "Sector_Nombre", "D1", "D2", 聽 聽 聽 聽 聽 聽 聽 聽 聽 聽 聽 聽 聽 聽 聽 ;
聽 聽 聽 聽 聽 聽 聽 聽 聽 聽 "D3", 聽"D4", 聽"D5", 聽"D6", 聽"D7", 聽"D8", 聽"D9", 聽"D10", "D11", "D12", 聽 聽 聽 聽 聽 聽 聽 聽 聽 聽 聽 聽 聽 聽 聽 ; 
聽 聽 聽 聽 聽 聽 聽 聽 聽 聽 "D13", "D14", "D15", "D16", "D17", "D18", "D19", "D20", "D21", "D22", 聽 聽 聽 聽 聽 聽 聽 聽 聽 聽 聽 聽 聽 聽 聽 ;
聽 聽 聽 聽 聽 聽 聽 聽 聽 聽 "D23", "D24", "D25", "D26", "D27", "D28", "D29", "D30", "D31" 聽 聽 聽 聽 聽 聽 聽 聽 聽 聽 聽 聽 聽 聽 聽 聽 聽 聽 聽 ;
聽 聽 聽 聽 聽 聽 聽 聽HEADERS "Mantenimiento:", "Mes:", "A帽o:", "Sector:", "1", "2", "3", "4", "5", "6", "7", "8", "9", "10", "11", "12", 聽 聽 ;
聽 聽 聽 聽 聽 聽 聽 聽 聽 聽 "13", "14", "15", "16", "17", "18", "19", "20", "21", "22", "23", "24", "25", "26", "27", "28", "29", "30", "31" 聽 ;
聽 聽 聽 聽 聽 聽 聽 聽SIZES 320, 30, 40, 120, 20, 20, 20, 20, 20, 20, 20, 20, 20, 20, 20, 20, 20, 20, 20, 20, 20, 20, 20, 20, 聽 聽 聽 聽 聽 聽 聽 聽 ;
聽 聽 聽 聽 聽 聽 聽 聽 聽 聽 20, 20, 20, 20, 20, 20, 20, 20, 20, 20, 20 ; 聽 聽 聽 聽 聽 聽 聽 聽 聽 聽 聽 聽 聽 聽 聽 聽 聽 聽 聽 聽 聽 聽 聽 聽 聽 聽 聽 聽 
聽 聽 聽 聽 聽 聽 聽 聽FASTEDIT
聽
聽 聽 聽 聽 聽 WITH OBJECT oBrw
聽 聽 聽 聽 聽 聽 聽 聽:nEditTypes 聽 聽:= EDIT_GET
聽 聽 聽 聽 聽 聽 聽 聽:SetChecks( nil, .t. )
聽 聽 聽 聽 聽 聽 聽 聽:nfreeze := 4
聽 聽 聽 聽 聽 聽 聽 聽:lEdit:=.t.
聽 聽 聽 聽 聽 END WITH
聽 聽 聽 聽 聽 
聽 聽 聽ACTIVATE DIALOG oDlg CENTER 
聽 聽 聽oRs:Close()
RETURN nil



I have this code, it allows me to display the information of a query that includes 4 tables, but only allows me to edit the main table.

I have implemented a solution by storing the query in a temporary table, but I have several cases like this in a development and I would be interested to know if it is possible to edit all the tables at the same time with xbrowse, if it can only be done by means of a temporary table or if there can be a better solution.

Thank you.


Tengo este c贸digo, me permite visualizar la informaci贸n del query que incluye 4 tablas, pero solo me permite editar la tabla principal.

He implementado una soluci贸n poniendo el query en una tabla temporal, pero tengo varios casos como este en un desarrollo y me interesar铆a saber si se puede editar sobre todas las tablas a la vez con xbrowse, si solo puede hacerse mediante una tabla temporal o si puede haber una mejor soluci贸n.

Gracias.
Saludos/Regards,

Jos茅 Murugosa

"Los errores en programaci贸n, siempre est谩n entre la silla, el teclado y la IA!!"
Posts: 1279
Joined: Mon Feb 06, 2006 04:28 PM
Re: FWMariaDB y XBrowse - Consulta Query - Mr. Rao
Posted: Wed Dec 22, 2021 10:13 AM

Alguna sugerencia?

Saludos/Regards,

Jos茅 Murugosa

"Los errores en programaci贸n, siempre est谩n entre la silla, el teclado y la IA!!"
Posts: 1279
Joined: Mon Feb 06, 2006 04:28 PM
Re: FWMariaDB y XBrowse - Consulta Query - Mr. Rao
Posted: Wed Dec 22, 2021 01:31 PM

Seg煤n la documentaci贸n de FWMariaDB de FWH:

Also, columns which are computed or derived from joined tables are also flaged as readonly.
It is obvious that single tables can be edited/modified easily.

Traducci贸n
Adem谩s, las columnas que se calculan o derivan de tablas unidas tambi茅n se marcan como de solo lectura.
Es obvio que las tablas individuales se pueden editar / modificar f谩cilmente.

Esto me queda muy claro.

Por medio de una tabla temporal es una soluci贸n posible, que es la que he implementado por consejo de cmsoft, (muchas gracias por la ayuda)

Solo me preguntaba si habr铆a una mejor manera.

Saludos/Regards,

Jos茅 Murugosa

"Los errores en programaci贸n, siempre est谩n entre la silla, el teclado y la IA!!"

Continue the discussion