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 gkittelson on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Specify ODBC database in RD @ runtime?

Status
Not open for further replies.

cgv

IS-IT--Management
Aug 19, 2002
48
US
Greetings.

I am trying to specify which ODBC database to use in generating a report...ideally via a user parameter. Note the ODBC datasource is not changing - I dont want to have to create a seperate datasource for every database we have.

I can remove the DB name & owner from the report just fine... however I cant figure out how to make the query accept a variable database name. This example works fine:

SELECT
PA01201."PAprojname", PA01201."PAPROJNUMBER"
FROM
"DATA1"."dbo". "PA01201" PA01201

as does this:

SELECT
PA01201."PAprojname", PA01201."PAPROJNUMBER"
FROM
"DATA2"."dbo". "PA01201" PA01201


however.. this does not:

SELECT
PA01201."PAprojname", PA01201."PAPROJNUMBER"
FROM
{?db_parm}."dbo". "PA01201" PA01201


any idea how this can be done without using the RDC?

Thanks!
 
You can use a stored procedure to generate a temporary table with the relavent information in it. you can pass the table name to the procedure and then have it fill the temporary table.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top