MySQL and HMG

General Help regarding HMG, Compilation, Linking, Samples

Moderator: Rathinagiri

User avatar
sudip
Posts: 1456
Joined: Sat Mar 07, 2009 11:52 am
Location: Kolkata, WB, India

Re: MySQL and HMG

Post 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
With best regards,
Sudip
User avatar
Rathinagiri
Posts: 5480
Joined: Tue Jul 29, 2008 6:30 pm
DBs Used: MariaDB, SQLite, SQLCipher and MySQL
Location: Sivakasi, India
Contact:

Re: MySQL and HMG

Post by Rathinagiri »

Nice wor(k)ding Sudip.
East or West HMG is the Best.
South or North HMG is worth.
...the possibilities are endless.
User avatar
mol
Posts: 3774
Joined: Thu Sep 11, 2008 5:31 am
Location: Myszków, Poland
Contact:

Re: MySQL and HMG

Post 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
User avatar
Rathinagiri
Posts: 5480
Joined: Tue Jul 29, 2008 6:30 pm
DBs Used: MariaDB, SQLite, SQLCipher and MySQL
Location: Sivakasi, India
Contact:

Re: MySQL and HMG

Post by Rathinagiri »

Hi Marek,

I have no experience whatsoever in Oracle. :(
East or West HMG is the Best.
South or North HMG is worth.
...the possibilities are endless.
User avatar
swapan
Posts: 242
Joined: Mon Mar 16, 2009 4:23 am
Location: Kolkata, India
Contact:

Re: MySQL and HMG

Post 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
Thanks & Regards,
Swapan Das

http://www.swapandas.com/
User avatar
sudip
Posts: 1456
Joined: Sat Mar 07, 2009 11:52 am
Location: Kolkata, WB, India

Re: MySQL and HMG

Post 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
Last edited by sudip on Thu Apr 23, 2009 5:14 pm, edited 2 times in total.
With best regards,
Sudip
User avatar
apais
Posts: 440
Joined: Fri Aug 01, 2008 6:03 pm
DBs Used: DBF
Location: uruguay
Contact:

Re: MySQL and HMG

Post 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
Angel Pais
Web Apps consultant/architect/developer.
User avatar
sudip
Posts: 1456
Joined: Sat Mar 07, 2009 11:52 am
Location: Kolkata, WB, India

Re: MySQL and HMG

Post 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
With best regards,
Sudip
User avatar
Rathinagiri
Posts: 5480
Joined: Tue Jul 29, 2008 6:30 pm
DBs Used: MariaDB, SQLite, SQLCipher and MySQL
Location: Sivakasi, India
Contact:

Re: MySQL and HMG

Post by Rathinagiri »

I don't think/know whether there is a direct function for this.

However, we can write a small function. :)
East or West HMG is the Best.
South or North HMG is worth.
...the possibilities are endless.
Post Reply