Spring Deals - hours only!Up to 70% off on all courses and bundles.-Close
Introduction
Side-effects in functions
Invoking functions

Instruction

Well done! The most straightforward way to invoke a function is by using a SELECT statement.

The example below shows how to call the add_event() function using a SELECT statement:

SELECT add_event(smallint '1', 'PostgreSQL Conference', 'London');

This is in contrast to invoking a function within another function. Here, we've called the function via a console window, not in the code.

Exercise

Write a SELECT statement to call the add_topic() function which will insert a new topic with the name 'Quick cakes'.