How do I create a new Firebird database from the command line?
Asked Answered
H

2

6

I'd like to create a new Firebird database in my C# client application. Is there a command line utility that lets you do this?

Holleyholli answered 21/10, 2009 at 16:21 Comment(2)
client application is made with ?Primalia
The client application is built in C#. I'll add that to the question.Holleyholli
P
11

you can use isql but I advice you to use directly the api.

isql -input test.sql

test.sql is like this :

SET SQL DIALECT 3;

SET NAMES UNICODE_FSS;

CREATE DATABASE 'D:\testdata.fdb'
USER 'SYSDBA' PASSWORD 'masterkey'
PAGE_SIZE 16384
DEFAULT CHARACTER SET UNICODE_FSS;

CREATE TABLE CUSTOMERS (
    CUST_ID       INTEGER NOT NULL,
    CUST_NAME     INTEGER,
    CUST_UNISITE  INTEGER
);

CREATE TABLE SMS_DETAIL (
    SD_ID                       INTEGER NOT NULL,
    SD_MESSAGE_DATA             VARCHAR(160)
);

creating database via the api

Primalia answered 21/10, 2009 at 16:42 Comment(2)
Thanks for the isql example. How would I use the API? What language is the API written in?Holleyholli
the API language is C++. Many components encapsulate the API in different language. I think you can make this with the dotnet provider.Primalia
M
0

We are using something like this for keys insensitive. (Firebird 3 >)

isql -input test.sql

SET SQL DIALECT 3;

SQL> create database 'c:\database\test.fdb' page_size 8192 DEFAULT CHARACTER SET UTF8
CON> ;

CREATE TABLE CUSTOMERS (

    CUST_ID       INTEGER NOT NULL,
    CUST_NAME     VARCHAR(20) COLATE UNICODE_CI,
    CUST_UNISITE  INTEGER
);
Myers answered 8/1, 2017 at 14:32 Comment(0)

© 2022 - 2024 — McMap. All rights reserved.