MCQs > IT & Programming > PostgreSQL >

What would happen on compiling and running the following function?

CREATE FUNCTION loop_function (integer) RETURNS integer AS '

  DECLARE

    result integer;

  BEGIN

    result := $1;

    LOOP

      result := result * result;

      EXIT WHEN result >= 15000;

    END LOOP;

    RETURN result;

  END;

' LANGUAGE 'plpgsql';


PostgreSQL MCQs

What would happen on compiling and running the following function?

CREATE FUNCTION loop_function (integer) RETURNS integer AS '

  DECLARE

    result integer;

  BEGIN

    result := $1;

    LOOP

      result := result * result;

      EXIT WHEN result >= 15000;

    END LOOP;

    RETURN result;

  END;

' LANGUAGE 'plpgsql';


Answer

Correct Answer:

The function will compile and will produce numeric output on running  

Explanation:

Note: This Question is unanswered, help us to find answer for this one

PostgreSQL Skill Assessment

Overall Skill Level-Poor

Your Skill Level: Poor

Retake Quizzes to improve it

search

PostgreSQL Skill Assessment

Overall Skill Level-Poor

Your Skill Level: Poor

Retake Quizzes to improve it