By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
437,903 Members | 1,104 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 437,903 IT Pros & Developers. It's quick & easy.

function call

P: n/a
Hi,

Would anyone able to advise how can I call a function/Stored procedure? what command to issue?

Thanks.


Best Regards

_______________________

Joseph Keow
Nov 11 '05 #1
Share this Question
Share on Google+
1 Reply


P: n/a
create or replace function test(integer) returns boolean as '
declare
number alias for $1;
begin
if number = 0 then
return false;
else
return true;
end if;
end;' language 'plpgsql';

to call the function you can

SELECT test(1);

or can do

SELECT user_id,
user_name,
test(user_id) AS test
FROM users

or you can call from another function or from code.

Depending on where you wish to call the function / sp.

HTH
Darren

On Mon, 15 Sep 2003, Keow Yeong Huat Joseph wrote:
Hi,

Would anyone able to advise how can I call a function/Stored procedure? what command to issue?

Thanks.
Best Regards

_______________________

Joseph Keow


--
Darren Ferguson
---------------------------(end of broadcast)---------------------------
TIP 2: you can get off all lists at once with the unregister command
(send "unregister YourEmailAddressHere" to ma*******@postgresql.org)

Nov 11 '05 #2

This discussion thread is closed

Replies have been disabled for this discussion.