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
From the course: Database Foundations: Database Management
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…
Practice while you learn with exercise files
Download the files the instructor uses to teach the course. Follow along and learn by watching, listening and practicing.
Contents
-
-
-
-
-
-
-
(Locked)
Add programming elements to the database3m 54s
-
(Locked)
Create a function4m 51s
-
(Locked)
Create a stored procedure in PostgreSQL4m 30s
-
(Locked)
Create a stored procedure in SQL Server3m 6s
-
(Locked)
Challenge: Write a stored procedure58s
-
(Locked)
Solution: Write a stored procedure8m 7s
-
(Locked)
-