Oracle Development
 
Forums: » Register « |  User CP |  Games |  Calendar |  Members |  FAQs |  Sitemap |  Support | 
User Name:
Password:
Remember me
Go Back   Dev Shed ForumsDatabasesOracle Development

Reply
Add This Thread To:
  Del.icio.us   Digg   Google   Spurl   Blink   Furl   Simpy   Y! MyWeb 
Thread Tools Search this Thread Rate Thread Display Modes
 
Unread Dev Shed Forums Sponsor:
Stop making mediocre tutorials.The best tutorials are video! Camtasia Studio makes it easy to create engaging, buzz-building screen videos at any size, in any popular format. Download the free trial!
  #1  
Old September 20th, 2004, 01:55 PM
nvillare nvillare is offline
Registered User
Dev Shed Newbie (0 - 499 posts)
 
Join Date: Sep 2004
Posts: 4 nvillare User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: 41 m 33 sec
Reputation Power: 0
Need Help with Oracle report

I am trying to print a report using a table that has the primary key set up as an alphanumeric character. You can tyoe it as 'ABC123' or '123'. But this is giving me problems when trying to print a report based on this. If the user wants to print from '123-1' to '125-1' they are unable to do this because in between these numbers, because of the alphanumeric setup it would print 123-1,1230-1,124-1,1240-1,1241-1, 125-1. When all they want is 123-1,124-1,125-1.

Hope this makes sense. Here's is the code I am playing with.

SELECT A.SEGMENT1
FROM TABLE_NAME A
WHERE decode(rtrim(A.SEGMENT1,'0123456789'),NULL,to_number(A.SEGMENT1),-1)
BETWEEN
decode(rtrim(nvl(:P_req_num_from,A.SEGMENT1),'0123456789'),NULL,
to_CHAR(nvl(:P_req_num_from,A.SEGMENT1)),-1)
AND
decode(rtrim(nvl(:P_req_num_to,A.SEGMENT1),'0123456789'),NULL,
to_CHAR(nvl(:P_req_num_to,A.SEGMENT1 )),-1)

Any help is appreciated.

Reply With Quote
Reply

Viewing: Dev Shed ForumsDatabasesOracle Development > Need Help with Oracle report


Thread Tools  Search this Thread 
Search this Thread:

Advanced Search
Display Modes  Rate This Thread 
Rate This Thread:


Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
View Your Warnings | New Posts | Latest News | Latest Threads | Shoutbox
Forum Jump


Forums: » Register « |  User CP |  Games |  Calendar |  Members |  FAQs |  Sitemap |  Support | 
  
 





© 2003-2008 by Developer Shed. All rights reserved. DS Cluster 3 hosted by Hostway