Sign In Start Free Trial
Account

Add to playlist

Create a Playlist

Modal Close icon
You need to login to use this feature.
  • Book Overview & Buying PostgreSQL Server Programming
  • Table Of Contents Toc
PostgreSQL Server Programming

PostgreSQL Server Programming - Second Edition

By : Usama Dar, Hannu Krosing, Jim Mlodgenski, Kirk Roybal
4.5 (8)
close
close
PostgreSQL Server Programming

PostgreSQL Server Programming

4.5 (8)
By: Usama Dar, Hannu Krosing, Jim Mlodgenski, Kirk Roybal

Overview of this book

This book is for moderate to advanced PostgreSQL database professionals who wish to extend PostgreSQL, utilizing the most updated features of PostgreSQL 9.4. For a better understanding of this book, familiarity with writing SQL, a basic idea of query tuning, and some coding experience in your preferred language is expected.
Table of Contents (16 chapters)
close
close
15
Index

Accessing databases

PL/Tcl functions provide you with SPI functions to access the database and run DML/DDL statements.

The functions are the following:

  • spi_exec: This executes a SQL statement
  • spi_prepare: This prepares a SQL statement
  • spi_execp: This executes a prepared statement

The spi_exec function has the following syntax:

spi_exec ?-count n? ?-array name? command ?loop-body?

The spi_exec function runs a SQL statement, and it takes some optional parameters, as follows:

  • -count: This parameter allows you to specify the maximum number of rows processed by the command. If you provide the value 3, only 3 rows will be processed. This is similar to specifying FETCH [n] in a cursor.
  • -array: If this parameter is specified, the column values are stored into a named associative array and the column names are used as array indexes. If this parameter is not specified, the result values are stored in the Tcl variables of the same name.

If there is a loop body specified, then it is...

CONTINUE READING
83
Tech Concepts
36
Programming languages
73
Tech Tools
Icon Unlimited access to the largest independent learning library in tech of over 8,000 expert-authored tech books and videos.
Icon Innovative learning tools, including AI book assistants, code context explainers, and text-to-speech.
Icon 50+ new titles added per month and exclusive early access to books as they are being written.
PostgreSQL Server Programming
notes
bookmark Notes and Bookmarks search Search in title playlist Add to playlist font-size Font size

Change the font size

margin-width Margin width

Change margin width

day-mode Day/Sepia/Night Modes

Change background colour

Close icon Search
Country selected

Close icon Your notes and bookmarks

Confirmation

Modal Close icon
claim successful

Buy this book with your credits?

Modal Close icon
Are you sure you want to buy this book with one of your credits?
Close
YES, BUY

Submit Your Feedback

Modal Close icon
Modal Close icon
Modal Close icon