I have the following query:select p.portfolio, mt.textfrom [message] m join message_type mt on mt.id = m.message_type_id left join portfolio p on p.id = m.portfolio_id left join security s on s.id = m.security_id left join benchmark b on b.id = m.benchmark_id left join holding h on h.id = m.holding_id left join transactions t on t.id = m.transaction_idwhere mt.id = '2008'
Sample output:portfolio text9815T025020 Finished History Engine for portfolio ID %s.
looking to get output so that the text reads:Finished History Engine for portfolio ID 9815T025020another example would be:select p.portfolio, s.cusip, cast(getdate() as SMALLDATETIME), mt.textfrom [message] m join message_type mt on mt.id = m.message_type_id left join portfolio p on p.id = m.portfolio_id left join security s on s.id = m.security_id left join benchmark b on b.id = m.benchmark_id left join holding h on h.id = m.holding_id left join transactions t on t.id = m.transaction_idwhere mt.id = '2024'
output:portfolio cusip (No column name) text9861E084027 USD 2010-08-30 Portfolio ID: %s History Rule: 5160 - Principal Value of holding is zero for Security ID %s on %s.
would want it to read:Portfolio ID: 9861E084027 History Rule: 5160 - Principal Value of holding is zero for Security ID USD on 2010-08-30.any suggestion on how i can insert the values into the static txt data replacing the %s would be greatly appreciated