Dale Seaburg wrote:

Thanks Daniel for the reply. Unfortunately, none of the suggestions are feasible or desireable. The databases and associated tables are definitely separate and won't be mixed in the future.

Even in Access, I've resorted to techniques you mention, like grabbing a set of data from one table/database say from a distant server, copy to a local Access temp table, then link that data to a nearby SQL Server. Speeds things up considerably.

However, my primary concern at the moment is to be able to open a postgresql database/table, and read from a series of .csv tables (files - virtually hundreds of them) one at a time, and append the data to the postgresql table.

I can't really tell you too much about what is possible via OOo Base functionality. If OOo supports treating csv files as data sources, then you should be able to script something that opens up a recordset, and walks through it, appending stuff into Postgres. This would certainly be slow though. More to the point would be to use a native Postgres tool to import from the CSVs. I'm doing a very similar thing in Access via ODBC. Basically the user selects a source file with a File-Open dialog, and then the code loops through all applicable files, copies them to a particular folder, and calls 'load data infile' via ADO. If Postgres has a similar SQL command, then you can use it to load CSVs.
Yes, I can *very* easily do this in Access, but I'm trying my best to wean my self from M$ products.
Tell me about it.

If you're looking for an Access alternative ( other than OOo Base of course ), check out my 3 Perl projects at: http://entropy.homelinux.org/axis_not_evil ... they won't help you with your current problem ( importing CSVs ), but they go a *long* way towards providing Access-like functionality. The projects are all open-source, cross-platform, etc, and have *very* low system requirements.

I guess I need to dig into the OOo Base API. The .csv file has over 100 columns per each record in it. That's a lot of Basic code typing.
Sounds like a job for a generic import routine with a nice GUI. Might get you some fame & fortune within the OOo Base community :)
An Append query against the csv file, if I could link or point (connection) to it, would be a whole lot faster.

The technique I would use in Access would be to use VB code to get the next csv filename, establish a link using an import specification, keeping the same linked table name for each it iteration, then execute the Append Query to the postgresql table. Then delete the link of the csv table, get next csv filename and repeat the process.

What I don't know is if this technique is feasible in OOo Base.
There are certainly no import specifications under OOo Base. Investigate a native Postgres import tool.

BTW, I am using OOo 2.0. There was an entry about doing something similar, but the technique was applicable to 1.1.x, not the current 2.0 - there is no Tools | Data Sources path, that the technique used. It is available in Calc, I think, though using View | Data Sources. Why not in Base?
No-one's done it yet?
It seems so fundamental. Maybe I'm just *too* used to MS Access... ;-)

Yes. Access has a lot of niceties for importing data and doing transparent cross-database queries and stuff. I suppose it's up to us to implement those features in competing open-source projects to help people kick their Access addiction. I'm certainly doing what I can ...

--
Daniel Kasak
IT Developer
NUS Consulting Group
Level 5, 77 Pacific Highway
North Sydney, NSW, Australia 2060
T: (+61) 2 9922-7676 / F: (+61) 2 9922 7989
email: [EMAIL PROTECTED]
website: http://www.nusconsulting.com.au

---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to