consulta mariadb a un array

consulta mariadb a un array

Postby goosfancito » Mon Nov 13, 2023 11:03 am

Hola.
He buscado en el foro pero no encunetro los apuntes de Mr Mao,
quiero luego de obtener la consulta pasar los valores a un array pero no recuerdo como hacerlo.
Code: Select all  Expand view
METHOD cargarPaises() CLASS TCliente
   LOCAL PAISES

   TEXT into PAISES
   Select
   a.nombre AS c0,
   FROM tbpaises a
   ORDER BY a.nombre
   ENDTEXT

   oQry := ::oCnx:rowset( PAISES)


como hago para pasar ese oqry a un array?
gracias.
FWH 21.02
Harbour 3.2.0dev (r2104281802)
Copyright (c) 1999-2021, https://harbour.github.io/
User avatar
goosfancito
 
Posts: 1954
Joined: Fri Oct 07, 2005 7:08 pm

Re: consulta mariadb a un array

Postby vilian » Mon Nov 13, 2023 12:18 pm

Good Morning,

Just try

aRet := ::oCnx:Execute( PAISES)
Sds,
Vilian F. Arraes
vilian@vfatec.com.br
Belém-Pa-Brazil
User avatar
vilian
 
Posts: 976
Joined: Wed Nov 09, 2005 2:17 am
Location: Brazil

Re: consulta mariadb a un array

Postby Willi Quintana » Mon Nov 13, 2023 1:43 pm

MI estimado.
}
Code: Select all  Expand view

cObj := "SELECT * FROM productos"
oObj := oCn:Execute( cObj )
if oCn:nError != 0    //     //
   Msg_Error(ALLTRIM(oCn:cError), "Error:" + ALLTRIM(STR(oCn:nError,8,0)), , ,15)  //     oCn:ShowError()
  oObj := {}
EndIf
Return(oObj)
 
User avatar
Willi Quintana
 
Posts: 1019
Joined: Sun Oct 09, 2005 10:41 pm
Location: Cusco - Perú

Re: consulta mariadb a un array

Postby goosfancito » Mon Nov 13, 2023 3:20 pm

gracias
FWH 21.02
Harbour 3.2.0dev (r2104281802)
Copyright (c) 1999-2021, https://harbour.github.io/
User avatar
goosfancito
 
Posts: 1954
Joined: Fri Oct 07, 2005 7:08 pm

Re: consulta mariadb a un array

Postby sysctrl2 » Mon Nov 13, 2023 7:38 pm

libmariadb
Code: Select all  Expand view
::oDetalle := ::oCon:RowSet( cSql )
      aItems         := ::oDetalle:GetRows()
 
Cesar Cortes Cruz
SysCtrl Software
Mexico

' Sin +- FWH es mejor "
User avatar
sysctrl2
 
Posts: 1020
Joined: Mon Feb 05, 2007 7:15 pm

Re: consulta mariadb a un array

Postby goosfancito » Thu Nov 16, 2023 3:52 am

Graciasa tods.
Willy te mande email
FWH 21.02
Harbour 3.2.0dev (r2104281802)
Copyright (c) 1999-2021, https://harbour.github.io/
User avatar
goosfancito
 
Posts: 1954
Joined: Fri Oct 07, 2005 7:08 pm


Return to FiveWin para Harbour/xHarbour

Who is online

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