How to use Temporary Table

General Help regarding HMG, Compilation, Linking, Samples

Moderator: Rathinagiri

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

How to use Temporary Table

Post by sudip »

Hi All,

Is there any way to create a temporary table?

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: How to use Temporary Table

Post by Rathinagiri »

What do you mean by that Sudip?

A dbf file?
East or West HMG is the Best.
South or North HMG is worth.
...the possibilities are endless.
User avatar
sudip
Posts: 1456
Joined: Sat Mar 07, 2009 11:52 am
Location: Kolkata, WB, India

Re: How to use Temporary Table

Post by sudip »

Yes, Rathi.

I want to mean if there is any way to store data to a temporary dbf file, it will be very helpful.

Actually, I used this in another software tool (not related to Harbour/xHarbour). There it is called "cursor".

This software tool has some other problems. But, I like the concept of "cursor". With Harbour I have to use array (IMHO).

I heard something like Array RDD (if I am not wrong), but I haven't used it. ;)

BTW, can it be created with MySql? (that will be very helpful also)

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: How to use Temporary Table

Post by Rathinagiri »

In MySQL you can very well use temporary tables (connection wise). That would be created at the time of executing 'create' command, and would be cleared at the time of closure of the connection. I had used that in my system, particularly in user control and management.

Syntax is like this.

CREATE [TEMPORARY] TABLE [IF NOT EXISTS] tbl_name
(create_definition,...)
[table_option ...]
[partition_options]

Or:

CREATE [TEMPORARY] TABLE [IF NOT EXISTS] tbl_name
[(create_definition,...)]
[table_option ...]
[PARTITION BY partition_options]
select_statement

Or:

CREATE [TEMPORARY] TABLE [IF NOT EXISTS] tbl_name
{ LIKE old_tbl_name | (LIKE old_tbl_name) }
East or West HMG is the Best.
South or North HMG is worth.
...the possibilities are endless.
User avatar
sudip
Posts: 1456
Joined: Sat Mar 07, 2009 11:52 am
Location: Kolkata, WB, India

Re: How to use Temporary Table

Post by sudip »

Hello Rathi,
rathinagiri wrote:In MySQL you can very well use temporary tables (connection wise). That would be created at the time of executing 'create' command, and would be cleared at the time of closure of the connection. I had used that in my system, particularly in user control and management.
Thanks a lot! I want this! I am very lucky to have a friend-cum-teacher like you :)
Regards.
Sudip
With best regards,
Sudip
User avatar
gfilatov
Posts: 1090
Joined: Fri Aug 01, 2008 5:42 am
Location: Ukraine
Contact:

Re: How to use Temporary Table

Post by gfilatov »

sudip wrote:Yes, Rathi.

I want to mean if there is any way to store data to a temporary dbf file, it will be very helpful.
Hi Sudip,

Take a look for the Harbour changelog:
...
+ added .prg function to create temporary files:
hb_dbCreateTemp( <cAlias>, <aStruct>, <cRDD>, ;
<cCodePage>, <nConnection> ) -> <lSuccess>
Not all RDDs have to support it. It's verified by support for
DBI_ISTEMPORARY dbInfo() action.
...
I hope that give you an idea :idea:
Kind Regards,
Grigory Filatov

"Everything should be made as simple as possible, but no simpler." Albert Einstein
User avatar
sudip
Posts: 1456
Joined: Sat Mar 07, 2009 11:52 am
Location: Kolkata, WB, India

Re: How to use Temporary Table

Post by sudip »

gfilatov wrote: Take a look for the Harbour changelog:
...
+ added .prg function to create temporary files:
hb_dbCreateTemp( <cAlias>, <aStruct>, <cRDD>, ;
<cCodePage>, <nConnection> ) -> <lSuccess>
Not all RDDs have to support it. It's verified by support for
DBI_ISTEMPORARY dbInfo() action.
...
I hope that give you an idea :idea:
Yes, thank you Guru!!! :-)
I got following information from \MiniGui\Harbour\Doc\WhatsNew.txt

HB_DBCREATETEMP()/DBCREATETEMP() to create temporary tables.

Is there any example for this?

Can I use it with HMG? (As you know, I want to work with both versions :-) )

Thank you very much again.

With best regards.

Sudip
With best regards,
Sudip
Post Reply