firebird isql: “there is no table XXXX in this database”

前端 未结 1 818
名媛妹妹
名媛妹妹 2020-12-21 03:01

I am trying to extract data from a Firebird 2.5 SQL database for migration. The data has been built up over a long period through software that has the Firebird 2.5 database

相关标签:
1条回答
  • 2020-12-21 03:43

    By default object names in Firebird (and most other databases) are case insensitive, but with a catch: If you create or reference a table (or other object) name without quotes, it is actually treated as if it is uppercased. Only when an object name is enclosed in quotes is it case sensitive and referenced as-is. This behavior is specified in the SQL Standard (see SQL:2011 Foundation, 5.2 <token> and <separator> together with 5.4 Names and Identifiers).

    This means that customer, Customer, CUSTOMER, CuStOmEr and "CUSTOMER" all reference the same table, namely: CUSTOMER.

    When you create a table "Customer" (note the quotes), it is stored in the metadata as Customer but it can only be referenced as "Customer", using Customer will still reference CUSTOMER as unquoted object names are case insensitive.

    You try to display the table using

    show table Customer;
    

    Note the uppercased use of CUSTOMER in the error message:

    There is no table CUSTOMER in this database

    The output of show tables shows you have a table Customer (and not CUSTOMER), so you need to reference it as "Customer". You need to use:

    show table "Customer";
    
    0 讨论(0)
提交回复
热议问题