RDD SQL!

HMG Samples and Enhancements

Moderator: Rathinagiri

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

Re: RDD SQL!

Post by sudip »

Hello,

Grigory sent me the solution:-
Hi Sudip,

RDDI_AFFECTEDROWS returns the number off affected rows AFAIK.

> How can I save records into database using HbSqlDD.

You should use the command INSERT INTO <table> .. for append record and UPDATE
<table> SET .. for replace record(s).
Thank you Grigory!!! :)

You will be kind enough if you please send one sample regarding this.

With best regards.

Sudip
With best regards,
Sudip
User avatar
Roberto Lopez
HMG Founder
Posts: 4004
Joined: Wed Jul 30, 2008 6:43 pm

Re: RDD SQL!

Post by Roberto Lopez »

sudip wrote:Hello,

Grigory sent me the solution:-
Hi Sudip,

RDDI_AFFECTEDROWS returns the number off affected rows AFAIK.

> How can I save records into database using HbSqlDD.

You should use the command INSERT INTO <table> .. for append record and UPDATE
<table> SET .. for replace record(s).
Thank you Grigory!!! :)

You will be kind enough if you please send one sample regarding this.

With best regards.

Sudip
The rdd author explain this explicity in the text I've posted:

Code: Select all

The programmer must call SQL command explicitly to modify SQL tables.
So, it must be done the same way that table is created and records added in the procedure 'createtable()' in the uploaded sample, using PURE SQL via RDDINFO(RDDI_EXECUTE,... ) function.

I've was talking about a different thing.

When you modify a table via xBase code and only the recordset is changed, if we could know what records were affected by these commands we could create some kind of SQL COMMIT command to 'flush' the changes to true backend table.

Regards,

Roberto.
Regards/Saludos,

Roberto


(Veritas Filia Temporis)
User avatar
sudip
Posts: 1454
Joined: Sat Mar 07, 2009 11:52 am
Location: Kolkata, WB, India

Re: RDD SQL!

Post by sudip »

Hello Roberto,
Roberto wrote:
When you modify a table via xBase code and only the recordset is changed, if we could know what records were affected by these commands we could create some kind of SQL COMMIT command to 'flush' the changes to true backend table.
Is there any way to know which temporary records are effected? And then we have to create generic sql string to commit.

Some how the reason (from my very basic knowledge) I think TMySqlServer will be more flexible and efficient. This is not my strong view, because I know very little about database programming.

With best regards to you all.

Sudip
With best regards,
Sudip
User avatar
Roberto Lopez
HMG Founder
Posts: 4004
Joined: Wed Jul 30, 2008 6:43 pm

Re: RDD SQL!

Post by Roberto Lopez »

sudip wrote:Hello Roberto,

I know very little about DBMS Server programming. But from this very basic knowledge, some questions came to my mind. I want to get a clear picture before working on any library (because database programming is my bread and butter :))
<...>
[Sudip
I can't answer all your questions about efficiency of different methods, because (IMHO) it will require extensive tests and benchmarking to be sure about that (maybe someone that had done it can help us on this).

In general (using a remote server or not) I prefer to copy the data to arrays, work with them and finally open the tables make the updates and close it as quick as possible.

Maybe that is not the faster way, but I privilege the reliability over the speed.

Please, consider that this is my personal opinion only, perhaps this is not the better solution for you.

Regards,

Roberto.
Regards/Saludos,

Roberto


(Veritas Filia Temporis)
User avatar
sudip
Posts: 1454
Joined: Sat Mar 07, 2009 11:52 am
Location: Kolkata, WB, India

Re: RDD SQL!

Post by sudip »

Roberto Lopez wrote: I can't answer all your questions about efficiency of different methods, because (IMHO) it will require extensive tests and benchmarking to be sure about that (maybe someone that had done it can help us on this).

In general (using a remote server or not) I prefer to copy the data to arrays, work with them and finally open the tables make the updates and close it as quick as possible.

Maybe that is not the faster way, but I privilege the reliability over the speed.

Please, consider that this is my personal opinion only, perhaps this is not the better solution for you.

Regards,

Roberto.
Sorry, after writing my previous message, I thought I shouldn't write those strong words. And I edited my previous message. In the mean time you replied my message.

But, your reply gave me some insight about database programming. :) Yes, I shall wait.

