views:

107

answers:

1

How would one go about using a UUID as a primary key in an OpenOffice.org Base database?

I have a need to gather data on multiple, unnetworked PCs that I can't install software on (I am using OpenOffice.org Portable). After gathering data, it will be merged into a single database.

I believe that a UUID/GUID is the ideal solution, but for all my Googling and fiddling with the software, I can't figure out how to actually implement it.

(If there is no solution, is there any alternate approach?)

A: 

I do not know how to implement UUID, but you could take something like the MAC number of the computer. Before spending a lot of time on this, you should consider how many computers that you would have at most and the damage caused by two machines having the same ID. With UUID is is probably something like zero with even a billion machines, but if you only expect a thousand machines then maybe the MAC address will be alright.

David
I presume you mean MAC and a timestamp? Of course this raises the question of how to get a MAC (or other machine ID) and the timestamp, how to auto-fill them, and how to use them both as a primary key.
Andrew Russell
Yes I mean MAC and timestamp.If you are using Windows you could use Autohotkey, there is a really really dirty solution here:http://www.autohotkey.com/forum/topic3701.htmlI didn't put much effort into this as Autohotkey does not work on Linux. Python works on linux and can call c-libraries, should be easy to find a solution for this.To use them both as primary keys I would simply concat them together. I nicer way though, as it seems like you are up for large amounts of data is to generate the primary key when you put the data from all the machines together. Then it could be int.
David