Page 1 of 1

FWH MySQL/MariaDB Rowset / cQuery

Posted: Sat Apr 07, 2018 9:56 am
by cjcardoza
Estimados, no logro encontrar cQuery que usan TMysql y TDolphin de manera similar en Fwmaria, para poder consultar el query que estoy enviando o para enviar uno nuevo, si bien el Requery() es su equivalente pero funciona bajo parametros del Where, Order by pero no dentro de las columnas del Select por ejemplo:
EN TMYSQL
cPre:=IF(EMPTY(::vGet:cCodPre),"A","B")+".precio"
cUnd:=IF(EMPTY(::vGet:cCodPre),"A","B")+".undmed"
::cSql:="SELECT A.codigo,A.descripc,IF(A.moneda='S','S/','US$') AS nommoneda,"+cPre+" AS precvta,"+cUnd+",IF("+cUnd+"='','',E.nombre) AS desundmed,"+;
"A.undpre,IF(A.undpre='','',F.nombre) AS desundpre,IF(A.inafecto=0,IF(A.masigv=1,'MAS IGV ','INCL.IGV '),IF(A.inafecto=1,'EXONERADO ','INAFECTO ')) AS nomigv,"+;
"A.tipexis,C.nombre AS nomtipexis,A.tipprod,D.nombre AS nomtipprod,A.anulado "+;
"FROM maeartic AS A LEFT JOIN maelispre AS B ON B.codlispre='"+::vGet:cCodPre+"' AND B.codart=A.codigo "+;
"LEFT JOIN maetabla AS C ON C.codigo=CONCAT('01',A.tipexis) LEFT JOIN maetabla AS D ON D.codigo=CONCAT('02',A.tipprod) "+;
"LEFT JOIN maetabla AS E ON E.codigo=CONCAT('06',"+cUnd+") LEFT JOIN maetabla AS F ON F.codigo=CONCAT('05',A.undpre) "
:oSql:cQuery:=::cSql
::oSql:REFRESH()

Obteniendo mi consulta si inconveniente

en FWmaria lo hago de la siguiente manera y no logro pasar los parametros a las columnas de la consulta, solamente al where y order by,
::cSql:="SELECT A.codigo,A.descripc,IF(A.moneda='S','S/','US$') AS nommoneda,? AS precvta, ? ,IF( ? ='','',E.nombre) AS desundmed,"+;
"A.undpre,IF(A.undpre='','',F.nombre) AS desundpre,IF(A.inafecto=0,IF(A.masigv=1,'MAS IGV ','INCL.IGV '),IF(A.inafecto=1,'EXONERADO ','INAFECTO ')) AS nomigv,"+;
"A.tipexis,C.nombre AS nomtipexis,A.tipprod,D.nombre AS nomtipprod,A.anulado "+;
"FROM maeartic AS A LEFT JOIN maelispre AS B ON B.codlispre= ? AND B.codart=A.codigo "+;
"LEFT JOIN maetabla AS C ON C.codigo=CONCAT('01',A.tipexis) LEFT JOIN maetabla AS D ON D.codigo=CONCAT('02',A.tipprod) "+;
"LEFT JOIN maetabla AS E ON E.codigo=CONCAT('06', ? ) LEFT JOIN maetabla AS F ON F.codigo=CONCAT('05',A.undpre) "

::oSql:=MEMVAR->oConex:RowSet(::cSql+" ? ? ",{ "A.precio","A.undmed","A.undmed","''","A.undmed","WHERE A.codigo IS NOT NULL","ORDER BY A.codigo"})

::oSql:REQUERY( {"B.precio","B.undmed","B.undmed","'0001'","B.undmed","WHERE A.codigo IS NOT NULL","ORDER BY A.codigo"} )

El resultado se muestra con las columnas precvta y desundmed nulos

Por favor espero sus comentarios

FW1705 + BCC7 + MYSQL

Re: FWH MySQL/MariaDB Rowset / cQuery

Posted: Sat Apr 07, 2018 3:21 pm
by nageswaragunupudi
At present we can not change the column in FWMariaDb

Re: FWH MySQL/MariaDB Rowset / cQuery

Posted: Sat Apr 07, 2018 11:32 pm
by cjcardoza
Gracias por la pronta respuesta, ya estoy modificando mi consulta.

Re: FWH MySQL/MariaDB Rowset / cQuery

Posted: Sat Jul 21, 2018 4:04 pm
by nageswaragunupudi
FWH 18.03 released on 24th April 2018 provides for Requery() with a totally different Query.

http://forums.fivetechsupport.com/viewt ... 90#p213490

Re: FWH MySQL/MariaDB Rowset / cQuery / SOLUCIONADO

Posted: Sat Jun 20, 2020 11:55 pm
by cjcardoza
Se agradece Mr. Rao
Recien me cambio de version