Hi Guys,
I have a rowset oRs that have a lot of rows.
I wanted to copy only one row/record of oRs to a new rowset(oRL). Is It possible ?
//RsToHash( oRs, [nRows], [nStart], [aFields] )
hPrueba := RsToHash( oRsFtr, 1, 1 )
xbrowse( hPrueba )
RsGetRows( oRs, [nRows], [nStart], [aFields] )
oRow := oRs:Fields
aRows := oRs:GetRows( 1, oRs:KeyNo )
{ { col1value, col2value, ... colNvalue } }
oData := TArrayData():New( aRows, oRs:aStructure )
nageswaragunupudi wrote:
- Code: Select all Expand view RUN
aRows := oRs:GetRows( 1, oRs:KeyNo )
This gives a two-dimensional array with a single row
- Code: Select all Expand view RUN
{ { col1value, col2value, ... colNvalue } }
If you want to insert the data into another existing RowSet with identical structure, you can do it using oRs2:AddNew( aFields, aRows[ 1 ] ) }
But you can not create a new rowset in memory with this data.
A RowSet can be created ONLY by reading data from the MySql database via an sql query.
If you want to create an object, which works similary, holding this data, you can create TArrayData object
- Code: Select all Expand view RUN
oData := TArrayData():New( aRows, oRs:aStructure )
aRows := oRs:GetRows( )
aStru := aclone( oRs:aStructure )
aeval( aStru, { | aAr , n | iif( aAr[2]=='+' , aAr[2]:='N',nil) } )
oData := TArrayData():New( aRows, aStru )
Return to FiveWin for Harbour/xHarbour
Users browsing this forum: No registered users and 50 guests