I have a program that needs to get data from three tables. I needed to use JOIN in SQLQuery but because of that the Dataset is read only and I can't edit anything.
How can I make it writable?
Depends on the database library you are using SQLDB, zeos etc but in general most of the libraries support it. In the SQLDB the SQLQuery component has 3 properties that are usefull for this situation.
1) SQL, 2)UpdateSQL and 3) InsertSQL. SQL, as you might have already found out is where you place your select query with its parameters. Insertsql is where you write your insert command to be executed on the server but instead of values you add the fieldname as parameters eg
INSERT IN TO my TABLE (Field1, field2, field3, field4) VALUE (:Field1, :field2, :field3, :field4)
The dataset it self will set the values for the Field parameters (they always start with then char ":") when a call to applyupdates is made.
The same logic extends to UpdateSQL as well but with an update statement instead. Pay attention to the readonly property of the dataset it must be false.