Page 1 of 1
Updating a record in sequential file
Posted: Sat Oct 18, 2008 3:39 am
by sathishmca
Hi any one can you help me that i need to update a record in sequential file.
Ex:
existing record : 1 aa
new record from source is 1 bb
Now i need to update existing record(1 aa) should be change as (1 bb).
Thanks in advance..
Posted: Sat Oct 18, 2008 4:50 am
by ArndW
Sequential files cannot be updated like tables. In order to change a sequential file in DataStage you will need to read it and write it to another, making whatever changes you require as the data is passed through.
Posted: Sat Oct 18, 2008 5:17 am
by ray.wurlod
Sequential files can be updated like tables if you use the ODBC driver for text files with an ODBC stage. This is a particularly useful combination if you are being paid by the hour.
Posted: Sat Oct 18, 2008 4:43 pm
by nsm
the other way I can think of is write the flat file to a hash and update the hash and finally overwrite the sequential file with Hash file.
Thanks
nsm
Posted: Sat Oct 18, 2008 4:48 pm
by ray.wurlod
By "hash" I assume you mean "hashed file". Your "solution" could also be implemented using a database table, but it rather defeats the purpose expressed in the original question, does it not?
Posted: Sun Oct 19, 2008 3:56 pm
by nsm
yes..I meant hashed file.
To use a database table you need to ask somebody to create a table and what I have seen is normally DBA team doesn't create tables for this purpose and the other way I could think of is what I have given.
I know its not really updating the sequential file but solves the issue.
nsm.
Posted: Sun Oct 19, 2008 6:26 pm
by ray.wurlod
So does using the ODBC driver for text file, with much less hassle.