Page 3 of 10

Re: My First SQLite Project

Posted: Mon Sep 14, 2009 6:22 pm
by Roberto Lopez
rathinagiri wrote:Oh! Nice. It is a treasure to dig in. :)
I've done for simplicity and speed and I've used in a couple of projects.

It uses direct C calls to access MySql API (not TMySql).

When I left the code, a couple of things should be added yet.

1. Field type detection for automatic conversion (in result recordset).

2. Create a local temporary table to store the recordset, so, it could be accessed as a normal table.

Regards,

Roberto.

Re: My First SQLite Project

Posted: Tue Sep 15, 2009 2:02 am
by sudip
Hello Master Roberto,

The main thing for which I liked VFP for it's embedded SQL. Thank you so much. You made it available to harbour.
1. Field type detection for automatic conversion (in result recordset).

2. Create a local temporary table to store the recordset, so, it could be accessed as a normal table.
Now, if we can add those 2 points. It will be even better. For long time I was looking for temporary table with HMG (as I used it in VFP Cursor). Temporary table creation is already available with Harbour, but I can't create it with HMG Official. So, I am very happy to read your post.

Thank you again.

With best regards.

Sudip

Re: My First SQLite Project

Posted: Tue Sep 15, 2009 3:51 am
by Roberto Lopez
sudip wrote:Temporary table creation is already available with Harbour, but I can't create it with HMG Official.
Why not?

I've was thinking in a temporary 'disk-file' standard table.

What do you was thinking?

Regards,

Roberto.

Re: My First SQLite Project

Posted: Tue Sep 15, 2009 4:16 am
by Rathinagiri
Roberto Lopez wrote: It uses direct C calls to access MySql API (not TMySql).
:o

Is it? Fine.

Re: My First SQLite Project

Posted: Tue Sep 15, 2009 6:11 am
by sudip
Hello Master Roberto,
Roberto Lopez wrote:
sudip wrote:Temporary table creation is already available with Harbour, but I can't create it with HMG Official.
Why not?

I've was thinking in a temporary 'disk-file' standard table.

What do you was thinking?

Regards,

Roberto.
I was thinking about to use

Code: Select all

hb_dbcreatetemp("curItem", adbf)
I hope this will create a temporary table in memory (like cursor in VFP).

With best regards.

Sudip

Re: My First SQLite Project

Posted: Tue Sep 15, 2009 6:14 am
by sudip
Hello Rathi,
rathinagiri wrote:
Roberto Lopez wrote: It uses direct C calls to access MySql API (not TMySql).
:o

Is it? Fine.
Now we should port it to SQLite and PostGreSQL also :)
I feel one of my dreams about HMG is coming true :)
With best regards.
Sudip

Re: My First SQLite Project

Posted: Tue Sep 15, 2009 12:41 pm
by mol
Hi Sudip!
Fine project. I've never wrote any application with SQL, but, I think that will be future.

What about refreshing table after changing/adding new record?
Whether it is necessary to call GET_DATA function after every change?
What about refreshing in multiuser environment?
Recurring data downloads after defined period?

Re: My First SQLite Project

Posted: Tue Sep 15, 2009 12:56 pm
by sudip
mol wrote:Hi Sudip!
Fine project. I've never wrote any application with SQL, but, I think that will be future.

What about refreshing table after changing/adding new record?
Whether it is necessary to call GET_DATA function after every change?
What about refreshing in multiuser environment?
Recurring data downloads after defined period?
Yes, they are omitted :( I must say that those points are very essential. I shall add them later. I am now studying Roberto's code for SQL Layer (in my free time :) ).
Thank you for your comments.
I noticed that your picture has been changed (without sunglass :) )
With best regards.
Sudip

Re: My First SQLite Project

Posted: Tue Sep 15, 2009 1:17 pm
by Roberto Lopez
rathinagiri wrote:
Roberto Lopez wrote: It uses direct C calls to access MySql API (not TMySql).
:o

Is it? Fine.
Yes.

I've looked at TMySql code and I've found that it has two layers.

The 'class' layer is only a wrapper to access true MySql functions, so I've skipped that layer, since class was not needed to make a simple command based SQL interface.

The idea of use direct SQL commands in the programs come to me from VFP. As Sudip points in VFP the result recordset goes to a 'cursor' (a local temporary table).

Regards,

Roberto.

Re: My First SQLite Project

Posted: Tue Sep 15, 2009 1:25 pm
by Roberto Lopez
sudip wrote:
I was thinking about to use

Code: Select all

hb_dbcreatetemp("curItem", adbf)
I hope this will create a temporary table in memory (like cursor in VFP).
I don't knew that function.

I'll try to research a little...

Regards,

Roberto.