Search Postgresql Archives

Re: Pl/pgsql function

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

 





Nick Raj wrote:
I am implementing some pl/pgsql functions.

Is there any way to change the input
for example- I got some value by $1. I want to modify this value (means split that value), Can we do this and how?

Second thing,
Suppose i defined a function test as

select test('geom',the_geom,time) from tablename
.....
Inside body,
How can i get the tablename inside the body (because i haven't pass table name to function)
......
end
If 'tablename' has to change then you need to take a look at "dynamic sql" and the EXECUTE construct.

You can surely manipulate the value of $1 into either other variables or define it as on OUT parameter if you want the caller to get a different value back. The 8.3 chapter on this is here <http://www.postgresql.org/docs/8.3/static/plpgsql-statements.html#PLPGSQL-STATEMENTS-ASSIGNMENT>

--
Sent via pgsql-general mailing list (pgsql-general@xxxxxxxxxxxxxx)
To make changes to your subscription:
http://www.postgresql.org/mailpref/pgsql-general


[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