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支持这种写法

posted @ 2012-10-09 11:16  风云  阅读(762)  评论(1编辑  收藏  举报