SQL Query Help in $ListGet
Hi All,
I want to run an SQL like below
Select ID,Rollno,Marks,Name,Section,Teacher from Marks left outer join Student on Marks.StudentID=Student.ID
Now, the Student.ID is having the encrypted value which is not matching with Marks.StudentID (as this is clear value).
I can get the clear value using encrypted value as follow
^StoreValue("EncryptStudentID",Student.ID)=$LB("123"). That 123 is the clear Student.ID which I need to match in SQL query (ON clause).
Now I Need to fetch the data from sql query matching both clear values. Something like this
Select ID,Rollno,Marks,Name,Section,Teacher from Marks left outer join Student on Marks.StudentID=$LISTGet("EncryptStudentID",Student.ID). But this is giving me error. Is this possible to match the data using sql query or do we need to write an utility only ?
Comments
Maybe have a look at %Library.FunctionalIndex and look at the defining indexes section in the documentation for BuildValuesArray()
See the answers here.
In addition there are a few comments:
- you can use extrinsic function:
- you can use stored function: Defining and Using Stored Procedures
- you can encrypt the entire database, not just individual fields: Using Encrypted Databases
- you can restrict access to encrypted/sensitive fields to privileged users only: GRANT column-privilege