Page 2 of 6
Re: MySQL and HMG
Posted: Thu Apr 23, 2009 4:02 am
by sudip
apais wrote:How and how much do your clients pay for their Mysql installations ?
Have your ever tried Postgresql ?
Why do you prefer one over the other ?
Thank you very much for your interest. I am a "learner" of both HMG and MySql. And this will be my "first" project using HMG + MySql.

So I till now I haven't received any payment for "Mysql installations" from my client. IMHO, my clients will pay me for the development of software, not for "Mysql installations" as this is a product of another company!!!

I even don't know from where they will buy this software
No, my friend, I never tried Postgresql. Hope this will be very good!!!
I may prefer one product, but I never say "Mysql" is the best

Yes, I have at least one "guru" of MySql + HMG (I use the word "guru" in it's true meaning, which I already expressed in this forum). And I must learn mysql first. Because I have a very bad habit of being out of focus.
I must try Postgresql after learning HMG + MySql and in this case I need your help too
And I shall work on my proposed project after my daily routine. So it will be slow but steady
I want to create a software which can "easily" be ported from one Backend Server to another.
Thank you again for your interest.
With best regards.
Sudip
Re: MySQL and HMG
Posted: Thu Apr 23, 2009 4:54 am
by Rathinagiri
Nice wor(k)ding Sudip.
Re: MySQL and HMG
Posted: Thu Apr 23, 2009 6:04 am
by mol
Hi Rathi,
I wanna ask if you have any experiences with connecting to Oracle database?
Is it so different from work with MySQL?
Best regards, Marek
Re: MySQL and HMG
Posted: Thu Apr 23, 2009 6:18 am
by Rathinagiri
Hi Marek,
I have no experience whatsoever in Oracle.

Re: MySQL and HMG
Posted: Thu Apr 23, 2009 7:05 am
by mol
OK, thanks
Re: MySQL and HMG
Posted: Thu Apr 23, 2009 12:38 pm
by swapan
THANKS A LOT RATHINAGIRI FOR THIS THREAD!!!
When we were discussing about data corruption in one of Sudip's thread, this MySQL discussion came up. And I voiced for to take all your important tips related to MySQL in a separate thread so that it be used for reference in future. Thanks you did it.....
Sudip:
In retail there's a tendency (though now fading with big stores) to hide "certain" purchases. What we call in Hindi Ek Number ka maal & Do Number Ka maal (No.1 purchases - which have valid purchase bills, No. 2 purchases - which have illegal purchase bills). Now during selling - the customer can buy both kind of items...lots of foul play comes in to maintain actual stock & stock to be shown..... though now the scenario is chaning with VAT coming into effect in India.
And yes Sales Entry should be able to accept data from Scanner (reading Barcodes) and manual entry provision (entering the product code,barcode or UPCEAN no. of the product) is also reqd.
BACKUP: In MSSQL there's small querry which takes backup in .BAK format.
Long time back I tested MySQL backup - a script which creates a text file and all the data is written. I think its a slow process. User will need ONE CLICK APPROACH for backup & restore.
Regards,
Swapan
Re: MySQL and HMG
Posted: Thu Apr 23, 2009 1:05 pm
by sudip
swapan wrote:
Sudip:
In retail there's a tendency (though now fading with big stores) to hide "certain" purchases. What we call in Hindi Ek Number ka maal & Do Number Ka maal (No.1 purchases - which have valid purchase bills, No. 2 purchases - which have illegal purchase bills). Now during selling - the customer can buy both kind of items...lots of foul play comes in to maintain actual stock & stock to be shown..... though now the scenario is chaning with VAT coming into effect in India.
Sorry, I don't agree. But the detailed discussion is beyond this forum.
Thanks for your other proposals. I shall have it in my mind during development.
Regards.
Sudip
Re: MySQL and HMG
Posted: Thu Apr 23, 2009 2:28 pm
by apais
Hi Sudip
So I till now I haven't received any payment for "Mysql installations" from my client. IMHO, my clients will pay me for the development of software, not for "Mysql installations" as this is a product of another company!!!

I even don't know from where they will buy this software
Crystal clear
Best Regards
Angel
Re: MySQL and HMG
Posted: Thu Apr 23, 2009 3:28 pm
by sudip
Hi,
In my old programs (Clipper, xHarbour, HMG) I used one UDF, DbCreaChk(), which will create a table if it doesn't exist, changes the structure if the structure is changed. Following is the code for this.
Code: Select all
#include "minigui.ch"
#include "dbstruch.ch"
FUNCTION dbCreaChk(fname, adbf)
local aStruct, option, lChange := .f., lNew := .f., i, newrec, oldrec
fname := upper(fname)
if !file(fname+".dbf")
set exclusive on
dbcreate(fname, adbf)
set exclusive off
return .t.
endif
use (fname)
aStruct = dbstruct()
use
if len(aStruct) != len(adbf)
lChange = .t.
else
i = 1
do while i <= len(aStruct) .and. !lNew .and. !lChange
if len(aStruct[i, DBS_NAME]) != len(adbf[i, DBS_NAME]) ;
.or. upper(aStruct[i, DBS_NAME]) != upper(adbf[i, DBS_NAME]) ;
.or. upper(aStruct[i, DBS_TYPE]) != upper(adbf[i, DBS_TYPE]) ;
.or. aStruct[i, DBS_LEN] != adbf[i, DBS_LEN] ;
.or. aStruct[i, DBS_DEC] != adbf[i, DBS_DEC]
lChange = .t.
endif
i++
enddo
endif
if lChange
if msgyesno(fname+" structure has been changed. Change";
+" the structure ?")
set exclusive on
use (fname)
pack
oldrec = reccount()
use
deletefile("settemp.dbf")
if renamefile(fname+".dbf", "settemp.dbf") != 0
msginfo("Cannot change file structure!",)
QUIT
ENDIF
dbcreate(fname, adbf)
use (fname)
append from settemp
newrec = reccount()
use
if newrec != oldrec
msginfo("Problem in creating file :"+fname+;
". You can get all records in the file SETTEMP.DBF")
quit
endif
deletefile("settemp.dbf")
set exclusive off
return .t.
else
msginfo(fname+" structure mismatch")
quit
endif
endif
return .f.
function NetSelect(cTable)
if select(cTable) = 0
use &cTable shared new
select &cTable
endif
return nil
Is there any "easy" way to to do this with MySql? MySql 5.0 Manual says that
... However, there is no verification that the existing table has a structure identical to that indicated by the CREATE TABLE statement.
So, should I write the code of this function for MySql?
TIA.
Regards.
Sudip
Re: MySQL and HMG
Posted: Thu Apr 23, 2009 5:49 pm
by Rathinagiri
I don't think/know whether there is a direct function for this.
However, we can write a small function.
