GetFieldNames

Forum related to version 6.5.1 (alpha) and 6.6.x (beta) of ZeosLib's DBOs

Moderators: gto, cipto_kh, EgonHugeist

Post Reply
User avatar
simpsomboy
Fresh Boarder
Fresh Boarder
Posts: 6
Joined: 14.09.2005, 06:05

GetFieldNames

Post by simpsomboy »

Hello... I sugest to put a Procedure GetFieldNames on ZConnection

somthing like this

in interface

public
procedure GetFieldNames(const TablePattern: string; List: TStrings);

in implementation

{**
Fills string list with field names.
@param TablePattern table name to get fields
@param List a string list to fill out.
}
procedure TZConnection.GetFieldNames(const TablePattern: string; List: TStrings);
var
Metadata: IZDatabaseMetadata;
ResultSet: IZResultSet;
begin
CheckConnected;
List.Clear;
Metadata := DbcConnection.GetMetadata;
ResultSet := Metadata.GetColumns('', '', TablePattern, '');
while ResultSet.Next do
List.Add(ResultSet.GetStringByName('COLUMN_NAME'));
end;


I think that it's very useful for most of developers...

thank you
Post Reply