B4J Question JRDC2: Parameterized placeholders are only for values ?

le_toubib

Active Member
Licensed User
Longtime User
hi all
i m trying to implement a similar query in JRDC2 :
SELECT * FROM patients WHERE ? = ?
i.e : dynamic field names since i have too many fields in this table 40+

in php it was possible to directly post the field name , and then parametrize the value , but here in JRDC2 is there a way to do it ?
 

Erel

B4X founder
Staff member
Licensed User
Longtime User
Column names cannot be parameterized. You can probably use a stored procedure for that, or a simpler solution is to create a command for each of the fields.

B4X:
sql.select_field1 = SELECT * FROM patients WHERE field1 = ?
sql.select_field2 = SELECT * FROM patients WHERE field2 = ?
sql.select_field3 = SELECT * FROM patients WHERE field3 = ?
sql.select_field4 = SELECT * FROM patients WHERE field4 = ?

The command name can be built dynamically in the clients.
 
Upvote 0
Top