Wrox Programmer Forums
Go Back   Wrox Programmer Forums > Database > Oracle
| Search | Today's Posts | Mark Forums Read
Oracle General Oracle database discussions.
Welcome to the p2p.wrox.com Forums.

You are currently viewing the Oracle section of the Wrox Programmer to Programmer discussions. This is a community of software programmers and website developers including Wrox book authors and readers. New member registration was closed in 2019. New posts were shut off and the site was archived into this static format as of October 1, 2020. If you require technical support for a Wrox book please contact http://hub.wiley.com
 
Old February 23rd, 2009, 09:55 AM
Registered User
 
Join Date: Aug 2007
Location: , , .
Posts: 8
Thanks: 0
Thanked 0 Times in 0 Posts
Default Available numbers not in a range

Hi,
I have a Oracle 8 table with a varchar(3) primary key field that contains the numbers in the range from 0 to 999. Not all numbers are used in this range.

I need to present the user with a list of number that haven't been taken.

What is the most efficient way of doing this

Thanks

e.g.
CourseNo
001
002
003
004
008
010

Present user with
005
006
007
009
 
Old March 5th, 2009, 05:05 AM
Authorized User
 
Join Date: Nov 2006
Location: Bangalore, Karnataka, India.
Posts: 31
Thanks: 0
Thanked 3 Times in 3 Posts
Send a message via ICQ to debasisdas Send a message via AIM to debasisdas
Default

the following is a simple solution.

Code:
select rownum from dba_tab_cols where rownum <=1000
minus
select code_num from table1
better to write a procedure for the purpose.
__________________
Regards
Debasis




Similar Threads
Thread Thread Starter Forum Replies Last Post
Factorial of numbers 1 to 5 sivakak BOOK: Beginning PHP4/PHP 5 ISBN: 978-0-7645-4364-7; v5 ISBN: 978-0-7645-5783-5 0 May 24th, 2007 08:42 AM
Page Numbers Jacky Kenna Forum and Wrox.com Feedback 0 June 7th, 2005 02:04 PM
Concatenate numbers fs22 Javascript 1 April 25th, 2004 06:51 AM
Rounding Numbers ashley_y VB How-To 2 February 3rd, 2004 06:06 AM
formating numbers renee_santoscoi Visual C++ 0 December 8th, 2003 06:00 PM





Powered by vBulletin®
Copyright ©2000 - 2020, Jelsoft Enterprises Ltd.
Copyright (c) 2020 John Wiley & Sons, Inc.