Posts

Showing posts from September, 2025

S) Output index example

Image
 Input Data               Reformat   Count =3   /*Function returning index of output port*/   output_index_ out :: output_index (in)=   begin   output_index_ out :: if( in.gender =="M")0 else if ( in.gender =="F") 1 ;   end;    

T) Explain the differences between api & utility mode?

  Answer 1:  When u load the data into a table in Utility mode all the constraints are disabled & then data is loaded which leads to faster access. During API Mode constraints will be enabled so that the access will be slow.   Answer 2: API & UTILITY are two possible interfaces to connect to the db’s to perform certain user specific tasks. These interfaces allow the user to access or use certain functions (provided by the db vendor) to perform operation on db’s. The functionality of each of these interfaces depends on  db’s. API has more flexibility but often considered as a slower process as compared to UTILITY mode. Well the trade off is their performance and usage.   Answer 3:   API mode is more diagnostic purpose for retrieving data from db means like selecting particular fields like retrieving the data relatively according to the constraints. Whenever we select API we will get the option of ablocal expression (ab_exp) every time where ever reco...

S) How to find dept wise 2nd and 3rd highest salary .

Image
Sort : Dept- Asc   Salary- Desc   Scan   Key – Dept   Let decimal (“ “ ) rank =0;   Type temporary type =   Record   Decimal( “|”) count ;   End;   Temp : : initialize(in)=   Begin   Temp. rank=0;   Temp.count : : 0;   End;   Temp:: scan( temp,in )=   Begin   Rank =(if( temp.count = in.sal )rank else rank +1;   Temp.count   : : temp.count +1;   End;   Temp : : finalize ( temp,in )=   Begin   Out.* ::in. * ;   End;   Out :: output _select (out)=   Begin   Out ::rank ==2 or rank ==3;   End;     Note : - If any dept doesn’t have 3 rd highest or 2 nd highest then also above code will work , but in output that dept data will not come