CalcResult20240311.sql 1.2 KB

123456789101112131415161718192021222324252627282930313233
  1. do $$
  2. declare
  3. par_input_params public.input_params_type;
  4. par_results public.calc_result_type[];
  5. rec record;
  6. begin
  7. par_input_params.height := 430;
  8. par_input_params.temperature := 15;
  9. par_input_params.pressure := 780;
  10. par_input_params.wind_direction := 2;
  11. par_input_params.wind_speed := 10;
  12. par_input_params.bullet_demolition_range := 0;
  13. call public.sp_calc_corrections(par_input_params => par_input_params, par_measurement_type_id => 2,
  14. par_results => par_results);
  15. raise notice '| measurement_type_id | height | deltapressure | deltatemperature | deviationtemperature | deviationwind | deviationwinddirection |';
  16. raise notice '|----------------------|--------|---------------|------------------|----------------------|---------------|------------------------|';
  17. foreach rec in ARRAY par_results LOOP
  18. raise notice '| % | % | % | % | % | % | % |' ,
  19. lpad(rec.measurement_type_id::text, 20, ' '),
  20. lpad(rec.height::text, 6, ' '),
  21. lpad(rec.deltapressure::text, 13, ' '),
  22. lpad(rec.deltatemperature::text, 16, ' '),
  23. lpad(rec.deviationtemperature::text, 20, ' '),
  24. lpad(rec.deviationwind::text, 13, ' '),
  25. lpad(rec.deviationwinddirection::text, 22, ' ');
  26. end loop;
  27. end $$