aaronthesoftwaremechanic Posted March 7 Report Share Posted March 7 (edited) I am using swagger, and performing get , for records, in the q.where (where clause) field, if i put PK_ID=156 (156 is row number) (code looks like this) /rest/v2/tables/{myTable}/recordsq.where=?q.where=PK_ID%3D156 and execute, the resposne is 200 with, { "Result": [ { "PK_ID": 156, "created_by": "", "last_modified_by": "", "submitted_by": "", "patient_id": "mySpecABCD" } ] } however, i want to do where patient_id = mySpecABCD i change the q.where to patient_id="mySpecABCD" /rest/v2/tables/{myTable}/recordsq.where=?q.where=patient_id%3DmySpecABCD i receive error stating "Code": "SqlServerError", "Message": "Invalid column name 'mySpecABCD' i add additional quotations "Code": "SqlServerError", "Message": "Invalid column name ''mySpecABCD'' what am i doing wrong? Edited March 7 by aaronthesoftwaremechanic error Quote Link to comment Share on other sites More sharing options...
0 aaronthesoftwaremechanic Posted March 7 Author Report Share Posted March 7 patient_id='mySpecABCD' is what was needed. Quote Link to comment Share on other sites More sharing options...
0 CoopperBackpack Posted March 7 Report Share Posted March 7 Hello @aaronthesoftwaremechanic, This is correct, when using the text values, please use single quotes. In most cases, text values are used in the WHERE clause. Also, to get the expected result one should be careful with extra spaces before / after the text value. Quote Link to comment Share on other sites More sharing options...
Question
aaronthesoftwaremechanic
I am using swagger, and performing get , for records,
in the q.where (where clause) field, if i put
PK_ID=156
(156 is row number)
(code looks like this)
/rest/v2/tables/{myTable}/recordsq.where=?q.where=PK_ID%3D156
and execute, the resposne is 200 with,
{
"Result": [
{
"PK_ID": 156,
"created_by": "",
"last_modified_by": "",
"submitted_by": "",
"patient_id": "mySpecABCD"
}
]
}
however, i want to do where patient_id = mySpecABCD
i change the q.where to
patient_id="mySpecABCD"
/rest/v2/tables/{myTable}/recordsq.where=?q.where=patient_id%3DmySpecABCD
i receive error stating
"Code": "SqlServerError",
"Message": "Invalid column name 'mySpecABCD'
i add additional quotations
"Code": "SqlServerError",
"Message": "Invalid column name ''mySpecABCD''
what am i doing wrong?
error
Link to comment
Share on other sites
2 answers to this question
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.