Dataset is read only lazarus / 16-Databases ---------------------------------------------------------------------- lwolynski · 2017-10-26 11:15 Hello there. 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? ---------------------------------------------------------------------- tudi_x · 2017-10-26 11:40 hi, could it work using a writable VIEW created with the query? you could use a simple select * afterwards from the VIEW. ---------------------------------------------------------------------- Thaddy · 2017-10-26 15:20 Views are not writable. ---------------------------------------------------------------------- korba812 · 2017-10-26 15:25 Quote from: Thaddy on October 26, 2017, 05:20:55 pmViews are not writable. depends on the database. eg firebird has updatable views: https://www.ibphoenix.com/resources/documents/how_to/doc_401 ---------------------------------------------------------------------- Thaddy · 2017-10-26 16:16 Firebird is not a proper database engine. Never has been. Maybe I am to strict, but view means view. ---------------------------------------------------------------------- korba812 · 2017-10-26 16:30 Quote from: Thaddy on October 26, 2017, 06:16:02 pmFirebird is not a proper database engine. Never has been. I'm not sure what you mean. Could you explain? Quote from: Thaddy on October 26, 2017, 06:16:02 pmMaybe I am to strict, but view means view. I guess you are. It all depends on the database and the design assumptions. https://en.wikipedia.org/wiki/View_(SQL) ---------------------------------------------------------------------- valdir.marcos · 2017-10-26 16:54 Quote from: lwolynski on October 26, 2017, 01:15:34 pmI 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? Start reading a similar topic: [Solved] Help on Database Insert http://forum.lazarus.freepascal.org/index.php/topic,38543.0.html ---------------------------------------------------------------------- valdir.marcos · 2017-10-26 17:15 Quote from: Thaddy on October 26, 2017, 06:16:02 pmFirebird is not a proper database engine. Never has been. @Thaddy Have you ever used Firebird? I have been using it since 1991 in many companies and clients including, but not limited to, replacing big RDBMS such as Oracle, DB2, Sybase and MS SQL Server without performance loss, of course, in a proper hardware, sysadmin and DBA. In all those years, what I see most is people wanting a tremendous performance without spending a penny in specialized manpower and huge modern expensive infra-structure... Where can I learn about history of Firebird? http://www.firebirdfaq.org/faq238/ ---------------------------------------------------------------------- valdir.marcos · 2017-10-26 17:17 Quote from: korba812 on October 26, 2017, 06:30:55 pmQuote from: Thaddy on October 26, 2017, 06:16:02 pmMaybe I am to strict, but view means view. I guess you are. It all depends on the database and the design assumptions. https://en.wikipedia.org/wiki/View_(SQL) +1 ---------------------------------------------------------------------- taazz · 2017-10-26 20:34 Quote from: lwolynski on October 26, 2017, 01:15:34 pmI 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 Code: SQL  [Select][+][-]window.onload = function(){var x1 = document.getElementById("main_content_section"); if (x1) { var x = document.getElementsByClassName("geshi");for (var i = 0; i 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. ---------------------------------------------------------------------- ASerge · 2017-10-27 15:44 Quote from: Thaddy on October 26, 2017, 06:16:02 pmFirebird is not a proper database engine. Never has been. Maybe I am to strict, but view means view. Oracle is also not a proper database? QuoteUsers can query views, and with some restrictions they can perform DML on views.