Subject | Re: [firebird-support] Firebird 3.0 create database syntax |
---|---|
Author | Mark Rotteveel |
Post date | 2017-11-14T09:31:24Z |
On 14-11-2017 00:00, palevi pablo.leon@... [firebird-support] wrote:
single quotes. That you could use double quotes in ISQL in previous
versions, was probably for backwards compatibility with dialect 1.
However since Firebird 3, the username is an object name (just like
tables and columns), and not just a string, which means that double
quotes are now reserved for the ability to quote object names, and you
must use single quotes for strings, just like in normal dialect 3
statements.
It looks like the release notes should expand on this (specifically,
https://www.firebirdsql.org/file/documentation/release_notes/html/en/3_0/rnfb30-compat-sql.html#rnfb30-compat-username-namelength
)
Mark
PS The above create database statement would fail under Firebird 2.5 and
earlier with a "Token unknown SYSDBA" as it would need to be enclosed in
single (or double) quotes just like the database name and password.
--
Mark Rotteveel
> In firebird 2.x you can specify some parameters when creating aThe database name and password are strings, and must be enclosed in
> database, i.e.:
>
> create database "localhost:milenio-central.fdb" user "milenio"
> password "secreto" page_size 16384 default character set utf8 collation
> unicode;
>
> However in fb 3.0 I get this error:
>
> Use CONNECT or CREATE DATABASE to specify a database
> SQL> create database "localhost:milenio-central.fdb" user milenio
> password "secreto" page_size 16384 default character set utf8 collation
> unicode;
> Statement failed, SQLSTATE = 42000
> Dynamic SQL Error
> -SQL error code = -104
> -Token unknown - line 1, column 17
> -"localhost:milenio-central.fdb"
>
> if I strip out the "character set" and "collation" parameters, then the
> order runs fine again, but ¿what are the allowed parameters for "create
> database" in fb 3.0? ¿and what are the alternatives for unsupported ones?
single quotes. That you could use double quotes in ISQL in previous
versions, was probably for backwards compatibility with dialect 1.
However since Firebird 3, the username is an object name (just like
tables and columns), and not just a string, which means that double
quotes are now reserved for the ability to quote object names, and you
must use single quotes for strings, just like in normal dialect 3
statements.
It looks like the release notes should expand on this (specifically,
https://www.firebirdsql.org/file/documentation/release_notes/html/en/3_0/rnfb30-compat-sql.html#rnfb30-compat-username-namelength
)
Mark
PS The above create database statement would fail under Firebird 2.5 and
earlier with a "Token unknown SYSDBA" as it would need to be enclosed in
single (or double) quotes just like the database name and password.
--
Mark Rotteveel