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:
Get inside! Sample the range of functionality easily built with JMSL Library for Time Series Data Analysis, Heat Maps, Portfolio Optimization, Monte Carlo Simulation, Stock Price Charting and more. Download Now!
  #1  
Old May 2nd, 2008, 04:06 AM
poyntesm poyntesm is offline
Registered User
Dev Shed Newbie (0 - 499 posts)
 
Join Date: Mar 2006
Posts: 5 poyntesm User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: 2 h 4 m 25 sec
Reputation Power: 0
Query Assistance Required

Hello all,

I am looking for some query help.

I have two tables involved, so sounds nice and easy.

Table 1
------------------------------------------------------------------------------------------
Column Name | Constraint | Column Type | Description
condition_id | P | varchar2(36) | Key field to identify the condition.
text_id | N, F | varchar2(36) |Key field to identify the corresponding text
-------------------------------------------------------------------------------------------

Table2
------------------------------------------------------------------------------------------
Column Name | Constraint | Column Type | Description
text_id | N, U | varchar2(36) | Key field to identify the text.
order_number | N, U | number(5) |Order number of this text part.
text_part | U | varchar2(254) | Part of the text.
-------------------------------------------------------------------------------------------

My constraints are P for primary key, F for foreign key, N for NOT NULL & U for the unique column or the
combination of unique columns must be unique. Note, however, that all or some columns of the unique constraint may be NULL. NULL is considered for
uniqueness.

Basically each row from table1 might have an enter in table2. If it does have an entry and the text being stored is under 254 characters it will be in one part else its in two or more and joined based on the order number.

My question is how do I always return the text. In some cases it might have 20 characters and in others its 600.

So basically the text is split if its greater than 254 and stored in mutiple rows and I need a query to rejoin them all back together based on the condition_id and text_id.

Any help would be great.

Reply With Quote
  #2  
Old May 2nd, 2008, 07:13 AM
Ebot's Avatar
Ebot Ebot is offline
Meatball Surgeon
Dev Shed Beginner (1000 - 1499 posts)
 
Join Date: Jul 2004
Location: Elbow deep in code
Posts: 1,163 Ebot User rank is Brigadier General (60000 - 70000 Reputation Level)Ebot User rank is Brigadier General (60000 - 70000 Reputation Level)Ebot User rank is Brigadier General (60000 - 70000 Reputation Level)Ebot User rank is Brigadier General (60000 - 70000 Reputation Level)Ebot User rank is Brigadier General (60000 - 70000 Reputation Level)Ebot User rank is Brigadier General (60000 - 70000 Reputation Level)Ebot User rank is Brigadier General (60000 - 70000 Reputation Level)Ebot User rank is Brigadier General (60000 - 70000 Reputation Level)Ebot User rank is Brigadier General (60000 - 70000 Reputation Level)Ebot User rank is Brigadier General (60000 - 70000 Reputation Level)Ebot User rank is Brigadier General (60000 - 70000 Reputation Level)Ebot User rank is Brigadier General (60000 - 70000 Reputation Level)Ebot User rank is Brigadier General (60000 - 70000 Reputation Level)  Folding Points: 21605 Folding Title: Starter FolderFolding Points: 21605 Folding Title: Starter Folder
Time spent in forums: 1 Week 4 Days 3 h 34 m 39 sec
Reputation Power: 684
Just select the columns with some pipes "||" in between, that will make them one value. You could also use the concat() function, but using it for more than two values gets messy.
__________________
The liver is evil and must be punished!

Reply With Quote
Reply

Viewing: Dev Shed ForumsDatabasesOracle Development > Query Assistance Required


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 1 hosted by Hostway