Home » Developer & Programmer » Forms » null value not passing
null value not passing [message #527444] Tue, 18 October 2011 02:56 Go to next message
usmanelahi
Messages: 54
Registered: July 2007
Location: Karachi
Member
Dear Sir,

I am trying to pass null value '' in form but still failed

---SQL---
select distinct column1 from abc
Y
NULL
two records found.

---FORM---
I have a list item name user_pick which is in two values SOUND-Y, DAMAGE-'' passing null value

--BUTTON--
select count(column1) into A from abc
where column1=:user_pick;

when user pick from list SOUND it is ok
When user pick damage this will show 0 means null value are not passing correctly how to solve it.

i also tried in radio group,check box

Thanks

Re: null value not passing [message #527446 is a reply to message #527444] Tue, 18 October 2011 03:00 Go to previous messageGo to next message
Littlefoot
Messages: 21817
Registered: June 2005
Location: Croatia, Europe
Senior Member
Account Moderator
That might be because - when NULL is in game - you can't use
where column1 = :user_pick
as it should be
where column1 is null

So, what to do? One option might be to choose a value that is not likely to appear in your table (XYZ), and use it as
where nvl(column1, 'XYZ') = nvl(:user_pick, 'XYZ')
Re: null value not passing [message #527452 is a reply to message #527446] Tue, 18 October 2011 03:25 Go to previous messageGo to next message
usmanelahi
Messages: 54
Registered: July 2007
Location: Karachi
Member
where column1 is null only show null records if user need not null records or Sound-Y ?

I TRIED THIS but failed where nvl(column1, '') = nvl(:user_pick, '')
Re: null value not passing [message #527457 is a reply to message #527452] Tue, 18 October 2011 03:30 Go to previous messageGo to next message
cookiemonster
Messages: 13931
Registered: September 2008
Location: Rainy Manchester
Senior Member
That's because
''
is null.
You've nvl'd a null to null. You have to nvl it to something other than ''.

[Updated on: Tue, 18 October 2011 03:31]

Report message to a moderator

Re: null value not passing [message #527467 is a reply to message #527457] Tue, 18 October 2011 04:00 Go to previous message
usmanelahi
Messages: 54
Registered: July 2007
Location: Karachi
Member
Thank you so much little and cookie its work fine
Previous Topic: trying java calendar!! need some help!!
Next Topic: stack canvas hides while validation of any item is failed on the form
Goto Forum:
  


Current Time: Sun Aug 11 09:17:52 CDT 2024