[Webinar] Learn how to a build a cloud-first strategyRegister Now

x
?
Solved

using select in postgresql function

Posted on 2009-02-13
1
Medium Priority
?
1,293 Views
Last Modified: 2012-05-06
how can i use select statement in postgresql function. When i place a select in, i get the error:

ERROR:  query has no destination for result data
HINT:  If you want to discard the results of a SELECT, use PERFORM instead.
0
Comment
Question by:danafire
1 Comment
 
LVL 22

Accepted Solution

by:
earth man2 earned 1500 total points
ID: 23639939
say table x has columns id and coly

create or replace function xx( arg1 int ) returns void as $$
declare
  x tablex.coly%TYPE;
begin
  select coly into x  from tablex where id = arg1;
end;
$$ language plpgsql;
0

Featured Post

NEW Veeam Agent for Microsoft Windows

Backup and recover physical and cloud-based servers and workstations, as well as endpoint devices that belong to remote users. Avoid downtime and data loss quickly and easily for Windows-based physical or public cloud-based workloads!

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

In this article, I’ll look at how you can use a backup to start a secondary instance for MongoDB.
Instead of error trapping or hard-coding for non-updateable fields when using QODBC, let VBA automatically disable them when forms open. This way, users can view but not change the data. Part 1 explained how to use schema tables to do this. Part 2 h…
Video by: Steve
Using examples as well as descriptions, step through each of the common simple join types, explaining differences in syntax, differences in expected outputs and showing how the queries run along with the actual outputs based upon a simple set of dem…
In this video, Percona Director of Solution Engineering Jon Tobin discusses the function and features of Percona Server for MongoDB. How Percona can help Percona can help you determine if Percona Server for MongoDB is the right solution for …
Suggested Courses

865 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question