Skip site navigation (1) Skip section navigation (2)


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: (view raw, whole thread or download thread mbox)
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,
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.

pgsql-interfaces by date

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

Privacy Policy | About PostgreSQL
Copyright © 1996-2017 The PostgreSQL Global Development Group