oRS:QueryResult() AND Fw_arrayToDbf

oRS:QueryResult() AND Fw_arrayToDbf

Postby vilian » Fri Feb 23, 2018 6: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
User avatar
vilian
 
Posts: 913
Joined: Wed Nov 09, 2005 2:17 am
Location: Brazil

Re: oRS:QueryResult() AND Fw_arrayToDbf

Postby nageswaragunupudi » Fri Feb 23, 2018 11:11 pm

Code: Select all  Expand view
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
User avatar
nageswaragunupudi
 
Posts: 10208
Joined: Sun Nov 19, 2006 5:22 am
Location: India

Re: oRS:QueryResult() AND Fw_arrayToDbf

Postby vilian » Sat Feb 24, 2018 1:15 pm

Thank you ;)
Sds,
Vilian F. Arraes
vilian@vfatec.com.br
Belém-Pa-Brazil
User avatar
vilian
 
Posts: 913
Joined: Wed Nov 09, 2005 2:17 am
Location: Brazil


Return to FiveWin for Harbour/xHarbour

Who is online

Users browsing this forum: No registered users and 16 guests