Page 1 of 1

MariaDB BlankRow() returns with additional ... (SOLVED)

Posted: Fri Jun 08, 2018 5:48 am
by fraxzi
Hi All,

When calling oRs:oChild:BlankRow() then lenght of array doesn't match with fields of oRs:AddChild( 'table' ).

say: The table has 11 columns, then, calling oRs:oChild:BlankRow() it returns 12 elements..

Re: MariaDB BlankRow() returns with additional element/field

Posted: Fri Jun 08, 2018 6:16 am
by nageswaragunupudi
1) The extra element is serial number and is internally used.
2) Actually, method BlankRow is internally used and not to be directly used in the application program. I agree we used it in mariainv.prg sample. We will revise it.

For appending a row, please do one of the two:

1.
oRs:Append()

< fill field data >
oRs:Save()

2.
oRec := oRs:Record( .t. ) // .t. for new recor
<fill field data or edit field data>
oRec:Save()

Please do not use any other method.

Re: MariaDB BlankRow() returns with additional element/field

Posted: Fri Jun 08, 2018 7:03 am
by fraxzi
Hi Rao,

Actually, I am fallowing the sample "MariaInv.Prg" .. I require blank row from a oRs:oChild to an array to be used in xbrowse... very much similar to the sample provided.

Re: MariaDB BlankRow() returns with additional element/field

Posted: Fri Jun 08, 2018 7:05 am
by nageswaragunupudi
Use autoappend feature
Or, explain your requirement, we will provide sample.

Re: MariaDB BlankRow() returns with additional element/field

Posted: Sat Jun 09, 2018 12:35 am
by fraxzi
nageswaragunupudi wrote:Use autoappend feature
Or, explain your requirement, we will provide sample.



Hi Mr. Rao,

I added MariaDB parent-child based on "mariainv,prg" sample .. I reconstruct from array to oRs:oChild:lAutoAppend but when parent oRs are :requery with oRs:SyncChild() and refresh the xBrowse oRs:oChild, the display not refreshed().

Re: MariaDB BlankRow() returns with additional element/field

Posted: Sat Jun 09, 2018 12:39 am
by fraxzi
Mr. Rao,

I got it!

oRs:ReSync()
oRs:SyncChild()

refreshes the oRs:oChild...

:P

Re: MariaDB BlankRow() returns with additional element/field

Posted: Sat Jun 09, 2018 12:42 am
by nageswaragunupudi
May I know under what circumstances do you Requery the main rowset? You must be already aware that as far as possible, Requery should be avoided because it is time consuming and increases load on server and network

Re: MariaDB BlankRow() returns with additional element/field

Posted: Sat Jun 09, 2018 1:16 am
by fraxzi
nageswaragunupudi wrote:May I know under what circumstances do you Requery the main rowset? You must be already aware that as far as possible, Requery should be avoided because it is time consuming and increases load on server and network



Mr. Rao,

I load a single record from database from user selection.. each selection (cycle) it loads the record of the parent.

1. using oRs:Rowset( cSql, {'param'}) to init the oRs, and adds child using oRs:AddChild('table') with (:oChild:lAutoAppend := .T.
2. oRs:Append() when user define new entry and oRs:SyncChild() to refresh xBrowse.. the datasource not refreshed here.. it displays previous loaded data :(
3. oRs:Requery( {'param'} ) to load saved entry and oRs:SyncChild() to refresh xBrowse.. no issue here as it displays the saved records.

:?:

Re: MariaDB BlankRow() returns with additional element/field

Posted: Sat Jun 09, 2018 1:36 am
by fraxzi
Hi Rao,

Strangely, I put the oRs := oCn:RowSet( cSql, {'param'} ) on my init variable function (as once-only declaration) and put oRs:Append() | oRs:SyncChild() | oBrw:Refresh()...
This way it SOLVED my issues refreshing oRs:oChild datasource of xBrowse ...

Moving forward to another task...

:P

Re: MariaDB BlankRow() returns with additional ... (SOLVED)

Posted: Sat Jun 09, 2018 2:40 am
by nageswaragunupudi
Are you using MySql server or MariaDB server? If so, may I know your server version?
You can use
? oCn:cServerInfo

Re: MariaDB BlankRow() returns with additional ... (SOLVED)

Posted: Sat Jun 09, 2018 2:44 am
by fraxzi
nageswaragunupudi wrote:Are you using MySql server or MariaDB server? If so, may I know your server version?
You can use
? oCn:cServerInfo



Hi Mr. Rao,

Image

Re: MariaDB BlankRow() returns with additional ... (SOLVED)

Posted: Sun Jun 10, 2018 1:40 am
by nageswaragunupudi
Can not see the image of your version.
Please post the version info

Re: MariaDB BlankRow() returns with additional ... (SOLVED)

Posted: Wed Jun 13, 2018 12:03 am
by fraxzi
nageswaragunupudi wrote:Can not see the image of your version.
Please post the version info



I was using MariaDB v10.2.15 ... I upgraded to 10.3.7 during the Philippine Holiday ...

Re: MariaDB BlankRow() returns with additional ... (SOLVED)

Posted: Wed Jun 13, 2018 6:53 am
by nageswaragunupudi
Glad to know you are using MariaDB server instead of MySql server.