Home > Back-end >  Questions about the Firebird database operation array fields!
Questions about the Firebird database operation array fields!

Time:09-24

As title, consult everybody masters, Firebird array field in the database, how to add, read operation, thank you,

My configuration: FireDAC + Firebird embedded edition

CodePudding user response:

In addition, attach a database definition:

The Create Table AryTable (
UserID SmallInt not null,
GroupName Varchar (10),
MemberVal Varchar (10) (3-0),
Primary Key (UserID)
);

CodePudding user response:

TurboBird is a Firebird Administration tool

I am a network a porter

Special offer

CodePudding user response:

refer to the second floor fhfanxin response:
TurboBird is a Firebird Administration tool

I am a network a porter

Special offer



Thank you for your sharing, Delphi's time is not long, but I contact can give directions which affected part is design arrayField operation? Thank you very much!

CodePudding user response:

 
The function TdmSysTables. GetDBUsers (dbIndex: Integer; The ObjectName: string=') : string;
The begin
Init (dbIndex);
SqQuery. Close;
SqQuery. SQL. Text:='select distinct RDB $User and $User_Type RDB from RDB $USER_PRIVILEGES';
If the ObjectName & lt;> "' then//Specify specific Object
SqQuery. SQL. The Add (' where RDB $Relation_Name='" + UpperCase (ObjectName) + "' ");
SqQuery. SQL. The Add (' order by RDB $User_Type ');
SqQuery. Open;
While not sqQuery. EOF do
The begin
If sqQuery. Fields [1]. AsInteger=13 then//Role
Result: the Result=+ '& lt; R> ';
Result: the Result=+ Trim (sqQuery Fields [0]. The Text).
SqQuery. Next;
If not sqQuery. EOF then
Result: the Result +=', ';
end;
SqQuery. Close;
end;




 
The function TFirebirdServices. AttachService: Boolean;
Var
S: a String;
ServiceName, Buff: an array of Char [0.. 255];

W1 and W2: Word;
B: a Byte;
The begin
If ServiceAttached then
Raise EFBServiceError. Create (' Service already attached!!! ');

S:=Trim (FHostName);
If (Length (S) & gt; 0) and (UTF8UpperCase (S) & lt;> 'LOCALHOST') then
S:=FHostName + ': service_mgr'
The 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 the Result then
RaiseServiceErr;
end;


Information:
Turbobird/unitfirebirdservices pas

Turbobird/systables pas

FireBird system tables related to SQL

CodePudding user response:

Sorry, didn't see, I wanted to ask how to operate the following MemberVal field in structure, also please give directions, thank you!
PS: I contact the Delphi time is not long, also please give details, thank you!

The data structure:
The Create Table AryTable (
UserID SmallInt not null,
GroupName Varchar (10),
MemberVal Varchar (10) (3-0),
Primary Key (UserID)
);
  • Related