Question: I want to write arrays into an InterBase table. Why doesn't the following code work?

pFIBQuery1->>SQL->Add("INSERT INTO T(A) VALUES(:A)");
pFIBQuery1->>pFIBQuery1->PrepareArrayFields();
pFIBQuery1->>ParamByName("A")->SetArrayValue( A );

Answer: You should use the PrepareArraySqlVar instead of PrepareArrayFields. PrepareArrayFields works with the array fields, and you do not have any array fields in your code. The PrepareArraySqlVar method works with parameters and informs the library which table and field your parameter refers to. So the correct code should be:

pFIBQuery1->>SQL->Add("INSERT INTO T(A) VALUES(:A)");
pFIBQuery1->>pFIBQuery1->PrepareArrayFields();
pFIBQuery1->>PrepareArraySqlVar(pFIBQuery1->ParamByName("A"),"T","A",False);
pFIBQuery1->>ParamByName("A")->SetArrayValue( A );


Preview text: 
Prices in Euro:

235 (1 copy)
1250 (unlimited)

Volume discounts are available...

Navigation



In the 30 years in the IT industry from development to IT Manager, I have
rarely used third party components but I would not be without your product. >>

John Hart ,Tradewinds Software Pty Ltd
FOR CUSTOMERS
Download full versions and updates in your Personal Area