1. Howto get a EDB database to mysql format?
- Posted by PresFox May 30, 2010
- 1557 views
Hello,
I have a edb database(the EDS System), wich i would like to export to text, csv, or mysql format.
I found a few tools in the user contributions, but cant get any of them to work.
Does someone have a tip wich tool i could use for this?
Thanks in advance!
2. Re: Howto get a EDB database to mysql format?
- Posted by znorq2 May 31, 2010
- 1526 views
Hello,
I have a edb database(the EDS System), wich i would like to export to text, csv, or mysql format.
I found a few tools in the user contributions, but cant get any of them to work.
Does someone have a tip wich tool i could use for this?
Thanks in advance!
If you're doing it "manually" (program it yourself), you have to take binary data and nested sequences in consideration - as far as I can see.
These are the available functions in 3.xx (not sure if there are any changes in 4.x);
db_create - create a new database
db_open - open an existing database
db_select - select a database to be the current one
db_close - close a database
db_create_table - create a new table within a database
db_select_table - select a table to be the current one
db_rename_table - rename a table
db_delete_table - delete a table
db_table_list - get a list of all the table names in a database
db_table_size - get the number of records in the current table
db_find_key - quickly find the record with a certain key value
db_record_key - get the key portion of a record
db_record_data - get the data portion of a record
db_insert - insert a new record into the current table
db_delete_record - delete a record from the current table
db_replace_data - replace the data portion of a record
db_compress - compress a database
db_dump - print the contents of a database
db_fatal_id - handle fatal database errors
By using db_table_list(), db_select_table and db_table_size() you can iterate through all tables and records in a single database, using db_record_key() and db_record_data() for reading information, and IO operations for storing the data to a txt/csv file (maybe by saving each table in a separate file using the table name as a file name?)
As per now, I don't have any example code, but hopefully this may get you going?
PS! Again, if there are binary information stored in the database, you'll have to convert that information to ASCII format so that it can be stored in text files. This will make it a bit more tricky. Look for base64 conversion.
Also, if you're storing nested sequences as data, you'll probably have to do some formatting operations on that to. I'm sorry I can't be more specific, I'm horrible at explaining things - at least in English... :/
I'm no expert at this, but hopefully this have contributed to getting you started..?
Kenneth / ZNorQ
3. Re: Howto get a EDB database to mysql format?
- Posted by znorq2 May 31, 2010
- 1458 views
[quote znorq2]
Does someone have a tip wich tool i could use for this?
Ups, think I was a bit to quick answering, I didn't read your last sentence properly... Forget all I said.. :p
4. Re: Howto get a EDB database to mysql format?
- Posted by DerekParnell (admin) Jun 01, 2010
- 1422 views
Hello,
I have a edb database(the EDS System), wich i would like to export to text, csv, or mysql format.
I found a few tools in the user contributions, but cant get any of them to work.
Does someone have a tip wich tool i could use for this?
Thanks in advance!
The short answer is that there is no tool already written to do this.
The reason is that EDS databases have capabilities that are difficult to express in TEXT or CSV formats, and maybe be impossible for relational D/B like MySQL. Also, EDS does NOT have some capabilities that are assumed in traditional D/B, such as storing information about the records in the data base itself, eg. field names and indexes.
Thus there is no generic tool to do this. Instead, each case needs to be dealt with on its own basis.
Why do you need to export it? Is it going to be used by some non-Euphoria application? If so, what format would that application prefer to use?
Is your EDS database one of the simpler types in so far as it has fixed format records that do not have nested sequences? If so, this can be exported without too much effort.
The choice between TEXT, CSV, and SQL is very important as the approach to exporting the data will depend a great deal on that.
For TEXT, you need to decide on how to delimit fields, records and tables. For example, you could use XML or JSON formats, or devise your own.
For CSV, you need to decide on whether to supply field names or not.
For SQL, is it just the data you need or are you going to build a new SQL database from the exported data? In which case, you need to supply meta-data about the fields, records, and tables.
It comes down to knowing more about what is going to use the exported data and making it easier for that to happen. Once you know that, it makes your choices easier.
But in the end, you (or someone) will have to write some custom exporting tool for your particular EDS database.
5. Re: Howto get a EDB database to mysql format?
- Posted by euphoric (admin) Jun 01, 2010
- 1457 views
I have a edb database(the EDS System), wich i would like to export to text, csv, or mysql format.
Look into Matthew Lewis' wxEDB. I think you'll be able to load in the database and then export it in a comma-delimited (or tab-delimited) format. I would confirm for sure but I'm at home on a new PC.