Cache SQL question
I have a table with 4 column: MRN (primary key), Name, DOB, and Gender. I want to bring in the values on all of the columns into a DTL. Currently, I declare variables for each of the columns and using 3 select statements.
&sql(SELECT Name INTO :Name FROM osuwmc_RQGPatient.DataTable WHERE MRN=:MRN)
&sql(SELECT DOB INTO :DOB FROM osuwmc_RQGPatient.DataTable WHERE MRN=:MRN)
&sql(SELECT Gender INTO :Gender FROM osuwmc_RQGPatient.DataTable WHERE MRN=:MRN)
Is there a way to do this in a single select statement?
Comments
This can be achieved by changing your SQL statement into this:
&sql(SELECT Name, DOB, Gender INTO :Name,:DOB,:Gender FROM osuwmc_RQGPatient.DataTable WHERE MRN=:MRN)
Thank you all.
&sql(SELECT Name, DOB, Gender INTO :Name, :DOB, :Gender FROM osuwmc_RQGPatient.DataTable WHERE MRN=:MRN)see: https://cedocs.intersystems.com/latest/csp/docbook/Doc.View.cls?KEY=RSQL_into
&sql(SELECT Name, DOB, Gender INTO :Name,:DOB,:Gender
FROM osuwmc_RQGPatient.DataTable WHERE MRN=:MRN)