Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Andrzejek on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Adding Database Name to Report Header 2

Status
Not open for further replies.

jwrjwr54

Technical User
Apr 21, 2003
41
US
I'm using CR XI with an ODBC Oracle connection.

Is there a way to add the Oracle Database name to the RH? For example, I have 3 Oracle databases (ERDDEV, ERDTEST, and ERDPROD). I would like to add 'Data Source:' and a field that would automatically update when I change datasource locations.

Many thanks
 
I don't have an Oracle db handy to test, but you can create a SQL expression to do this. In SQL Server it would be:

select db_name()

For Oracle, try:

select * from global_name


 
briangriffin, could you please expand on your solution in SQL? It would be very useful to have in Crystal, but when I try it, it gets rejected in both SQL Expression and SQL Command. I have Crystal 11.5.

[yinyang] Madawc Williams (East Anglia, UK). Using Crystal 10 & 11.5 with Windows XP [yinyang]
 
Its works for SQL 2008 and CR 10

Created SQL exp

%DB Name
(select db_name())

All OK.

Ian
 
A useful trick. I got it working as just
Code:
(select db_name())
I'd suppose that %DB Name is the field name

[yinyang] Madawc Williams (East Anglia, UK). Using Crystal 10 & 11.5 with Windows XP [yinyang]
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top