Page 1 of 1

GetFieldNames

Posted: 07.03.2007, 22:45
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