FiveTech Support Forums

FiveWin / Harbour / xBase community
Board index FiveWin for Harbour/xHarbour MariaDB BlankRow() returns with additional ... (SOLVED)
Posts: 811
Joined: Tue May 06, 2008 04:28 AM
MariaDB BlankRow() returns with additional ... (SOLVED)
Posted: Fri Jun 08, 2018 05:48 AM

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..

Kind Regards,

Frances



Fivewin for xHarbour v18.07

xHarbour v1.2.3.x

BCC 7.3 + PellesC8 ( Resource Compiler only)

ADS 10.1 / MariaDB

Crystal Reports 8.5/9.23 DE

xMate v1.15
Posts: 10733
Joined: Sun Nov 19, 2006 05:22 AM
Re: MariaDB BlankRow() returns with additional element/field
Posted: Fri Jun 08, 2018 06:16 AM

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.

Regards



G. N. Rao.

Hyderabad, India
Posts: 811
Joined: Tue May 06, 2008 04:28 AM
Re: MariaDB BlankRow() returns with additional element/field
Posted: Fri Jun 08, 2018 07:03 AM

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.

Kind Regards,

Frances



Fivewin for xHarbour v18.07

xHarbour v1.2.3.x

BCC 7.3 + PellesC8 ( Resource Compiler only)

ADS 10.1 / MariaDB

Crystal Reports 8.5/9.23 DE

xMate v1.15
Posts: 10733
Joined: Sun Nov 19, 2006 05:22 AM
Re: MariaDB BlankRow() returns with additional element/field
Posted: Fri Jun 08, 2018 07:05 AM

Use autoappend feature
Or, explain your requirement, we will provide sample.

Regards



G. N. Rao.

Hyderabad, India
Posts: 811
Joined: Tue May 06, 2008 04:28 AM
Re: MariaDB BlankRow() returns with additional element/field
Posted: Sat Jun 09, 2018 12:35 AM
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:lAutoAppend but when parent oRs are :requery with oRs:SyncChild() and refresh the xBrowse oRs:oChild, the display not refreshed().
Kind Regards,

Frances



Fivewin for xHarbour v18.07

xHarbour v1.2.3.x

BCC 7.3 + PellesC8 ( Resource Compiler only)

ADS 10.1 / MariaDB

Crystal Reports 8.5/9.23 DE

xMate v1.15
Posts: 811
Joined: Tue May 06, 2008 04:28 AM
Re: MariaDB BlankRow() returns with additional element/field
Posted: Sat Jun 09, 2018 12:39 AM

Mr. Rao,

I got it!

oRs:ReSync()
oRs:SyncChild()

refreshes the oRs:oChild...

:P

Kind Regards,

Frances



Fivewin for xHarbour v18.07

xHarbour v1.2.3.x

BCC 7.3 + PellesC8 ( Resource Compiler only)

ADS 10.1 / MariaDB

Crystal Reports 8.5/9.23 DE

xMate v1.15
Posts: 10733
Joined: Sun Nov 19, 2006 05:22 AM
Re: MariaDB BlankRow() returns with additional element/field
Posted: Sat Jun 09, 2018 12:42 AM

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

Regards



G. N. Rao.

Hyderabad, India
Posts: 811
Joined: Tue May 06, 2008 04:28 AM
Re: MariaDB BlankRow() returns with additional element/field
Posted: Sat Jun 09, 2018 01:16 AM
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 (: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.

:-)
Kind Regards,

Frances



Fivewin for xHarbour v18.07

xHarbour v1.2.3.x

BCC 7.3 + PellesC8 ( Resource Compiler only)

ADS 10.1 / MariaDB

Crystal Reports 8.5/9.23 DE

xMate v1.15
Posts: 811
Joined: Tue May 06, 2008 04:28 AM
Re: MariaDB BlankRow() returns with additional element/field
Posted: Sat Jun 09, 2018 01:36 AM

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

Kind Regards,

Frances



Fivewin for xHarbour v18.07

xHarbour v1.2.3.x

BCC 7.3 + PellesC8 ( Resource Compiler only)

ADS 10.1 / MariaDB

Crystal Reports 8.5/9.23 DE

xMate v1.15
Posts: 10733
Joined: Sun Nov 19, 2006 05:22 AM
Re: MariaDB BlankRow() returns with additional ... (SOLVED)
Posted: Sat Jun 09, 2018 02:40 AM

Are you using MySql server or MariaDB server? If so, may I know your server version?
You can use
? oCn:cServerInfo

Regards



G. N. Rao.

Hyderabad, India
Posts: 811
Joined: Tue May 06, 2008 04:28 AM
Re: MariaDB BlankRow() returns with additional ... (SOLVED)
Posted: Sat Jun 09, 2018 02:44 AM
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,

Kind Regards,

Frances



Fivewin for xHarbour v18.07

xHarbour v1.2.3.x

BCC 7.3 + PellesC8 ( Resource Compiler only)

ADS 10.1 / MariaDB

Crystal Reports 8.5/9.23 DE

xMate v1.15
Posts: 10733
Joined: Sun Nov 19, 2006 05:22 AM
Re: MariaDB BlankRow() returns with additional ... (SOLVED)
Posted: Sun Jun 10, 2018 01:40 AM

Can not see the image of your version.
Please post the version info

Regards



G. N. Rao.

Hyderabad, India
Posts: 811
Joined: Tue May 06, 2008 04:28 AM
Re: MariaDB BlankRow() returns with additional ... (SOLVED)
Posted: Wed Jun 13, 2018 12:03 AM
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 ...
Kind Regards,

Frances



Fivewin for xHarbour v18.07

xHarbour v1.2.3.x

BCC 7.3 + PellesC8 ( Resource Compiler only)

ADS 10.1 / MariaDB

Crystal Reports 8.5/9.23 DE

xMate v1.15
Posts: 10733
Joined: Sun Nov 19, 2006 05:22 AM
Re: MariaDB BlankRow() returns with additional ... (SOLVED)
Posted: Wed Jun 13, 2018 06:53 AM

Glad to know you are using MariaDB server instead of MySql server.

Regards



G. N. Rao.

Hyderabad, India

Continue the discussion