Submit and vote on feature ideas.

Welcome to the new Parasoft forums! We hope you will enjoy the site and try out some of the new features, like sharing an idea you may have for one of our products or following a category.

Variables used for database queries

Options
LegacyForum
LegacyForum Posts: 1,664 ✭✭
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

  • LegacyForum
    LegacyForum Posts: 1,664 ✭✭
    Options
    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
  • LegacyForum
    LegacyForum Posts: 1,664 ✭✭
    edited January 2008
    Options
    Worked like a charm!!!!!!!!!!!!! Checks in the mail!

Tagged