FWH MySQL/MariaDB Rowset / cQuery

Post Reply
cjcardoza
Posts: 19
Joined: Thu Jul 13, 2006 12:20 am
Location: Lima - Peru

FWH MySQL/MariaDB Rowset / cQuery

Post 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
User avatar
nageswaragunupudi
Posts: 8017
Joined: Sun Nov 19, 2006 5:22 am
Location: India
Contact:

Re: FWH MySQL/MariaDB Rowset / cQuery

Post by nageswaragunupudi »

At present we can not change the column in FWMariaDb
Regards

G. N. Rao.
Hyderabad, India
cjcardoza
Posts: 19
Joined: Thu Jul 13, 2006 12:20 am
Location: Lima - Peru

Re: FWH MySQL/MariaDB Rowset / cQuery

Post by cjcardoza »

Gracias por la pronta respuesta, ya estoy modificando mi consulta.
User avatar
nageswaragunupudi
Posts: 8017
Joined: Sun Nov 19, 2006 5:22 am
Location: India
Contact:

Re: FWH MySQL/MariaDB Rowset / cQuery

Post 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
Regards

G. N. Rao.
Hyderabad, India
cjcardoza
Posts: 19
Joined: Thu Jul 13, 2006 12:20 am
Location: Lima - Peru

Re: FWH MySQL/MariaDB Rowset / cQuery / SOLUCIONADO

Post by cjcardoza »

Se agradece Mr. Rao
Recien me cambio de version
Post Reply