FireBird 2.0
IBExpert DBMS
Embarcadero Rad Studio 2010 (C++) development environment Embarcadero Rad Studio 2010 (C++)

There is a table of goods, deletion, select, adding plow, but the update does not channel into any.

The product table has three fields - ID, Label, Price.
BDE Development Tools
I put in the datamodule all the relevant components - IBDatabase in which the path to the database, IBTransaction , TIBQuerry - in which the select from the table, TDataSource and TIBStoredProc - which performs the procedure (ON each one).

Here, the data is displayed in DBGrid , in DBRID I select a line, click on the button that causes the record change form, there the two fields are filled with data from the line being changed .... Next, I change their values, click ОК which performs the following procedure

 DMD->goods_U->ParamByName("label")->Value=Edit1->Text; DMD->goods_U->ParamByName("costforsingle")->Value=StrToFloat(Edit2->Text); 

Where
DMD - data module where BDE components are located,
goods_U - component TIBStoredProc implements the update,
LABEL and costforsingle respectively table fields.

SQL text on update:

 BEGIN UPDATE GOODS SET LABEL = :LABEL, COSTFORSINGLE = :COSTFORSINGLE WHERE (label = :label); END 

The update does not work ... None.

Maybe, although it can not, but something is not right? Tell me pliz)

  • If the label has changed, then the update will not happen or worse - something else will appear. You are looking for an existing entry by the new value, and not by the old one. PS Why do you need the stored, when you can do IBUpdateSQL? or is it just an example? ... - Yura Ivanov
  • Hmmm, no, not an example, but what about UpdateSQL? - BlackOverlord

2 answers 2

And who will do the committee Ivan Fedorovich Kruzenshtern?

add a COMMIT to the transaction.

  • C ++ is not my native environment, but most likely of the type so IBTransaction-> Commit; - vdk company
  • Thank you) Just flew out of my head) - BlackOverlord

SET LABEL =: LABEL, WHERE (label =: label);

If the register does not matter, then you change the value to ITEM.

  • Well, judging by the text of the request there is updated not only the label but also COSTFORSINGLE . To be precise, COSTFORSINGLE is updated and the label remains the same - vdk company
  • Well, since you don’t need to change Label at all, I can assume that it’s unclean with COSTFORSINGLE. :-) It seems to be taken from the same line. - msi
  • no COSTFORSINGLE is passed to the request by another parameter. IMHO he does not complete the transaction with a commit for this and does not see any changes, FireBird has versioned architecture - vdk company
  • Readings are dirty, but I do not know the specifics of FireBird, therefore I will agree with everything said. However, I would like to hear something from the author of the question. He seems to need it more. :-) - msi