Arf Well-Known Member Licensed User Longtime User Feb 5, 2016 #1 Hi, I get a compilation error: error: inconvertible types _pp = (String[])(mostCurrent._dbutils._executememorytable(_ba,_sql,"SELECT * FROM Patients WHERE Patient_ID='"+_epatientid+"' ORDER BY Patient_ID DESC",(String[])(anywheresoftware.b4a.keywords.Common.Null),(int) (0)).getObject()); ^ required: String[] found: List<Object> from this portion of code: Code: Sub GetPatientData(ePatientID As String) As PatientStruct Dim retPat As PatientStruct Dim pp(11) As String = DBUtils.ExecuteMemoryTable(SQL,"SELECT * FROM Patients WHERE Patient_ID='"&ePatientID&"' ORDER BY Patient_ID DESC",Null,0) Any idea why this is failing? Thanks.
Hi, I get a compilation error: error: inconvertible types _pp = (String[])(mostCurrent._dbutils._executememorytable(_ba,_sql,"SELECT * FROM Patients WHERE Patient_ID='"+_epatientid+"' ORDER BY Patient_ID DESC",(String[])(anywheresoftware.b4a.keywords.Common.Null),(int) (0)).getObject()); ^ required: String[] found: List<Object> from this portion of code: Code: Sub GetPatientData(ePatientID As String) As PatientStruct Dim retPat As PatientStruct Dim pp(11) As String = DBUtils.ExecuteMemoryTable(SQL,"SELECT * FROM Patients WHERE Patient_ID='"&ePatientID&"' ORDER BY Patient_ID DESC",Null,0) Any idea why this is failing? Thanks.
fixit30 Active Member Licensed User Longtime User Feb 5, 2016 #2 DBUtils.ExecuteMemoryTable returns a List of Arrays So you could try Code: Dim pp As List = DBUtils.ExecuteMemoryTable(SQL,"SELECT * FROM Patients WHERE Patient_ID='"&ePatientID&"' ORDER BY Patient_ID DESC",Null,0) BTW, it is much easier to pass the parameter as an array, so the above code would become: Code: Dim pp As List = DBUtils.ExecuteMemoryTable(SQL,"SELECT * FROM Patients WHERE Patient_ID = ? ORDER BY Patient_ID DESC", Array as String(ePatientID),0) Last edited: Feb 5, 2016 Upvote 0
DBUtils.ExecuteMemoryTable returns a List of Arrays So you could try Code: Dim pp As List = DBUtils.ExecuteMemoryTable(SQL,"SELECT * FROM Patients WHERE Patient_ID='"&ePatientID&"' ORDER BY Patient_ID DESC",Null,0) BTW, it is much easier to pass the parameter as an array, so the above code would become: Code: Dim pp As List = DBUtils.ExecuteMemoryTable(SQL,"SELECT * FROM Patients WHERE Patient_ID = ? ORDER BY Patient_ID DESC", Array as String(ePatientID),0)
Arf Well-Known Member Licensed User Longtime User Feb 5, 2016 #3 ah thanks, I'll give that a go. Upvote 0