I would do a CHECK (trim(a) <> '')
TRIM() would add some processing time, so I'd include it only if there
was a chance of spaces getting added. From a puritanical point of
view, it is definitely a good idea.
To the original poster, this syntax should work in MySQL as well:
create table myt
On 22/02/07, Shashank Tripathi <[EMAIL PROTECTED]> wrote:
> I would do a CHECK (trim(a) <> '')
TRIM() would add some processing time, so I'd include it only if there
was a chance of spaces getting added. From a puritanical point of
view, it is definitely a good idea.
To the original poster, t
Zoltan Boszormenyi wrote:
I would do a CHECK (trim(a) <> '')
If you were ok with a string consisting soley of whitespace.
I meant NOT NULL CHECK(trim(a) <> ''), keeping the context of the
above example.
Right. I plead that it was late when i replied. I honestly don't know
what i was thi
On Thu, Feb 22, 2007 at 11:27:18AM +0100, Zoltan Boszormenyi wrote:
> >>I would do a CHECK (trim(a) <> '')
> >
> >Whitespaces are values too, you know.
>
> Yes, I know. But e.g. for a real people name, would you store
> accidentally entered spaces before or after the actual name, too?
> Which woul
CaT írta:
On Thu, Feb 22, 2007 at 09:13:13AM +0100, Zoltan Boszormenyi wrote:
Chris ?rta:
CaT wrote:
On Thu, Feb 22, 2007 at 01:08:04PM +1100, Chris wrote:
create table a(a text not null check (char_length(a) > 0));
What's wrrong with using
a <> ''
On Thu, Feb 22, 2007 at 09:13:13AM +0100, Zoltan Boszormenyi wrote:
> Chris ?rta:
> >CaT wrote:
> >>On Thu, Feb 22, 2007 at 01:08:04PM +1100, Chris wrote:
> >>>create table a(a text not null check (char_length(a) > 0));
> >>
> >>What's wrrong with using
> >>
> >>a <> ''
> >
> >Nothing, I just thoug
Zoltan Boszormenyi wrote:
Chris írta:
CaT wrote:
On Thu, Feb 22, 2007 at 01:08:04PM +1100, Chris wrote:
In postgres, to stop an empty blank string:
create table a(a text not null check (char_length(a) > 0));
What's wrrong with using
a <> ''
sd the check? Or is this just a flavour thin
Chris írta:
CaT wrote:
On Thu, Feb 22, 2007 at 01:08:04PM +1100, Chris wrote:
In postgres, to stop an empty blank string:
create table a(a text not null check (char_length(a) > 0));
What's wrrong with using
a <> ''
sd the check? Or is this just a flavour thing?
Nothing, I just thought of