[solved] copy databases by select-statement lazarus / 16-Databases ---------------------------------------------------------------------- Nicole · 2024-01-25 19:49 If I use e.g. Flamerobin there is a windows "open new volatile SQL editor"? Is this useful for my purpose? This is what I want to do: I have 2 registered and connected databases. myDB and myDB1 myDB1 is empty and contains nothing but tables without data. myDB holds tables with data. How can I say select * from tbtable DB insert the all values * into tbtable DB1 ? ---------------------------------------------------------------------- rvk · 2024-01-25 19:57 I'm not familiar with the fact FlameRobin could do this. You can do it yourself in code (connecting to both DBs and doing the inserts manually). You could try the utility fbcopy. https://www.firebirdfaq.org/fbcopy.php You could extract the data as INSERTs (FlameRobin can do this) and execute them in the new database. This only works for normal fields but not for BLOBs (not sure if you have those). ---------------------------------------------------------------------- CharlyTango · 2024-01-26 08:26 First of all: I'm not a Firebird/Flamerobin crack. But these should follow usual SQL-Syntax.  The following will work in SQLite, MySQL,MariaDB,MSSQL, Oracle and i'm quite sure it will work also with Firebird. Code: Pascal  [Select][+][-]window.onload = function(){var x1 = document.getElementById("main_content_section"); if (x1) { var x = document.getElementsByClassName("geshi");for (var i = 0; i INSERT INTO mydb1.tbtableSELECT * FROM mydb.tbtableWHERE condition; given that you have access and rights in both of the databases. If you use the . notation it should be possible to reach tables in other databases. Sources for more information: https://www.w3schools.com/sql/sql_insert_into_select.asp https://www.sqlshack.com/sql-insert-into-select-statement-overview- and-examples/ ---------------------------------------------------------------------- Zvoni · 2024-01-26 08:54 Quote from: CharlyTango on January 26, 2024, 09:26:58 amFirst of all: I'm not a Firebird/Flamerobin crack. But these should follow usual SQL-Syntax.  The following will work in SQLite, MySQL,MariaDB,MSSQL, Oracle and i'm quite sure it will work also with Firebird. Code: Pascal  [Select][+][-]window.onload = function(){var x1 = document.getElementById("main_content_section"); if (x1) { var x = document.getElementsByClassName("geshi");for (var i = 0; i INSERT INTO mydb1.tbtableSELECT * FROM mydb.tbtableWHERE condition; given that you have access and rights in both of the databases. If you use the . notation it should be possible to reach tables in other databases. Sources for more information: https://www.w3schools.com/sql/sql_insert_into_select.asp https://www.sqlshack.com/sql-insert-into-select-statement-overview- and-examples/ No, since you have two different connections. This would only work, if the two Databases are on the same server (Firebird in Server-Mode). If it's Filebased (embedded) then you need two connections, and then it wonÄt work. That said: The easiest way is to do a SQL-Dump on MyDB and then execute it in MyDB1