IWETHEY v. 0.3.0 | TODO
1,095 registered users | 0 active users | 0 LpH | Statistics
Login | Create New User
IWETHEY Banner

Welcome to IWETHEY!

New postgres 'perform' vs 'select'
The docs imply that if I want to call a function and ignore what it returns I can say

perform foo();

instead of

select foo();

this seems to be the solution to wanting to have a stored procedure sort of thing that doesn't return anything. You declare a function and then ignore its return value with perform. This would seem to be the solution to my problem of doing something like

statement.executeUpdate("select foo()");

throwing an exception that whines about a result set being created.

Problem is, it doesn't seem to work from the regular sql interpreter (or when called from jdbc). I get "syntax error at 'perform'" or something similar.

Why is this in the docs if it doesn't work? Or am I using it wrong?

postgres 7.4 is the version I'm using.


The tree of research must from time to time be refreshed with the blood of bean counters.
     -- Alan Kay
New Perform is plpgsql, select is SQL
Same as Oracle... there are plenty of things you can do in PL/SQL that you can't do in regular SQL.
Regards,

-scott anderson

"Welcome to Rivendell, Mr. Anderson..."
New Is there no equivalent to void function then?
Looks like I'll have to change my calling code otherwise.


The tree of research must from time to time be refreshed with the blood of bean counters.
     -- Alan Kay
New Er.... yeah.
Just do "RETURNS void"... :-D
Regards,

-scott anderson

"Welcome to Rivendell, Mr. Anderson..."
     postgres 'perform' vs 'select' - (tuberculosis) - (3)
         Perform is plpgsql, select is SQL - (admin) - (2)
             Is there no equivalent to void function then? - (tuberculosis) - (1)
                 Er.... yeah. - (admin)

Is that a Dune reference?
62 ms