Subject Python FDB Driver, Dialect 3 and NUMERIC
Author Ray Cote
Hello:

I’ve run into a problem while porting code over from the old  KInterbasDB library to the new FDB Python library. Receiving the error “-817 Metadata update statement not allowed any the current database SQL dialect 3” when attempting to create a table with NUMERIC(15, 3). 

My understanding is that this statement is fine for dialect 3, and should store as a BIGINT (page 135 of The Firebird Book). This code has been working fine with KInterbasDB. 

If I change NUMERIC(15,3) to NUMERIC(9,3) the code runs properly. 
Perhaps there’s something I’ve not set to allow the BIGINT storage? 

Guidance appreciated.
—Ray

Sample source:
I’m running:
   32-bit Windows 10
   Python 2.7.11
   FDB library 1.5.1
   Firebird Embedded 2.1.5.18497/Dialect 3.


import fdb
con = fdb.create_database(
    "CREATE DATABASE 'test.fdb' USER 'test' PASSWORD 'test'",
        sql_dialect=3
        )

sql = """
    CREATE TABLE bob (
        field2 NUMERIC(15, 3) NOT NULL
        );
    """
con.execute_immediate(sql)

‘Error while executing SQL statement:\n- SQLCODE: -817\n- Dynamic SQL Error\n- SQL error code = -817\n- Metadata update statement is not allowed by the current database SQL dialect 3', -817, 335544569

--
Raymond Cote, President
voice: +1.603.924.6079 email: rgacote@... skype: ray.cote