FiveTech Support Forums

FiveWin / Harbour / xBase community
Board index FiveWin for Harbour/xHarbour oRS:QueryResult() AND Fw_arrayToDbf
Posts: 1067
Joined: Wed Nov 09, 2005 02:17 AM
oRS:QueryResult() AND Fw_arrayToDbf
Posted: Fri Feb 23, 2018 06:53 PM

I'm using oRS:QueryResult() to load data in an array, that after I want to save in a DBF file. Something like this:

         aValues := oBD:QueryResult( "SELECT * from clients" ) 
         aux->(  FW_ArrayToDBF( aValues )  )

If there is only one record in the table clients, this code does not work.

Sds,
Vilian F. Arraes
vilian@vfatec.com.br
Belém-Pa-Brazil
Posts: 10733
Joined: Sun Nov 19, 2006 05:22 AM
Re: oRS:QueryResult() AND Fw_arrayToDbf
Posted: Fri Feb 23, 2018 11:11 PM
Code (fw): Select all Collapse
aValues := oBD:Execute( "SELECT * from clients" ) 
aux->( FW_ArrayToDBF( aValues ) )


Use QueryResult for results containing one or two items
like:
SELECT SUM(AMT) FROM table WHERE..
SELECT AVG(AGE),SUM(SALARY) FROM tabe ..
etc
For reading several rows, use Execute()
Regards



G. N. Rao.

Hyderabad, India
Posts: 1067
Joined: Wed Nov 09, 2005 02:17 AM
Re: oRS:QueryResult() AND Fw_arrayToDbf
Posted: Sat Feb 24, 2018 01:15 PM

Thank you ;)

Sds,
Vilian F. Arraes
vilian@vfatec.com.br
Belém-Pa-Brazil

Continue the discussion