[SQL] oracle decode()

2004-03-03 Thread Andreas Schmitz
Hello, is there any equivalent for ORACLEs decode() in pl/pgsql ? regards, -Andreas -- ---(end of broadcast)--- TIP 6: Have you searched our list archives? http://archives.postgresql.org

Re: [SQL] oracle decode()

2004-03-03 Thread Richard Huxton
On Wednesday 03 March 2004 10:48, Andreas Schmitz wrote: > Hello, > > is there any equivalent for ORACLEs decode() in pl/pgsql ? Is that the function that works like CASE? CASE WHEN x=1 THEN 'ONE' WHEN x=2 THEN 'TWO' END See the reference manual for syntax (conditional functions/operators iirc).

[SQL] Encoding bytea

2004-03-03 Thread Achilleus Mantzios
Hi, is there a way to encode a bytea in such a way that the resulting text stream be readily available (\\ escaped for unprintable chars) for usage in an insert statement? None of base64,hex,escape options in encode() seem to produce anything close. This is meant to be used with generating inser

Re: [SQL] Encoding bytea

2004-03-03 Thread Joe Conway
Achilleus Mantzios wrote: is there a way to encode a bytea in such a way that the resulting text stream be readily available (\\ escaped for unprintable chars) for usage in an insert statement? None of base64,hex,escape options in encode() seem to produce anything close. This is meant to be used

[SQL] calling function

2004-03-03 Thread William Anthony Lim
Hi, I have a little trouble. I'm newbie in postgresql. Consider this function example: create or replace function testcall(int4,varchar,bool,int2) return setof record as ' declare r record; a int4; b varchar; c bool; d int2; begin a=$1; b=$2

Re: [SQL] calling function

2004-03-03 Thread Tom Lane
"William Anthony Lim" <[EMAIL PROTECTED]> writes: > create or replace function testcall(int4,varchar,bool,int2) return setof record as ' > ... > select * from testcall(12,'ABCD',true,2); > ERROR: function testcall(integer, "unknown", boolean, integer) does not exist An undecorated integer con