Report Design
 Crystal Reports Forum : Crystal Reports 9 through 2022 : Report Design
Message Icon Topic: Selecting data fields from 2 databases? Post Reply Post New Topic
Author Message
cbaldwin
Groupie
Groupie


Joined: 09 Apr 2014
Online Status: Offline
Posts: 81
Quote cbaldwin Replybullet Topic: Selecting data fields from 2 databases?
    Posted: 08 Mar 2016 at 9:43am
I have 2 databases (DB1 and DB2).
I would like to select Donor_Draw.Visit_ID from DB2
with a left outer join to DB1.Donor_Queue on DB1.Donor_Queue.visit_id = DB2.Donor_Draw.Visit_ID.

I have tried...

Select
db1.donor_queue.visit_id,
db2.donor_draw.visit_id

From db1.donor_queue

inner join db2.donor_draw on db1.donor_queue.visit_id=db2.donor_draw.visit_id

I have not had success using this syntax.
Please advise.
CJB
IP IP Logged
DBlank
Moderator
Moderator


Joined: 19 Dec 2008
Online Status: Offline
Posts: 9053
Quote DBlank Replybullet Posted: 08 Mar 2016 at 10:01am
Are you creating a command?
otherwise you can just use the UI to select 2 tables, make the join on the field and set the join to an outer join.
You have to use fields form both tables or also set the join to enforced.
IP IP Logged
kevlray
Admin Group
Admin Group
Avatar

Joined: 29 Oct 2009
Online Status: Offline
Posts: 1587
Quote kevlray Replybullet Posted: 09 Mar 2016 at 3:16am
If the DB's are MS-SQL.  Then if you use fully qualified names for the databases, then it should work (in theory).  I have done it with one report some years ago (I had to google for an answer).
IP IP Logged
cbaldwin
Groupie
Groupie


Joined: 09 Apr 2014
Online Status: Offline
Posts: 81
Quote cbaldwin Replybullet Posted: 10 Mar 2016 at 6:03am
select *
from DDPR.DHQAPP.donor_queue dq
inner join EDPR.BBAPP.donor_draw dd on dq.visit_id = dd.visit_id


When I use this i get the following

Failed to retrieve data from database.
Details: ORA-00933: SQL command not properly ended
[Database Vendor Code:933]

Please provide any suggestions or insight.

Also how can i confirm the Proper name of my database?

IP IP Logged
kevlray
Admin Group
Admin Group
Avatar

Joined: 29 Oct 2009
Online Status: Offline
Posts: 1587
Quote kevlray Replybullet Posted: 11 Mar 2016 at 3:17am
That is an Oracle error, I would not know where to begin.
IP IP Logged
cbaldwin
Groupie
Groupie


Joined: 09 Apr 2014
Online Status: Offline
Posts: 81
Quote cbaldwin Replybullet Posted: 11 Mar 2016 at 3:54am
I was able to resolve my problem by using a DB link.
Thanks,
cjb
IP IP Logged
Post Reply Post New Topic
Printable version Printable version

Forum Jump
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot delete your posts in this forum
You cannot edit your posts in this forum
You cannot create polls in this forum
You cannot vote in polls in this forum



This page was generated in 0.031 seconds.