Home » SQL & PL/SQL » SQL & PL/SQL » Checking Null values in column (merged 2) (Oracle 9i)
Checking Null values in column (merged 2) [message #430399] Tue, 10 November 2009 05:28 Go to next message
bishtoo
Messages: 20
Registered: August 2009
Junior Member
i have few master tables in my database.
Each master table has few records in it.
Now i have to display all the columns which have a null value and this needs to be done by checking each record in that table.
if there is any null value column for any row then it should be displyed.
How it can be done using pl sql block?
Re: Checking Null values in column [message #430401 is a reply to message #430399] Tue, 10 November 2009 05:29 Go to previous messageGo to next message
seyed456
Messages: 220
Registered: May 2008
Location: south india .
Senior Member

Before posting use search option.Its more common here since i joined.

[Updated on: Tue, 10 November 2009 05:29]

Report message to a moderator

Re: Null value in column [message #430404 is a reply to message #430399] Tue, 10 November 2009 05:35 Go to previous messageGo to next message
JRowbottom
Messages: 5933
Registered: June 2006
Location: Sunny North Yorkshire, ho...
Senior Member
Don't bother with pl/sql

SELECT *
FROM table
WHERE (col_1 is null or col_2 is null or col_3 is null....)
Re: Null value in column [message #430406 is a reply to message #430404] Tue, 10 November 2009 05:38 Go to previous messageGo to next message
bishtoo
Messages: 20
Registered: August 2009
Junior Member
Thanks is fine, but table name will be provided dynamically at runtime. Thus column names will not be fixed too..We need to create a report sort of thing where user will select table name from a drop down.
Re: Null value in column [message #430419 is a reply to message #430406] Tue, 10 November 2009 06:11 Go to previous messageGo to next message
Michel Cadot
Messages: 63818
Registered: March 2007
Location: Nanterre, France, http://...
Senior Member
Account Moderator
Use one query per table and select the appropriate one from the passed parameter. (As you said you have FEW tables.)

Regards
Michel
Re: Null value in column [message #430422 is a reply to message #430419] Tue, 10 November 2009 06:17 Go to previous messageGo to next message
bishtoo
Messages: 20
Registered: August 2009
Junior Member
It is easy to find out which column has a null value in a table; but i need information record wise like, empid 'E1' has a null value in 'salary' column ..etc.
Re: Null value in column [message #430424 is a reply to message #430406] Tue, 10 November 2009 06:18 Go to previous messageGo to next message
ramoradba
Messages: 2454
Registered: January 2009
Location: AndhraPradesh,Hyderabad,I...
Senior Member
bishtoo wrote on Tue, 10 November 2009 05:38
Thanks is fine, but table name will be provided dynamically at runtime. Thus column names will not be fixed too..We need to create a report sort of thing where user will select table name from a drop down.



Which reporting tool you are using?

Sriram.
Re: Null value in column [message #430461 is a reply to message #430422] Tue, 10 November 2009 08:25 Go to previous message
Frank
Messages: 7880
Registered: March 2000
Senior Member
- How do you know which column contains the identifier value?
- Do you need to list all null-columns for a record?
- If so, should the be returned in a single line?
Previous Topic: Query
Next Topic: Question on methodology
Goto Forum:
  


Current Time: Sat Oct 01 10:56:57 CDT 2016

Total time taken to generate the page: 0.05202 seconds