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

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

Postby fraxzi » Fri Jun 08, 2018 5: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..
Last edited by fraxzi on Sat Jun 09, 2018 1:37 am, edited 1 time in total.
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
User avatar
fraxzi
 
Posts: 811
Joined: Tue May 06, 2008 4:28 am
Location: Philippines

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

Postby nageswaragunupudi » Fri Jun 08, 2018 6: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
User avatar
nageswaragunupudi
 
Posts: 10620
Joined: Sun Nov 19, 2006 5:22 am
Location: India

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

Postby fraxzi » Fri Jun 08, 2018 7: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
User avatar
fraxzi
 
Posts: 811
Joined: Tue May 06, 2008 4:28 am
Location: Philippines

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

Postby nageswaragunupudi » Fri Jun 08, 2018 7:05 am

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

G. N. Rao.
Hyderabad, India
User avatar
nageswaragunupudi
 
Posts: 10620
Joined: Sun Nov 19, 2006 5:22 am
Location: India

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

Postby fraxzi » 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:oChild: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
User avatar
fraxzi
 
Posts: 811
Joined: Tue May 06, 2008 4:28 am
Location: Philippines

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

Postby fraxzi » 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
User avatar
fraxzi
 
Posts: 811
Joined: Tue May 06, 2008 4:28 am
Location: Philippines

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

Postby nageswaragunupudi » 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
User avatar
nageswaragunupudi
 
Posts: 10620
Joined: Sun Nov 19, 2006 5:22 am
Location: India

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

Postby fraxzi » Sat Jun 09, 2018 1: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 (: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.

:?:
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
User avatar
fraxzi
 
Posts: 811
Joined: Tue May 06, 2008 4:28 am
Location: Philippines

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

Postby fraxzi » Sat Jun 09, 2018 1: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
User avatar
fraxzi
 
Posts: 811
Joined: Tue May 06, 2008 4:28 am
Location: Philippines

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

Postby nageswaragunupudi » Sat Jun 09, 2018 2: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
User avatar
nageswaragunupudi
 
Posts: 10620
Joined: Sun Nov 19, 2006 5:22 am
Location: India

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

Postby fraxzi » Sat Jun 09, 2018 2: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,

Image
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
User avatar
fraxzi
 
Posts: 811
Joined: Tue May 06, 2008 4:28 am
Location: Philippines

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

Postby nageswaragunupudi » Sun Jun 10, 2018 1:40 am

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

G. N. Rao.
Hyderabad, India
User avatar
nageswaragunupudi
 
Posts: 10620
Joined: Sun Nov 19, 2006 5:22 am
Location: India

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

Postby fraxzi » 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
User avatar
fraxzi
 
Posts: 811
Joined: Tue May 06, 2008 4:28 am
Location: Philippines

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

Postby nageswaragunupudi » Wed Jun 13, 2018 6:53 am

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

G. N. Rao.
Hyderabad, India
User avatar
nageswaragunupudi
 
Posts: 10620
Joined: Sun Nov 19, 2006 5:22 am
Location: India


Return to FiveWin for Harbour/xHarbour

Who is online

Users browsing this forum: No registered users and 44 guests