Unix Technical Forum

Generic/Ad-Hoc Select Function

This is a discussion on Generic/Ad-Hoc Select Function within the pgsql Novice forums, part of the PostgreSQL category; --> I am new to Postgresql and was wondering if it is possible to create an ad-hoc select query function, ...


Go Back   Unix Technical Forum > Database Server Software > PostgreSQL > pgsql Novice

Register FAQ Members List Calendar Search Today's Posts Mark Forums Read
  #1 (permalink)  
Old 04-17-2008, 09:55 PM
Roy W Bradley
 
Posts: n/a
Default Generic/Ad-Hoc Select Function

I am new to Postgresql and was wondering if it is possible to create an ad-hoc select query function, where the table name, and the where clause were passed to the function and it returned a result set for the table?

Thanks
Roy

Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
  #2 (permalink)  
Old 04-17-2008, 09:55 PM
Terry Lee Tucker
 
Posts: n/a
Default Re: Generic/Ad-Hoc Select Function

On Saturday 03 June 2006 02:17 pm, "Roy W Bradley" <rbradley@fusiion.com> thus
communicated:
--> I am new to Postgresql and was wondering if it is possible to create an
ad-hoc select query function, where the table name, and the where clause
were passed to the function and it returned a result set for the table? -->
--> Thanks
--> Roy
-->

You can generate dynamic SELECT statements. See the docs at:
http://www.postgresql.org/docs/8.1/s...-EXECUTING-DYN

---------------------------(end of broadcast)---------------------------
TIP 1: if posting/reading through Usenet, please send an appropriate
subscribe-nomail command to majordomo@postgresql.org so that your
message can get through to the mailing list cleanly

Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
  #3 (permalink)  
Old 04-17-2008, 09:55 PM
Bruno Wolff III
 
Posts: n/a
Default Re: Generic/Ad-Hoc Select Function

On Sat, Jun 03, 2006 at 11:17:45 -0700,
Roy W Bradley <rbradley@fusiion.com> wrote:
> I am new to Postgresql and was wondering if it is possible to create an ad-hoc select query function, where the table name, and the where clause were passed to the function and it returned a result set for the table?


Yes. You should be able to do this in most of not all of the PLs. A good
start is to read this:
http://developer.postgresql.org/docs...-EXECUTING-DYN

---------------------------(end of broadcast)---------------------------
TIP 3: Have you checked our extensive FAQ?

http://www.postgresql.org/docs/faq

Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
Reply


Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On
Forum Jump


All times are GMT. The time now is 05:40 AM.


Powered by vBulletin® Version 3.6.5
Copyright ©2000 - 2008, Jelsoft Enterprises Ltd.
SEO by vBSEO 3.2.0
www.UnixAdminTalk.com