[SQL] Null set

2001-07-02 Thread Wei Weng

This is a function I am working on:

CREATE FUNCTION authenticate(int4) RETURN boolean
AS 
'SELECT * INTO tmp FROM user WHERE user_id = id;
if SET_IS_NULL(tmp)
return false;
else
return true;'
LANGUAGE 'sql';

My question is: Is there a way to implement the SET_IS_NULL function in
pl/pgsql? 

 

-- 
Wei Weng
Network Software Engineer
KenCast Inc.



---(end of broadcast)---
TIP 3: if posting/reading through Usenet, please send an appropriate
subscribe-nomail command to [EMAIL PROTECTED] so that your
message can get through to the mailing list cleanly



[SQL] How do I print a message in a function?

2001-07-02 Thread Wei Weng

I did something like

create function test() returns integer as
'
declare
msg varchar;
begin
msg := "test";
RAISE NOTICE "message is " || msg;
end'
language 'plpgsql';

The function compiled without any error, however, when I tried to run it
as select test(); it broke down with an error message " Unterminated " "

Can anyone help me on this?

Thanks!


-- 
Wei Weng
Network Software Engineer
KenCast Inc.



---(end of broadcast)---
TIP 1: subscribe and unsubscribe commands go to [EMAIL PROTECTED]