Re: Reading C-ISAM Data with Borland Delphi
Posted in 1997
Topics: Connectivity: ODBC / JDBC / .NET, Migration, Import/Export & Data Conversion, Jobs, Consulting & Announcements
Michael Segel wrote: > > Bob Findley wrote: > > > > Use Delphi and ODBC ( C is not required ). > > Not commenting on Delphi as a tool, it is not the best tool > for the job in this instance. > > The data resides on the server in a flat file. Go back and read the original post! The data resides on a Windows 95 machine. There may exist no network for all we know. > The data format is fairly straight forward. Perhaps, perhaps not. Read what you yourself wrote about the OCCURS clause below. > > To use Delphi is a bit of a braindead approach. I presumed that Delphi was a given, probably because of its existing use in a related application. > > First, is there an ODBC for C-ISAM? > (Lets assume that there is.) There is. > Second. Your job is to convert the data from one format > to another so that you can load it in to a different database. And the ODBC for C-ISAM already does the conversion. > > Using a PC tool is a mistake. First, you are opening a network > connection reading the data to your pc, then loading the data > back across the network to either the same server or a different > server. (So now the program is slow.) The original post does not support this conclusion. The data are on a PC! > > In C, you just open the DB table as a file, read in either > a fixed length string, or until an EOL character. (I forget > if C-ISAM stores each record with a \\n at the end of the record.) > Then you can parse your data out. You can > either write it to a record and insert into an Informix DB, > or you can write it out as a comma delimited file which can > be imported to any db. > If your data has an occurs clause, then you have some more > programming. And the ODBC for C-ISAM already does all this (but, of course, without the need for the comma-delimited file and the need to import, or the need for a separate Informix DB table). Yes, the ODBC driver deals quite nicely with the OCCURS clause. > > Not to pick on Delphi, but chose the best tool. > For data migration, C is best! Not to pick on C (in which much of the ODBC for C-ISAM is implemented, after all), but chose the best tool! -- Tom Morrison, T.Morrison@liant.com Liant Software Corporation http://www.liant.com/ 512-343-1010 FAX:512-343-9487