Tripta
Tripta

Reputation: 45

How to use parameters in TpFIBDataSet SQL query?

I am using FIBPlus library and Delphi 10.3 Rio.

Inside my project I have TpFIBDataSet component.

Under SQL Generator I defined SQL Select with 'where clause' and inside 'where clause' I have one parameter.

My SQL Select and parameter called ':BROJ'

How can I use that parameter in my code, and how can I pass value into that parameter?

Upvotes: 1

Views: 501

Answers (1)

MartynA
MartynA

Reputation: 30715

I don't have a copy of the TpFIBDataSet handy. but usually you set a dataset parameter by code like this:

MyDataSet.Parameters.ParamByName('BROJ').AsString := 'some value';

Note : With some TDataSet descendants, the parameters collection is named Params rather than Parameters.

I gather from your suggested edit that with the dataset type you are using, you can write this instead:

MyDataSet.ParamByName('BROJ').AsString := 'some value';

Upvotes: 2

Related Questions