With best regards.

Sudip
With best regards,
Sudip
User avatar
Rathinagiri
Posts: 5471
Joined: Tue Jul 29, 2008 6:30 pm
DBs Used: MariaDB, SQLite, SQLCipher and MySQL
Location: Sivakasi, India
Contact:

Re: RDD SQL!

Post by Rathinagiri »

In general (using a remote server or not) I prefer to copy the data to arrays, work with them and finally open the tables make the updates and close it as quick as possible.
Thanks Roberto. Nice words.
East or West HMG is the Best.
South or North HMG is worth.
...the possibilities are endless.
User avatar
Roberto Lopez
HMG Founder
Posts: 4004
Joined: Wed Jul 30, 2008 6:43 pm

Re: RDD SQL!

Post by Roberto Lopez »

Roberto Lopez wrote: I've wrote a private message to the rdd author (Mindaugas Kavaliauskas) asking about that.
I'll post here any info regarding that.
Mindaugas Kavaliauskas, had responded to my message about SQLRDD.

The mechanism to know which records were changed is not implemented yet, but he has plans to do it.

When that be implemented, could be easy to create a generic function (ie: SqlCommit()) to update the tabke on the server.

Regards,

Roberto.
Regards/Saludos,

Roberto


(Veritas Filia Temporis)
User avatar
sudip
Posts: 1454
Joined: Sat Mar 07, 2009 11:52 am
Location: Kolkata, WB, India

Re: RDD SQL!

Post by sudip »

Roberto Lopez wrote: Mindaugas Kavaliauskas, had responded to my message about SQLRDD.

The mechanism to know which records were changed is not implemented yet, but he has plans to do it.

When that be implemented, could be easy to create a generic function (ie: SqlCommit()) to update the tabke on the server.
Thanks a lot :)

With best regards.

Sudip
With best regards,
Sudip
User avatar
Roberto Lopez
HMG Founder
Posts: 4004
Joined: Wed Jul 30, 2008 6:43 pm

Re: RDD SQL!

Post by Roberto Lopez »

sudip wrote: Thanks a lot :)

With best regards.

Sudip
And... since you are testing... you could give a try to ADORDD, even I have 'personal problems' with it :)

I mean, that to use it, you must install an additional piece of software (MySql ODBC Connector 3.51 from mysql.com) and I don't like to work so, specially if there is a MS technology 'mediating' between your application and your data.

But, maybe that in a 'controlled situation' (ie: if you have quick access to machines involved to control it) could be useful for you.

Regards,

Roberto.
Regards/Saludos,

Roberto


(Veritas Filia Temporis)
User avatar
sudip
Posts: 1454
Joined: Sat Mar 07, 2009 11:52 am
Location: Kolkata, WB, India

Re: RDD SQL!

Post by sudip »

Roberto Lopez wrote: And... since you are testing... you could give a try to ADORDD, even I have 'personal problems' with it :)

I mean, that to use it, you must install an additional piece of software (MySql ODBC Connector 3.51 from mysql.com) and I don't like to work so, specially if there is a MS technology 'mediating' between your application and your data.

But, maybe that in a 'controlled situation' (ie: if you have quick access to machines involved to control it) could be useful for you.
I tried ADORDD a few months ago. But, faced problem, e.g., checking existence of table in a database!!! I received solutions. But solutions have more MS Codes!!! Now, I am also facing some problems with my Dbf to Ms Excel utility. And some times quick access (like ADO) may not be reliable access ;)

I want a reliable, mature and stable system. Because this is my bread and butter!!!

So, shall I continue my MySql journey with TMySqlServer library? What is your advice? :)

With best regards.

Sudip
With best regards,
Sudip
Post Reply