let's say you have the name of a table in a string.

        'mytable'

you also have field names, such as

        'lookupfield' 'valuefield'

which would be assembled like this

        select valuefield from mytable where lookupfield = '?'

is there a way to write sql/plpgsql that'll take a varchar
argument (table and field names) and be able to turn it into the
appropriate query?

i can see pg_class contains table info and pg_attribute has info
for the fields ... is there a way (oids maybe?) to direct
postgres to the right table for a search, given the name of the
table in a varchar string? (and if so, how? :)

-- 
It is always hazardous to ask "Why?" in science, but it is often
interesting to do so just the same.
                -- Isaac Asimov, 'The Genetic Code'

[EMAIL PROTECTED]
http://newbieDoc.sourceforge.net/ -- we need your brain!
http://www.dontUthink.com/ -- your brain needs us!

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

http://www.postgresql.org/users-lounge/docs/faq.html

Reply via email to