Home » Developer & Programmer » Forms » NULL doesn't load any results
NULL doesn't load any results [message #163386] Thu, 16 March 2006 10:18 Go to next message
sephina
Messages: 14
Registered: March 2006
Junior Member
Hi. I am trying to show any DVD's that have never been ordered using the statement shown below. It shows that "no rows selected" even though there are DVD's that have not yet been purchased.

SELECT dd.Title, dd.Selling_Price, dd.Number_in_Stock
FROM dvd_details dd
JOIN order_details od
ON dd.dvd_id = od.dvd_id
WHERE od.DVD_ID is NULL;
Re: NULL doesn't load any results [message #163391 is a reply to message #163386] Thu, 16 March 2006 10:39 Go to previous messageGo to next message
Art Metzer
Messages: 2480
Registered: December 2002
Senior Member
Check out NOT EXISTS.
Re: NULL doesn't load any results [message #163392 is a reply to message #163386] Thu, 16 March 2006 10:43 Go to previous messageGo to next message
JSI2001
Messages: 1016
Registered: March 2005
Location: Scotland
Senior Member
Try

SELECT dd.Title, dd.Selling_Price, dd.Number_in_Stock
FROM dvd_details dd
left outer JOIN order_details od
ON dd.dvd_id = od.dvd_id
WHERE od.DVD_ID is NULL;


HTH
Jim
icon14.gif  Re: NULL doesn't load any results [message #163395 is a reply to message #163392] Thu, 16 March 2006 10:51 Go to previous messageGo to next message
sephina
Messages: 14
Registered: March 2006
Junior Member
THANK YOU!!! IT WORKS! Laughing
Re: NULL doesn't load any results [message #163397 is a reply to message #163395] Thu, 16 March 2006 10:53 Go to previous messageGo to next message
JSI2001
Messages: 1016
Registered: March 2005
Location: Scotland
Senior Member
Not sure if you took my suggestion or Art's, but if it was mine, make sure you try Art's too, it could well be faster for you.

Jim
Re: NULL doesn't load any results [message #163401 is a reply to message #163397] Thu, 16 March 2006 11:00 Go to previous messageGo to next message
sephina
Messages: 14
Registered: March 2006
Junior Member
I used yours (Jim) and it works okay so I think I'm gona try to solve my next problem. Thank you! Do you know how to use a query to run as a form that prompts the user for a value before bringing up the search results? Thanks again

Sephina
Re: NULL doesn't load any results [message #163402 is a reply to message #163401] Thu, 16 March 2006 11:05 Go to previous messageGo to next message
JSI2001
Messages: 1016
Registered: March 2005
Location: Scotland
Senior Member
What appllication are you using? iSQLPlus?, SQLPlus?


select * from table where column = &value;

will generate a prompt
Re: NULL doesn't load any results [message #163403 is a reply to message #163402] Thu, 16 March 2006 11:08 Go to previous messageGo to next message
sephina
Messages: 14
Registered: March 2006
Junior Member
I'm using iSQL Plus.. Thanks

Sephina
Re: NULL doesn't load any results [message #163404 is a reply to message #163403] Thu, 16 March 2006 11:09 Go to previous messageGo to next message
JSI2001
Messages: 1016
Registered: March 2005
Location: Scotland
Senior Member
No probs
You might also want to check out the documentation for ACCEPT and PROMPT

[Updated on: Thu, 16 March 2006 11:10]

Report message to a moderator

Re: NULL doesn't load any results [message #163405 is a reply to message #163403] Thu, 16 March 2006 11:10 Go to previous messageGo to next message
sephina
Messages: 14
Registered: March 2006
Junior Member
I'm using a Forms Builder. Whereabouts would I use that piece of coding? Is it coded within a button?

Thankyou
Sephina
Re: NULL doesn't load any results [message #163406 is a reply to message #163405] Thu, 16 March 2006 11:10 Go to previous messageGo to next message
JSI2001
Messages: 1016
Registered: March 2005
Location: Scotland
Senior Member
Best to direct that question to the forms forum.

Jim
Re: NULL doesn't load any results [message #163407 is a reply to message #163406] Thu, 16 March 2006 11:11 Go to previous message
sephina
Messages: 14
Registered: March 2006
Junior Member
Thanks Surprised) Will do!

Sephina Surprised)
Previous Topic: Oracle Form : SQL Loader
Next Topic: how to save and display image in oradev 6
Goto Forum:
  


Current Time: Fri Sep 20 07:25:50 CDT 2024