Answered

Need a command to generate a list of values (like SET_LIST does) that can be passed in a SQL query

Hello,

I am working with a SQL query that queries two different databases as follows.

Select appl_id from DB1.table1

where appl_id NOT in (select appl_id from DB2.table2);

So, I will have a test step where I will get list of appl_id from inner query (select appl_id from DB2.table2) and pass it onto outer query in a separate test step. 

Please let me know if you have a command that can do this or else, I would like to request for feature enhancement, if possible.

0
5 comments
Avatar
Joseph Hamdan

Hi Hemraj,

This is different for different databases, what database do you use?

Universal solution:

  1. Get Inner IDs via Set_List command (inner query you have)
  2. Run loop, that will unite all Set_List values into part of a query
  3. Run Set_List with outer query.

Here is a test case for you to understand how it works.

Regards,

Subject7 Team

0
Comment actions Permalink
Avatar
Hemraj Shahi

Hello,

Thank you for your  help but I am not able to extract the test case you have sent me. Could you please email me the test case directly to hemraj.shahi@nih.gov. Thank you.

0
Comment actions Permalink
Avatar
Joseph Hamdan

Hi Hemraj,

Were you able to download the file? If yes, then there's no need to extract the files manually. 

You can simply go to Test Library and click Import, then select the file and it will automatically import the test case in your account.

If this is not the case and you could not download it, please let me know and I will send you the file via email.

Regards,

Subject7 Team

0
Comment actions Permalink
Avatar
Hemraj Shahi

Hi,

I am able to download but not able to import properly. Could you please email me the files (unzipped)? Thank you.

0
Comment actions Permalink
Avatar
Joseph Hamdan

Hi,

What is the issue you are having with importing? Could you share a screenshot?

I cannot unzip the files because they are compressed for security reasons. Importing can only work on a compressed file such as the one I sent. If we can figure out what the issue you have with importing, that should do it.

Regards,

Subject7 Team

0
Comment actions Permalink

Please sign in to leave a comment.