Variables used for database queries

LegacyForumLegacyForum Posts: 1,669 ✭✭
edited December 2016 in SOAtest
I use DataBases as datasources for all of my test. In a particular project I may have 50 of these. Our data is site specific, so my queries look like this:

select account_number, site_ID, WORK_ORDER_NUMBER, WO_STATUS, WO_TYPE, CHECK_IN_STATUS, ASSIGNED_INSTALLER
from con_work_order_master
where WO_STATUS = ' '
and CHECK_IN_STATUS = 'P'
and WO_TYPE = 'RS'


The con_work_order_master table, the 'con' (Connecticut) prefix may change from one test cycle to the next. Next month I may have to query san_work_order_master (San Diego). While the query is easy enough to change manually, The number of queries is getting so large that it is to time consuming. Is there any way to paramaeterize the query with some sort of SOA internal variable that I can change at run time, so that my query could look something like this?

SOA internal variable:

WorkOrderMasterTBL = san_work_order_master


select account_number, site_ID, WORK_ORDER_NUMBER, WO_STATUS, WO_TYPE, CHECK_IN_STATUS, ASSIGNED_INSTALLER
from WorkOrderMasterTBL
where WO_STATUS = ' '
and CHECK_IN_STATUS = 'P'
and WO_TYPE = 'RS'

Thanks for any ideas or input!


jamie
Tagged:

Comments

  • LegacyForumLegacyForum Posts: 1,669 ✭✭
    Hello,

    You should be able to use Environment Variables here.
    You could setup "WorkOrderMasterTBL" as an environment variable
    Then in the SQL query replace "con_work_order_master" with "${WorkOrderMasterTBL}" to use the environment variable

    More information on Environments and Environment Variables can be found in the SOAtest Documentation.

    ~Joe
  • LegacyForumLegacyForum Posts: 1,669 ✭✭
    edited January 2008
    Worked like a charm!!!!!!!!!!!!! Checks in the mail!
Sign In or Register to comment.