Board index » delphi » cant update from tibdataset
jorge novoa
![]() Delphi Developer |
cant update from tibdataset2007-09-07 03:56:51 PM delphi263 i can not update a statement using tibdataset, the selectsql have no where clause: select b.nombre_platillo,a.nombre_producto, c.costo_producto,e.gramaje_prod,d.nombre_unidad, a.cve_producto, b.cve_platillo, c.cve_cto_prod, e.cve_ctoc_plat,d.cve_unidad from productos a, platillos b, costos_prods c, unidades d, cto_comp_plat e where a.cve_producto=c.cve_producto and b.cve_platillo=e.cve_platillo and c.cve_cto_prod=e.cve_cto_prod and d.cve_unidad=e.cve_unidad group by b.nombre_platillo,a.nombre_producto, c.costo_producto,e.gramaje_prod,d.nombre_unidad, a.cve_producto, b.cve_platillo, c.cve_cto_prod, e.cve_ctoc_plat,d.cve_unidad having max(fecha_real_ctopr)=max(fecha_real_ctopr) order by b.nombre_platillo, a.nombre_producto and the update statement is: update cto_comp_plat set GRAMAJE_PROD = :GRAMAJE_PROD, CVE_CTO_PROD = :CVE_CTO_PROD, CVE_UNIDAD = :CVE_UNIDAD where CVE_CTOC_PLAT = :OLD_CVE_CTOC_PLAT generated by de dataseteditor. When i try to update the table i do the following if siactocmplat.Locate('cve_platillo;cve_cto_prod', varArrayOf([platillose.keyvalue, siactocmplat.fieldbyname('cve_cto_prod').AsInteger]),[locaseinsensitive]) then .. siactocmplat.Edit;//siactocmplat=ibdataset name updatefunction(siactocmplat,params); .. function updatefuncion(qryp:tobject;...) .. with qryp as tibdataset do begin params[0].Value:=par;//in this line the error mentioned belos raises params[1].value:=par2; params[2].value:=par3; params[3].value:=par4; post; applyupdates; .. the error XSQLDA index out of range is raised when trying to fill params.. i already set paramcheck to true and false. i first generate the modifiysql manually, but it isn't works, so i then generated from dataset editor. why it doesn't link those parameters? d7, ib2007 best regards |