如题,请教各位高手,Firebird数据库中的数组字段,该如何进行添加,读取操作,谢谢。我的配置:FireDAC + Firebird 嵌入版

解决方案 »

  1.   

    另外,附上数据库定义:Create Table AryTable(
        UserID SmallInt not null,
        GroupName Varchar(10) ,
        MemberVal Varchar(10)[0:3],
       Primary Key (UserID)
    );
      

  2.   

    TurboBird is a Firebird Administration tool我是一名网络搬运工专门班门弄斧
      

  3.   


    感谢您的分享,但是我接触delphi的时间不长,能否受累指点一下哪部分是设计arrayField操作的吗?谢谢!
      

  4.   


    function TdmSysTables.GetDBUsers(dbIndex: Integer; ObjectName: string = ''): string;
    begin
      Init(dbIndex);
      sqQuery.Close;
      sqQuery.SQL.Text:= 'select distinct RDB$User, RDB$User_Type from RDB$USER_PRIVILEGES ';
      if ObjectName <> '' then // Specify specific Object
        sqQuery.SQL.Add('where RDB$Relation_Name = ''' + UpperCase(ObjectName) + ''' ');
      sqQuery.SQL.Add('order by RDB$User_Type');
      sqQuery.Open;
      while not sqQuery.EOF do
      begin
        if sqQuery.Fields[1].AsInteger = 13 then // Role
          Result:= Result + '<R>';
        Result:= Result + Trim(sqQuery.Fields[0].Text);
        sqQuery.Next;
        if not sqQuery.EOF then
          Result:= Result + ',';
      end;
      sqQuery.Close;
    end;function TFirebirdServices.AttachService: Boolean;
    var
      S: String;
      ServiceName, Buff: array [0..255] of Char;  W1, W2: Word;
      B: Byte;
    begin
      if ServiceAttached then
        raise EFBServiceError.Create('Service already attached!!!');  S := Trim(FHostName);
      if (Length(S) > 0) and (UTF8UpperCase(S) <> 'LOCALHOST') then
        S := FHostName + ':service_mgr'
      else
        S := 'service_mgr';  W1 := Length(S);
      ServiceName := S;  B := isc_spb_version;
      S := Char(B);
      B := isc_spb_current_version;
      S := S + Char(B);
      B := isc_spb_user_name;
      S := S + Char(B);
      B := Length(FUserName);
      S := S + Char(B) + FUserName;  B := isc_spb_password;
      S := S + Char(B);
      B := Length(FPassword);
      S := S + Char(B) + FPassword;
      W2 := Length(S);  Buff := S;  Result := isc_service_attach(@FArrIStatus, W1, @ServiceName, @FPServiceHandle, W2, @Buff) = 0;  if not Result then
        RaiseServiceErr;
    end;
    资料:
     turbobird/unitfirebirdservices.pas turbobird/systables.pasFireBird 系统表相关SQL  
      

  5.   

    不好意思,没太看明白,我是想问如何操作如下结构中的 MemberVal 字段,还请指点,谢谢!
    PS:我接触 Delphi 时间不长,还请详细说明,谢谢!数据结构:
    Create Table AryTable(
        UserID SmallInt not null,
        GroupName Varchar(10) ,
        MemberVal Varchar(10)[0:3],
       Primary Key (UserID)
    );