Question Viroj (Pat) Padyandorn · Jun 9, 2020

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

Sridhar Mandalapu · Jun 9, 2020

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)

0
Eduard Lebedyuk · Jun 9, 2020
&sql(SELECT Name, DOB, Gender INTO :Name, :DOB, :Gender FROM osuwmc_RQGPatient.DataTable WHERE MRN=:MRN)
0