ColdFusion Development
 
Forums: » Register « |  User CP |  Games |  Calendar |  Members |  FAQs |  Sitemap |  Support | 
User Name:
Password:
Remember me
Go Back   Dev Shed ForumsProgramming Languages - MoreColdFusion 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:
1200+ fellow developers rate and compare features of the top IDEs, like Visual Studio, Eclipse, RAD, Delphi and others, across 13 categories. Enjoy this FREE Download of the IDE User Satisfaction Study by Evans Data Corporation. Download Now!
  #1  
Old July 24th, 2004, 08:56 AM
coldfused_soul coldfused_soul is offline
Registered User
Dev Shed Newbie (0 - 499 posts)
 
Join Date: Jul 2004
Posts: 3 coldfused_soul User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: < 1 sec
Reputation Power: 0
database trouble

i have to design a search application. the data i have to check for is stored in two different oracle databases. after i get parts of the complete information from each database..i need to map them using the id of each record. this info is present in a third database.

ie. 1st db has: name and db1id
2nd db has: address and db2id
3rd db has: db1id mapped to the corresponding db2id

search based on name or address (or both) values entered by user.

looping of queries is not working. can someone tell me a way of doin this ??

thanks,
Regards.

Reply With Quote
  #2  
Old July 25th, 2004, 08:09 PM
kiteless kiteless is offline
Moderator
Dev Shed Expert (3500 - 3999 posts)
 
Join Date: Jun 2002
Location: Raleigh, NC
Posts: 3,627 kiteless User rank is Sergeant Major (2000 - 5000 Reputation Level)kiteless User rank is Sergeant Major (2000 - 5000 Reputation Level)kiteless User rank is Sergeant Major (2000 - 5000 Reputation Level)kiteless User rank is Sergeant Major (2000 - 5000 Reputation Level)kiteless User rank is Sergeant Major (2000 - 5000 Reputation Level)kiteless User rank is Sergeant Major (2000 - 5000 Reputation Level) 
Time spent in forums: 1 Week 4 Days 10 h 8 m 55 sec
Reputation Power: 53
Are these in different database tables or are these actually in separate database schemas?

Assuming separate tables, you'll want to use a join to relate the tables together, something like this:

select n.name, a.address
from name n, address a, name_address na
where
(n.name = '#form.nameSearchField#'
or a.address = '#form.addressSearchField#')
and n.nameID = na.nameID
and na.addressID = a.addressID
__________________
Ask if you have a question, but also help answer questions that you have knowledge of! Thanks, Brian.
How to Post a Question in the Forums

Reply With Quote
  #3  
Old July 29th, 2004, 02:33 PM
coldfused_soul coldfused_soul is offline
Registered User
Dev Shed Newbie (0 - 499 posts)
 
Join Date: Jul 2004
Posts: 3 coldfused_soul User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: < 1 sec
Reputation Power: 0
hi there
thanks a lot for the solution !! but the problem is that the data is in 3 separate databases and not just 3 tables.

cud u please tell me a way out ???

and i have a problem with passing a set of results of a query from one page to another in the form of a list . how do i go about it ???

Reply With Quote
  #4  
Old July 29th, 2004, 02:35 PM
coldfused_soul coldfused_soul is offline
Registered User
Dev Shed Newbie (0 - 499 posts)
 
Join Date: Jul 2004
Posts: 3 coldfused_soul User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: < 1 sec
Reputation Power: 0
hi there...
its me again !! im new to cf and really dont know much abt it !!
i jus wanted to know if using trim on a variable with a null value can cause trouble ??
i have a search applicn where the data cud come from simple search (name based) or an advanced search with lots of fields. so some parameters cud be defined or not depending on which type of search it is

so cud u please tell me how i shud go about with the query ???? am really gettin frustrated with it !!!

many thanks in advance !!!

Reply With Quote
  #5  
Old July 29th, 2004, 02:42 PM
kiteless kiteless is offline
Moderator
Dev Shed Expert (3500 - 3999 posts)
 
Join Date: Jun 2002
Location: Raleigh, NC
Posts: 3,627 kiteless User rank is Sergeant Major (2000 - 5000 Reputation Level)kiteless User rank is Sergeant Major (2000 - 5000 Reputation Level)kiteless User rank is Sergeant Major (2000 - 5000 Reputation Level)kiteless User rank is Sergeant Major (2000 - 5000 Reputation Level)kiteless User rank is Sergeant Major (2000 - 5000 Reputation Level)kiteless User rank is Sergeant Major (2000 - 5000 Reputation Level) 
Time spent in forums: 1 Week 4 Days 10 h 8 m 55 sec
Reputation Power: 53
CF treats null values as empty strings. So if you use trim on an empty string, you get an empty string. It doesn't do anything.

Reply With Quote
  #6  
Old July 29th, 2004, 02:43 PM
kiteless kiteless is offline
Moderator
Dev Shed Expert (3500 - 3999 posts)
 
Join Date: Jun 2002
Location: Raleigh, NC
Posts: 3,627 kiteless User rank is Sergeant Major (2000 - 5000 Reputation Level)kiteless User rank is Sergeant Major (2000 - 5000 Reputation Level)kiteless User rank is Sergeant Major (2000 - 5000 Reputation Level)kiteless User rank is Sergeant Major (2000 - 5000 Reputation Level)kiteless User rank is Sergeant Major (2000 - 5000 Reputation Level)kiteless User rank is Sergeant Major (2000 - 5000 Reputation Level) 
Time spent in forums: 1 Week 4 Days 10 h 8 m 55 sec
Reputation Power: 53
First, if the related data are in different schemas, you probably need to rethink your database design.

That said, you can prefix any table or field name with the name of the schema. So if you can do "schema1.table1" and "schema2.table2" in your FROM clause. This is how it works in Oracle.

Now if your data is actually in two totally separate databases, with totally separate datasource names, you can't do this in SQL. You'll have to query one datasource, then query the other datasource, and then write code that puts the data together, possibly using query of queries or the CFML query manipulation functions.

Reply With Quote
Reply

Viewing: Dev Shed ForumsProgramming Languages - MoreColdFusion Development > database trouble


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