Hi All,
I have to load data from a file into database.
When there are no records in the file(empty file), then i want to enter 1 hardcoded record into table.
How can i implement this?Could you pls help.
Thanks
how to insert record into table when input file is empty
Moderators: chulett, rschirm, roy
I doubt it. The exec command activity will just trigger the output link or it will not(based on the conditional expression).Now how(where) do you write "insert hard coded value else normal action"nagarjuna wrote:As of now i think of having a execute command activity stage ( using wc -l filename ) and if output of that execute activity stage is 0 then insert hardcoded value else normal action.
Re: how to insert record into table when input file is empty
Have you implemented anything? pls post it here so all can benefit.shalini11 wrote:Hi All,
I have to load data from a file into database.
When there are no records in the file(empty file), then i want to enter 1 hardcoded record into table.
How can i implement this?Could you pls help.
Thanks
Btw..What is empty file? You mean a file with ZERO size or No data (with header)
-
- Participant
- Posts: 54607
- Joined: Wed Oct 23, 2002 10:52 pm
- Location: Sydney, Australia
- Contact:
Job Sequence
Code: Select all
+--> Job to insert hard coded row
|
GetFileSize ---> Test --+
|
+--> Job to process file contents
IBM Software Services Group
Any contribution to this forum is my own opinion and does not necessarily reflect any position that IBM may hold.
Any contribution to this forum is my own opinion and does not necessarily reflect any position that IBM may hold.
-
- Participant
- Posts: 15
- Joined: Thu May 07, 2009 9:50 pm
mate...since you have not described the scenario properly, how your job is going to run properly. if at source level file if there is no data, won't it stop or abort for that matter?I have to load data from a file into database.
When there are no records in the file(empty file), then i want to enter 1 hardcoded record into table.
Thanks,
DS_Learner
DS_Learner
DataStage job wont abort if you dont have records in the input sequential file .It will run successfully .
datastage_learner wrote:mate...since you have not described the scenario properly, how your job is going to run properly. if at source level file if there is no data, won't it stop or abort for that matter?I have to load data from a file into database.
When there are no records in the file(empty file), then i want to enter 1 hardcoded record into table.
Nag