mariuz / flamerobin

FlameRobin is a database administration tool for Firebird RDBMS. Our goal is to build a tool that is: lightweight (small footprint, fast execution) cross-platform (Linux, Windows, Mac OS X, FreeBSD) dependent only on other Open Source software
http://flamerobin.org
MIT License
216 stars 67 forks source link

Create new db from Flamerobin generated DDL script #171

Open tester0077 opened 3 years ago

tester0077 commented 3 years ago

First off, is this the correct forum for this sort of question?

If it is, what is the recommended procedure for generating a new db from such a script. FWIW, I am running FR 0.9.3 hash 375bec5f from github under Win 10 64-bit & Firebird 3.xx also 64-bit) I have an existing db and after opening it exported the DDL to a text file. When I tryto run it through isql, but get errors. For one, I had to add a CREATE DATABASE statement then several statements such as "CREATE SEQUENCE GEN_FILES_ID ;" are executed without complaints, but when I get to statements like: CREATE DOMAIN DESCRIPTION_TEXT AS varchar(2048) COLLATE UTF8; I get errors _PS C:\Program Files\Firebird\Firebird_3_0> .\isql.exe Use CONNECT or CREATE DATABASE to specify a database SQL> set autoddl on; SQL> input C:\Users\arnold\AppData\Roaming\wxICD\wxicd-4.sql; Statement failed, SQLSTATE = 22021 unsuccessful metadata update -CREATE DOMAIN DESCRIPTIONTEXT failed -Dynamic SQL Error -SQL error code = -204 -COLLATION UTF8 for CHARACTER SET NONE is not defined

Any help to move on or clear up any confusion on my part is most welcome

arvanus commented 3 years ago

Hi,

-COLLATION UTF8 for CHARACTER SET NONE is not defined You need to create a new database with the correct charset

tester0077 commented 3 years ago

My script started with CREATE DATABASE '.\test.fdb' user 'SYSDBA' password 'masterkey'; what do I need to add to get the proper char set?

I have tried, as a first statement in the script: CREATE DATABASE '.\test1.fdb' user 'SYSDBA' password 'masterkey' PAGE_SIZE 8192 DEFAULT CHARACTER SET UTF8; but am getting the same error

arvanus commented 3 years ago

Hi, tested here at Fb3, and it's working: image Can you confirm this simple script isn't working for you?

tester0077 commented 3 years ago

I can confirm that running the test script works as expected. Thank you for your help.

As well, I have meanwhile found ways to run the complete script output (from FR) from my existing database - inherited from an old project. There were a couple of changes I had to add. One was the db create line at the very start and a AS string for procedure code, such as _SET TERM ^ ; CREATE PROCEDURE SP_ADD_PHYSPATH_TO_VIRTUALPATH ( PHYS_PATH_ID bigint, VIRTUAL_PATHID bigint ) AS <<<<<< had to be added BEGIN SUSPEND; END ^ SET TERM ; ^

The current problem is to now feed the contents of this script to IBPP C++ code to recreate a new and empty db. That is still a work in progress.

Jdochoa commented 3 years ago

Hi @tester0077

Can you give me feedback on this or close it?

Thanks

./jo

luronumen commented 2 years ago

Hi @tester0077

Could you please retest this issue on FlameRobin 0.9.3.12 and close it if it is no longer reproducible?

Thanks in advance, Luciano