Recent

Author Topic: [Solved] IBX tIBDataSet and Parameters  (Read 585 times)

iru

  • Full Member
  • ***
  • Posts: 220
[Solved] IBX tIBDataSet and Parameters
« on: November 30, 2018, 10:57:49 pm »
Gentlefolk,

Environment: Linux Mint 19, Laz 1.8.4, IBX 2.

Use of parameters with IBX tIBDataSet?

From tests it would appear that with the IBX tIBDataset the only table fields that can be used with 'Parameters' are those fields specified in the 'SelectSQL' statement.

For example where table AthReg contains fields RegNum, MemNum, NameGiven,,,, and
SelectSQL contains 'Select * from AthReg where RegNum = :Regnum'
InsertSQL contains 'Insert Into ATHREG (REGNUM, NAMEGIVEN, MEMNUM) Values(:REGNUM, :NAMEGIVEN, :MEMNUM)   

The following code compiles correctly:
    IBDataSet1.Prepare;
    IBDataSet1.ParamByName('RegNum').AsInteger := 456;
    IBDataSet1.ParamByName('MemNum').AsString := '9999';
    IBDataSet1.ParamByName('NameGiven').AsString := 'Ian';
    IBDataSet1.Open;

But at run time fails with 'Field "MemNum" not found'.

Any help, direction, examples, etc appreciated.

Ian

Update: I sent an email to mwa software and got a rapid and comprehensive response.

The IBX tIBDataset is tied to the original Delphi. One can only use parameters on the table fields specified in the SQL statement.

Ian.
« Last Edit: December 04, 2018, 02:04:53 am by iru »