Welcome to the Treehouse Community

Want to collaborate on code errors? Have bugs you need feedback on? Looking for an extra set of eyes on your latest project? Get support with fellow developers, designers, and programmers of all backgrounds and skill levels here with the Treehouse Community! While you're at it, check out some resources Treehouse students have shared here.

Looking to learn something new?

Treehouse offers a seven day free trial for new students. Get access to thousands of hours of content and join thousands of Treehouse students and alumni in the community today.

Start your free trial

Databases Modifying Data with SQL Handling Errors When Manipulating Data Databases with Frameworks

Vaibhav Vikram Singh
Vaibhav Vikram Singh
2,604 Points

Stored Procedure

Sorry, this question is thoroughly out of context.

There is no video or tutorials related to stored procedures. Will that be added in near future ?

5 Answers

Steven Parker
Steven Parker
231,271 Points

I looked in the Treehouse Content Roadmap and noticed that the next planned course for this topic is Reporting With SQL, scheduled for release this month (Feb 2016). I don't see anything else in the queue, so the next one is probably at least a month away.

A question with no subject tags like this one might easily be overlooked by the Treehouse staff. If you want to pose your question to them directly, try writing to Treehouse Support. Update this with what they reply!

Here is an example of a stored procedure in PostgreSQL to add a new row to the movies table:

CREATE FUNCTION add_movie(_title TEXT, _year_released INT, _genre TEXT)
RETURNS void AS
$$
BEGIN
INSERT INTO movies(title, year_released, genre)
VALUES(_title, _year_released, _genre);
END;
$$
LANGUAGE 'plpgsql';

To call the function:

SELECT add_movie('Moonlight', 2016, 'Drama');

To see a list of your functions:

\df

To delete a function:

DROP FUNCTION add_movie(_title TEXT, _year_released INT, _genre TEXT);

Thanks for the example. I would still really like to see a detailed course on writing stored procedures.

Has treehouse built a course on writing Stored Procedures yet?

Is there a course on writing Stored Procedures yet ???

Kevin Gates
Kevin Gates
15,053 Points

While this is not a Treehouse Course, I took this PluralSight course on Stored Procedures and it is very good. I've found it to be fun, but also educational. I have a coworker who is very knowledgeable about stored procedures and this course is covering even the "gotchas" that he mentioned. Start here if you want to learn them, at least until Treehouse adds some courses: https://www.pluralsight.com/courses/sql-server-database-programming-stored-procedures

mahfoudhebkar2 , Krish Penumarty see above.