on 05-22-2014 5:39 PM
Hi Experts
I have created a BODS Job and in that job i have to create a validation rule as if the cust_id is null the loading must stop.
I dont have idea where i have to define this validation rule in the Job and how to stop the load job if the validation rule file.
My Job was defined like below image
Please guide me where i have to define the validation rule and how to stop the load job.
Thanks in advance
PrasannaKumar
Hi Prasanna,
In validation transform based on the condition we gonna collect records in two tables.
But here you mentioned to stop the job.In that case you have to keep a script at data flow level.
In the script you have to mention the condition as if the source table cust_id column is not null then execute the job.
I understood your requirement in this way, If I am wrong kindly correct me.
Let me know for further clarification.
Regards,
Samatha B.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi samatha b
Thanks for your response. I have done as you said and now i can rise the exception.
I have another requirement as per the validation transformation the data will load into Pass table and Fail table after job execution. If any data entered into fail table i have delete the data loaded into Pass table.
Here i am facing problem as my target tables are MySQL tables and when i am writing scripts i wrote the script as
sql('database','delete from <tablename>');
but as it is an SQL Query execution it is rising exception for the query.
How can i delete the data loaded into MySQL Target table using scripts.
Please guide me for this error also
Thanks in Advance
PrasannaKumar
Hi Prasanna,
I think you can stop job when cust is null
step 1. in Validation transformation and select validation function
step 2. select validation function ( before that create validation function)
step 3. in validation function
create condition with below
if ($cust_id is null)
begin
raise_exception('loading stop due to cust id is null ');
end
Job will stop when condition is meet.
FYI.. I have tested in my system it's working fine
Regards,
Manoj.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
User | Count |
---|---|
87 | |
23 | |
11 | |
9 | |
8 | |
5 | |
5 | |
5 | |
5 | |
4 |
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.