when i exercise a choice in a contract
i want to make a db call and get the details based on the query, so that i will
create a new contract of another template based on the retrieved values.
To form a verifiable ledger model, it is not possible to interact with a SQL database, or any other external resource, directly from a Daml choice execution. See more details about what to do in this case in this previous answer: