• Firebird 问题总结


    1. 连接字符串问题(“initial catalog” 的内容必须是绝对路径,不能是相对路径)

    01:  <connectionStrings>
    02:      <add providerName ="FirebirdSql.Data.FirebirdClient" name="NumericDB" connectionString="data source=localhost;initial catalog=NULLABLETYPESDB.GDB;"/>
    03:    </connectionStrings>
    04:    <system.data>
    05:      <DbProviderFactories>
    06:        <clear/>
    07:        <add name="FirebirdSql.Data.FirebirdClient"
    08:             invariant="FirebirdSql.Data.FirebirdClient"
    09:             description="ddd"
    10:             type="FirebirdSql.Data.FirebirdClient.FirebirdClientFactory,FirebirdSql.Data.FirebirdClient"/>
    11:      </DbProviderFactories>
    12:  
    13:    </system.data>
    14:  

    2. 数据库区分大小写(表名、列名严格区分大小写)

    3.  数据库中没有自动增长列,创建自动增长列需要在Generactors 下,建立一个生成器,并设置初始值为0或1,或其它数字,然后创建触发器 

           例如:有个表A,表A中有个字段Id,我需要设置该字段为自动增长列实现步骤如下:
               (1):在Generactors 下,建立一个生成器,并设置初始值为0或1
                     create generator gen_A
                     set generator gen_A to 0
                     ☆:注意这两个语句不能同时执行,需单个执行
               (2)创建触发器:点Triggers
                    reate trigger trig_A_Id for A
                     active before insert position 0
                    as
                    begin
                       new.id=gen_id(gen_A,1);
                    end

    4. Firebird分页

    select first 10 templateid,code,name from template ;
    select first 10 skip 10 templateid,code,name from template ;
    select * from shop rows 1 to 10; --firebird2.0支持这种写法

  • 相关阅读:
    过程作为黑箱抽象——《计算机程序的构造和解释》
    过程与它们所产生的计算——《计算机程序的构造和解释》
    重构手法(四)之在对象之间搬移特性
    重构手法(三)之简化条件表达式
    重构手法(二)之简化函数调用
    重构手法(一)之重新组织函数
    代码的坏味道
    泛型算法(二十三)之排列算法
    泛型算法(二十二)之集合操作算法
    泛型算法(二十一)之比较算法
  • 原文地址:https://www.cnblogs.com/netcasewqs/p/2716408.html
Copyright © 2020-2023  润新知