🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

Article View: comp.lang.pascal.delphi.databases
Article #210

converting NULL to ANY value in a SELECT (local SQL)

#210
From: Mike Ryan
Date: Thu, 15 Jul 1999 00:00
22 lines
1514 bytes
I have a select in which I NEED to convert a NULL to ANY numeric value
e.g. 0, -1 ... whatever, I dont care, I just need a numeric value.

in the table temp, there is 2 fields a&b , the table contains records
where b is sometimes NULL, the data type of both fields are INT. There
is no way I can change the code so that NULL defaults to 0, it has to be
NULL.

I have tried

select a,cast(b as int) from temp

select a,1+cast(b as int) from temp

select a,length(cast(b as char)) from temp 

LENGTH seems to be a reserver word, but the query will not work with it.
It looks like there is no LENGTH function in local SQL (I DONT BELIEVE
IT!!!!!)

help,
Mike.
Technical Details
Message-ID: <378D66CA.AFA6936B@kc4.so-net.ne.jp>
Path: arc1-ca.pugleaf.net!unknown!not-for-mail

Show Full Headers
Complete Article Headers
X-Google-Language: ENGLISH,ASCII-7-bit
X-Google-Thread: fd817,f9ad5d8bc8693d8a,start
X-Google-Attributes: gidfd817,public
X-Google-Thread: f68c4,f9ad5d8bc8693d8a,start
X-Google-Attributes: gidf68c4,public
X-Google-Thread: ffff5,f9ad5d8bc8693d8a,start
X-Google-Attributes: gidffff5,public
X-Google-Thread: f973d,f9ad5d8bc8693d8a,start
X-Google-Attributes: gidf973d,public
From: Mike Ryan <mryan@kc4.so-net.ne.jp>
Subject: converting NULL to ANY value in a SELECT (local SQL)
Date: 1999/07/15
Message-ID: <378D66CA.AFA6936B@kc4.so-net.ne.jp>
X-Deja-AN: 501208454
Content-Transfer-Encoding: 7bit
Organization: So-net
X-Accept-Language: en
Content-Type: text/plain; charset=iso-2022-jp
Mime-Version: 1.0
Newsgroups: comp.lang.pascal.delphi.databases,corelsupport.paradox8,alt.comp.lang.borland-delphi,alt.lang.delphi