🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

Thread View: borland.public.interbase.sql
2 messages
2 total messages Started by Dolleschall Richard Fri, 13 Dec 2002 09:30
CONVERT A NULL VALUE
#11114
Author: Dolleschall Richard
Date: Fri, 13 Dec 2002 09:30
11 lines
1306 bytes
a simple insert statement:
insert into mytest1 (id, text) values ((select max(id)+1 from mytest1),
'HALLO')

but if the table is empty this doent work because id is the primary key.

how can i convert the NULL result into a valid numic value.

(i dont want to use generators)

richard
Re: CONVERT A NULL VALUE
#11116
Author: Martijn Tonies
Date: Fri, 13 Dec 2002 10:15
30 lines
1649 bytes
Hi Richard,

> a simple insert statement:
> insert into mytest1 (id, text) values ((select max(id)+1 from mytest1),
> 'HALLO')

This isn't multi-user safe.

> but if the table is empty this doent work because id is the primary key.
> how can i convert the NULL result into a valid numic value.

NULL isn't a valid numerical value - it's a state, the state of "unknown".

> (i dont want to use generators)

Why not? This really is the best way to go.


--

With regards,

Martijn Tonies
InterBase Workbench - the developer tool for InterBase & Firebird
Firebird Workbench - the developer tool for Firebird
Upscene Productions
http://www.upscene.com

"This is an object-oriented system.
If we change anything, the users object."
Thread Navigation

This is a paginated view of messages in the thread with full content displayed inline.

Messages are displayed in chronological order, with the original post highlighted in green.

Use pagination controls to navigate through all messages in large threads.

Back to All Threads