MCQs > IT & Programming > PostgreSQL >

You want to update the last modified timestamp in the orders table. The correct way to do this in a PL/pgSQL function, when the parameter integer order_id is passed, would be:

PostgreSQL MCQs

You want to update the last modified timestamp in the orders table. The correct way to do this in a PL/pgSQL function, when the parameter integer order_id is passed, would be:

Answer

Correct Answer:

DECLARE

    order_id ALIAS FOR $1;

    mytimestamp timestamp;

  BEGIN

    mytimestamp := ''now'';

    UPDATE orders SET orderid=order_id, lastmodified = mytimestamp;

    RETURN mytimestamp;

  END;

' LANGUAGE 'plpgsql'; 


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