How can you find the 2nd Highest salary in a file department wise in abinitio?
Answer Posted / raje0303
Hi Murali,
This logic is correct only will fail when highest salary entries are more than one (e.g. two people has highest and equal salary )
we need to updated scan function as below -
type temporary_type=record
integer(4) temp1;
integer(4) last_sal;
end;
temp :: initialize(in) =
begin
temp.temp1::0;
temp.last_sal::0;
end;
out :: scan(temp, in) =
begin
if(last_sal != in.salary)
begin
out.temp1 :: temp.temp1 + 1;
end;
last_sal = in.salay;
end
out :: finalize(temp, in) =
begin
out.sal:: in.sal;
out.dno :: in.dno;
out.temp1 :: temp.temp1;
end;
out :: output_select(out) =
begin
out::out.temp1 == 2;
end;
###############################################
4.Output_file
| Is This Answer Correct ? | 6 Yes | 2 No |
Post New Answer View All Answers
What parallelisms does Abinitio support?
What is is a data flow graph?
How does the bre work with the co>operating system?
How can you force the optimizer to use a particular index?
Within a cursor, how would you update fields on the row just fetched?
What is rollup component?
What happens when we provide null key to sort, merge and pbks in Abinitio ?
Can some tell me at which level pdl gets resolved when parameters are resolved in abinitio? Also what happens in dml evaluation during parameter evaluation ?
Why might you create a stored procedure with the with recompile option?
Can you explain data flow graph with an example?
Do you think effective communication is necessary for data processing? What is your strength in terms of same?
What are differences between different gde versions(1.10,1.11,1.12,1.13and 1.15)?
I am unable to connect sever database(oracle) from gde(db config file) local system.i set all these?
What is de-partition in abinitio?
Explain data flow graph with an example?