ifnull

From: Joseph Shraibman <jks(at)p1(dot)selectacast(dot)net>
To: "pgsql-interfaces(at)postgreSQL(dot)org" <pgsql-interfaces(at)postgreSQL(dot)org>
Subject: ifnull
Date: 2000-03-09 05:51:28
Message-ID: 38C73BDF.B4C83976@selectacast.net
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-interfaces

Could someone tell me how to use ifnull? Whenever I try it postgres
tells me:

playpen=> insert into tabled (userkey, value) values (2, ifnull(null,
'c'));
ERROR: No such function 'ifnull' with the specified attributes

What I need it for is when I do an insert into my table like this:
playpen=> insert into tabled select max(userkey) + 1, 'texthere';
ERROR: ExecAppend: Fail to add null value in not null attribute userkey

... I get a problem when I'm inserting the first data into the table
because max returns null.

Browse pgsql-interfaces by date

  From Date Subject
Next Message Peter Mount 2000-03-09 07:57:07 RE: [INTERFACES] Type mappings
Previous Message youxiangmail 2000-03-09 03:26:28 A problem about psqlodbc.