FWH MySQL/MariaDB Rowset / cQuery

FWH MySQL/MariaDB Rowset / cQuery

Postby cjcardoza » Sat Apr 07, 2018 9:56 am

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
cjcardoza
 
Posts: 37
Joined: Thu Jul 13, 2006 12:20 am
Location: Lima - Peru

Re: FWH MySQL/MariaDB Rowset / cQuery

Postby nageswaragunupudi » Sat Apr 07, 2018 3:21 pm

At present we can not change the column in FWMariaDb
Regards

G. N. Rao.
Hyderabad, India
User avatar
nageswaragunupudi
 
Posts: 10641
Joined: Sun Nov 19, 2006 5:22 am
Location: India

Re: FWH MySQL/MariaDB Rowset / cQuery

Postby cjcardoza » Sat Apr 07, 2018 11:32 pm

Gracias por la pronta respuesta, ya estoy modificando mi consulta.
cjcardoza
 
Posts: 37
Joined: Thu Jul 13, 2006 12:20 am
Location: Lima - Peru

Re: FWH MySQL/MariaDB Rowset / cQuery

Postby nageswaragunupudi » Sat Jul 21, 2018 4:04 pm

FWH 18.03 released on 24th April 2018 provides for Requery() with a totally different Query.

viewtopic.php?f=3&t=32737&p=213490#p213490
Regards

G. N. Rao.
Hyderabad, India
User avatar
nageswaragunupudi
 
Posts: 10641
Joined: Sun Nov 19, 2006 5:22 am
Location: India

Re: FWH MySQL/MariaDB Rowset / cQuery / SOLUCIONADO

Postby cjcardoza » Sat Jun 20, 2020 11:55 pm

Se agradece Mr. Rao
Recien me cambio de version
cjcardoza
 
Posts: 37
Joined: Thu Jul 13, 2006 12:20 am
Location: Lima - Peru


Return to FiveWin para Harbour/xHarbour

Who is online

Users browsing this forum: Google [Bot] and 82 guests