Search Postgresql Archives

Re: in query variables....

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



> 
> Hi all,
> 
> this is from the is there a way file.
> Is there a way to get the name of the relation or relations in a query
> from within the query?  Like some kind of magic variable...?
> for example :
>               "select *,  from thistable"
> where  would be replaced by thistable.
> 
> 
> Rhys
> Peace & Love|Live Long & Prosper
> 

No as far as I know, but you can create a stored procedure and pass
as parameter the table and then "create" your own query and
execute it from within the stored procedure

http://www.postgresql.org/docs/8.2/static/plpgsql-statements.html

EXECUTE 'UPDATE '|| some_magic_variable || ' SET '
        || quote_ident(colname)
        || ' = '
        || quote_literal(newvalue)
        || ' WHERE key = '
        || quote_literal(keyvalue);

I haven't tried it thought.
_________________________________________________________________
Tenemos lo que búscas…JUEGOS.
http://club.prodigymsn.com/ 

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Index of Archives]     [Postgresql Jobs]     [Postgresql Admin]     [Postgresql Performance]     [Linux Clusters]     [PHP Home]     [PHP on Windows]     [Kernel Newbies]     [PHP Classes]     [PHP Books]     [PHP Databases]     [Postgresql & PHP]     [Yosemite]
  Powered by Linux