Hi.
I have two predefined tables: Errors and Transactions. Columns in Errors table are Transaction ID, Error Code, Error Column, Error Message. Columns in Transactions table are Transaction ID, Quantity, Unit Price, Approval, etc.
I would like (one) SQL statement that will look up all the error transactions from Errors Table and depending on what column name is stored in Errors Column Name get the value of the respective column from Transactions table.
For example, if Errors table contain a record with Errors Column Name = 'Unit Price' then I would like whatever value is stored in the respective record in column name Unit Price from Transactions table. If the value in Errors Error Column Name = 'Approval' then the respective Transactions record's Approval value should be displayed.
Would appreciate any help. Thanks.
Chadi
I have two predefined tables: Errors and Transactions. Columns in Errors table are Transaction ID, Error Code, Error Column, Error Message. Columns in Transactions table are Transaction ID, Quantity, Unit Price, Approval, etc.
I would like (one) SQL statement that will look up all the error transactions from Errors Table and depending on what column name is stored in Errors Column Name get the value of the respective column from Transactions table.
For example, if Errors table contain a record with Errors Column Name = 'Unit Price' then I would like whatever value is stored in the respective record in column name Unit Price from Transactions table. If the value in Errors Error Column Name = 'Approval' then the respective Transactions record's Approval value should be displayed.
Would appreciate any help. Thanks.
Chadi