From the course: Database Foundations: Database Management

Unlock the full course today

Join today to access over 22,600 courses taught by industry experts or purchase this course individually.

Create a stored procedure in PostgreSQL

Create a stored procedure in PostgreSQL

From the course: Database Foundations: Database Management

Start my 1-month free trial

Create a stored procedure in PostgreSQL

- [Instructor] Stored procedures can incorporate loops, error handling, and other programming logic to consistently perform repeated operations on the server. Unlike functions, they can make changes to the structure of the database by creating or removing other objects, or adding and updating data in a table. They can even move data between platforms, export data snapshots and reports, or perform routine maintenance and backup operations. When a customizable parameter is incorporated and passed into a store procedure, the flexibility of the routine is increased. Let's create a custom procedure in PostgreSQL to store some data in a new temporary table. Now I've got the script from the exercise files already attached to a query window that's attached to my PostgreSQL database. Now, the first thing I want to do is create that new temporary table. And I'm going to call it my names. This table will contain just a single column called my name that'll store a var char 50 data type. So let me…

Contents