Ticket #83 ( Pending Customer )

Short Description Parameterizing datasource
Entered By: intek When: 1998-07-04 13:48:00 Build: 1.03.07A
Categories Type: Question   Department: Product   Category: ODBC Support
Because queries are declared with their datasource it would seem that the datasource cannot be parameterized - I am looking for a way to pass in the datasource as a parameter so I don't have to have if/thens between separate queries for my test, dev, and production environments. Let me know the best way to handle this - Thanks Will Bechtel
Append By: WindSurfer  When: 1998-07-06 07:35:20  New Status: Pending Customer
Comment Would a registry setting work for this, or a environment variable?

How many databases are you connecting to? You only need one connection of each type per database, and these can all be grouped at the top of a single template file. The queries themselves would then consistently refer to same connection name, while the datasource specified in the connection would have the target changing between test through production.

Append By: intek  When: 1998-07-06 11:12:52  New Status: Pending IE
Comment What I am used to using is something like cold fusion where I set the datasource early as a variable and then all queries use the variable as the datasource name. I have 3 datasources (dev,test,prod) that have the exact same structure (so queries are exactly alike) but they require different datasources (which are declared at compile time yes?) Right now I have a bunch of 'if/then' statements calling the same queries with different DBSOURCES. Just looking for a better way than maintaining 3 queries where there should be 1 (they are alike except for datasource). PS - things are working well on the project, went live last week - screen surfer doing well. Should I be worried about the various warnings that come to the console? (Will TelNet Option type?) Thanks WIll
Append By: WindSurfer  When: 1998-07-06 11:44:28  New Status: Pending Customer
Comment Why don't you have one datasource that the queries all use consistently (without if/then), and when you need to change the level of the code, change the name you are referring to in the <TEDECLARE DBSOURCE> tag?

This gives you one tag to change, and is then very similar to changing a variable.

I'm not trying to obstruct what sounds to me like a good enhancement...just hoping to make sure you understand that the <TEDECLARE DBSOURCE> tag can be shared by multiple queries and that it is the best focal point for switching the database being used.

Along the lines of the enhancement, I do think I can give you the ability to specify datasource name as an expression, but ONLY if the expression is for a SERVER. variable (server scope) that has a data="literal" initializer in the <TEDECLARE of the server. variable.

Append By: intek  When: 1998-07-06 13:06:21  New Status: Pending IE
Comment I may need to call you - I am not sure I am getting it. No big deal at this point because the if/thens are working fine, just a 'clean-code' issue. I'll call sometime when things die down a bit. Thanks Will
Append By: WindSurfer  When: 1999-01-05 15:58:14  New Status: Pending Customer
Comment Can you please review the status of this ticket, and maybe now is a good time to renew discussion?

We still believe that by changing the database name in the DBSOURCE declaration, you then have one place to switch between dev/test/prod DB's.

Append By: intek  When: 1999-01-05 22:45:47  New Status: Pending IE
Comment We now have 30 people utilizing screen surfer at the same time. Each of them is scraping screens and running queries (inserting data). The queries are run against 3 databases, which are coded using separate DBSOURCES - a parameter passed to the screen surfer code determines what query to run (test, dev, prod). What we'd like now is more connections (maybe a connection pool?) I believe we're reaching the max number of users that can be supported using a single connection. I realize that we could create multiple DBSOURCEs, but when combined with the multiple environments (test,dev,prod) it gets really ugly. Please call me at (619) 610-6011 if you don't understand our problem. Thanks WILL BECHTEL (the real article)