Home » RDBMS Server » Server Administration » How to check if column has value for LONG datatype?
How to check if column has value for LONG datatype? [message #370237] Fri, 16 April 1999 11:24 Go to next message
cmao
Messages: 3
Registered: April 1999
Junior Member
I need to select records are not null or not empty using SQL select statement . The column has LONG datatype. . The user can accidently put the Tab or white spaces and save into the column. Therefore, the column will not be null but with "something" there. I can use " columnA IS NOT NULL" to check if columnA is null or not, and it works okay. However, how do I check if columnA is has actual values?
Re: How to check if column has value for LONG datatype? [message #370238 is a reply to message #370237] Mon, 19 April 1999 17:25 Go to previous messageGo to next message
Eric
Messages: 78
Registered: April 1999
Member
Try this:

select column1
from table1
where column1 like '% %';

good luck,
eric
Re: How to check if column has value for LONG datatype? [message #370239 is a reply to message #370238] Tue, 20 April 1999 09:35 Go to previous messageGo to next message
cmao
Messages: 3
Registered: April 1999
Junior Member
I tried but got error message "inconsistent datatypes". Any other suggestions?
Re: How to check if column has value for LONG datatype? [message #370240 is a reply to message #370239] Wed, 21 April 1999 10:45 Go to previous messageGo to next message
Eric
Messages: 78
Registered: April 1999
Member
I looked 'long' up in my documentation and this is what I found:

LONG columns can store text, arrays of characters, or even short documents. You can reference LONG columns in UPDATE, INSERT, and (most) SELECT statements, but not in expressions, SQL function calls, or certain SQL clauses such as WHERE, GROUP BY, and CONNECT BY.

Is the data in these columns possibly small enough to use varchar2 instead of long?

good luck!

Eric
Re: How to check if column has value for LONG datatype? [message #370241 is a reply to message #370237] Wed, 21 April 1999 17:12 Go to previous messageGo to next message
Eric
Messages: 78
Registered: April 1999
Member
In my travels today I came across a page that explains how to get the length of a 'long' column using a pl/sql function.

http://www.flash.net/~darcre/ors.htm

Hope this helps.

Eric
Re: How to check if column has value for LONG datatype? [message #370242 is a reply to message #370241] Thu, 22 April 1999 09:11 Go to previous messageGo to next message
cmao
Messages: 3
Registered: April 1999
Junior Member
I looked at the script. It looks like I can use it. Thanks a lot for all your help.

Cheryl
Re: How to check if column has value for LONG datatype? [message #370885 is a reply to message #370241] Tue, 29 February 2000 10:49 Go to previous message
Mariette Miller
Messages: 1
Registered: February 2000
Junior Member
I have tried to go to the site specified and it is no longer valid. Is there a new site that will have the script.

http://www.flash.net/~darcre/ors.htm
Previous Topic: Re: make table name dynamic
Next Topic: Locks on Tables
Goto Forum:
  


Current Time: Wed Oct 28 07:13:39 CDT 2020