🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

Thread View: borland.public.interbase.sql
5 messages
5 total messages Started by Sergio Gonzalez Fri, 06 Dec 2002 13:24
BOOLEAN
#11167
Author: Sergio Gonzalez
Date: Fri, 06 Dec 2002 13:24
8 lines
1133 bytes
hello there,

How can I implement a Boolean field with InterBase 6.5 ?
I need it to be connected with a DBCheckBox.

Thanks.

Sergio
Re: BOOLEAN
#11168
Author: T Fehr
Date: Fri, 06 Dec 2002 14:08
15 lines
1560 bytes
Use a Char(1) field and put a check constraint on it so it will only allow
either a 'T' or 'F'.  You can also define it as NOT NULL and set the DEFAULT
to 'F'.  If you decide to create a DOMAIN for it don't call it BOOLEAN (I
use LOGICAL) or you will have problems migrating your database to newer
versions of IB.

CREATE DOMAIN LOGICAL AS
CHAR(1) CHARACTER SET ISO8859_1
DEFAULT 'F'
NOT NULL
CHECK (VALUE IN ('T', 'F'))
COLLATE ISO8859_1

Best Regards,
Terry Fehr
Re: BOOLEAN
#11170
Author: Woody (TMW)
Date: Fri, 06 Dec 2002 18:03
18 lines
1563 bytes
"T Fehr" <nospam@eliaswoodwork.com> wrote in message
news:3df0af6c$1@newsgroups.borland.com...
> Use a Char(1) field and put a check constraint on it so it will only allow
> either a 'T' or 'F'.  You can also define it as NOT NULL and set the
DEFAULT
> to 'F'.  If you decide to create a DOMAIN for it don't call it BOOLEAN (I
> use LOGICAL) or you will have problems migrating your database to newer
> versions of IB.
>

Also, make sure you define the true and false values for the TDBCheckbox
component.


--
Woody (TMW)

Drugs may lead to nowhere, but at least it's the scenic route.
Re: BOOLEAN
#11172
Author: Sergio Gonzalez
Date: Fri, 06 Dec 2002 19:26
11 lines
1250 bytes
thank you very much, Terry!!

> CREATE DOMAIN LOGICAL AS
> CHAR(1) CHARACTER SET ISO8859_1
> DEFAULT 'F'
> NOT NULL
> CHECK (VALUE IN ('T', 'F'))
> COLLATE ISO8859_1
>
> Best Regards,
> Terry Fehr
Re: BOOLEAN
#11174
Author: Craig Stuntz TeamB
Date: Fri, 06 Dec 2002 21:35
12 lines
1401 bytes
In article <3df0a5bb@newsgroups.borland.com>, shg@sion.com says...
> How can I implement a Boolean field with InterBase 6.5 ?
> 
	Note, also, that IB 7 supports true BOOLEAN columns.  

	-Craig

-- 
Craig Stuntz [TeamB] � Vertex Systems Corp. � Columbus, OH
Delphi/InterBase Weblog : http://delphi.weblogs.com
InterBase Perf. Monitor : http://delphi.weblogs.com/IBPerformanceMonitor
InterBase PLANalyzer 1.1: http://delphi.weblogs.com/IBPLANalyzer
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