Need to populate two attributes from sql lookup

Discussion of open issues, suggestions and bugs regarding database management and development tools for SQL Server
Post Reply
rcclark
Posts: 1
Joined: Tue 08 Jan 2019 20:51

Need to populate two attributes from sql lookup

Post by rcclark » Tue 08 Jan 2019 21:09

Hello,

We have a need to populate two attributes in a table from two attributes in another table. I see how we can use the "SQL Query" or "Table or View" generators to populate a single attribute, but we have a need to populate two. Here is an example:

We have a codes table that has thousands of codes and subcodes describing everything from products to status'. We need to lookup and randomly populate the code and subcode in a table, however they have to correlate to each other. Like the following:

Code Subcode
PENDING | NEW SUBMISSION
PENDING | WAITING REVIEW
LOCKED | AWATING MANAGER OVERRIDE
ACTIVE | REVIEW COMPLETE

Currently if we use two "SQL Query" generators for the lookups we get codes that do not match up with the subcodes, for instance:

Lookup Code Lookup Subcode
PENDING | REVIEW COMPLETE
ACTIVE | WAITING REVIEW
PENDING | AWAITING MANAGER OVERRIDE

Unfortunately we cannot put these into a "Weighted List" as there is a third field which is used to determine which codes they are. That is why we would like to use a "SQL Query" to populate to attributes so that they match up correctly. Here's an example query:

select code, subcode from lookup_codes where code_list='APPLICATION STATUS'

I hope this is explained clear enough. Any help provided would be greatly appreciated.

Thanks,
Rob

alexa
Devart Team
Posts: 2595
Joined: Fri 24 Jun 2011 14:17

Re: Need to populate two attributes from sql lookup

Post by alexa » Wed 09 Jan 2019 14:07

Could you please provide us a sample of the database so we can provide you with a more precise answer?

Also, setting identical seed for both SQL query generators may help you.

You can send a reply straight to our support system at alexaATdevartDOTcom and supportATdevartDOTcom .

Post Reply