Hello,
I would like to know the names, of stored procedures in my FB database.
I try to use IBCMetaData but without success
IBCMetaData1.MetaDataKind:='Procedures';
IBCMetaData1.Open;
while not IBCMetaData1.Eof do
begin
ShowMessage(IBCMetaData1.FieldByName[???].AsString);
IBCMetaData1.Next;
end;
Is it possible to have the variables ant their kind too?
Thank you for help
Regards
Know the name of StoredProcedure
To get a procedure name from metadata, you can use the PROCEDURE_NAME field:
ShowMessage(IBCMetaData1.FieldByName['PROCEDURE_NAME'].AsString);
You can see all fields available in the TIBCMetaData component if you link it to the TDataSource and TDBGrid components.
To get parameters of a stored procedure, set MetaDataKind to 'ProcedureParameters' and add 'PROCEDURE_NAME=MYPROCNAME' to the Restrictions property.
ShowMessage(IBCMetaData1.FieldByName['PROCEDURE_NAME'].AsString);
You can see all fields available in the TIBCMetaData component if you link it to the TDataSource and TDBGrid components.
To get parameters of a stored procedure, set MetaDataKind to 'ProcedureParameters' and add 'PROCEDURE_NAME=MYPROCNAME' to the Restrictions property.
-
- Posts: 7
- Joined: Wed 22 Jun 2016 04:06
Re:how to get detail procedure
I can't get my detail procedure using this component. Can you help me how to get detail procedure ?
I've try this one :
var
MetaData : TIBCMetaData;
S : String;
begin
MetaData := TIBCMetaData.Create(Nil);
MetaData.Connection := IBCConnection1;
MetaData.MetaDataKind := 'Procedures';
MetaData.Restrictions.Values['PROCEDURE_NAME'] := 'ADD_DETAILPO';
MetaData.Active := True;
while not MetaData.Eof do
begin
S := MetaData.Fields[2].AsString + AnsiString(#13#10) + S;
MetaData.Next;
end;
end
the result just the name of procedure not detail of procedure.
I've try this one :
var
MetaData : TIBCMetaData;
S : String;
begin
MetaData := TIBCMetaData.Create(Nil);
MetaData.Connection := IBCConnection1;
MetaData.MetaDataKind := 'Procedures';
MetaData.Restrictions.Values['PROCEDURE_NAME'] := 'ADD_DETAILPO';
MetaData.Active := True;
while not MetaData.Eof do
begin
S := MetaData.Fields[2].AsString + AnsiString(#13#10) + S;
MetaData.Next;
end;
end
the result just the name of procedure not detail of procedure.
Plash wrote:To get a procedure name from metadata, you can use the PROCEDURE_NAME field:
ShowMessage(IBCMetaData1.FieldByName['PROCEDURE_NAME'].AsString);
You can see all fields available in the TIBCMetaData component if you link it to the TDataSource and TDBGrid components.
To get parameters of a stored procedure, set MetaDataKind to 'ProcedureParameters' and add 'PROCEDURE_NAME=MYPROCNAME' to the Restrictions property.
Re: Know the name of StoredProcedure
We have answered to you at the topic: viewtopic.php?t=34331