Page 1 of 1

Where is RequesLive

Posted: 02.06.2024, 18:37
by kikep
on documentation sad setup zquery like that but property requestlive is not show up
TZQuery:
Connection: conEmployee
Name: qryCustomer
RequestLive: True // where is this property
SQL: SELECT * FROM customer ORDER BY customer
when you don't read the manuels sad tutorial or manual explain it or that but on this case reference to the property witch is not there why...

this is my code what i doing wrong to get message register not update when as DM.ZqPo.RowsAffected

Code: Select all

procedure TFormAdo.BtnRunSQlClick(Sender: TObject);
begin
    if not DM.ZQPo.Active  then ShowMessage('Connection not active!'); //for test

     with DM.ZUPo.Params do begin
       DM.ZUPo.Params.ParamByName('PurchaseOrderDate').AsString:='{d''2024-03-07''}';
       DM.ZUPo.Params.ParamByName('OrderType').AsString:='S';
       DM.ZUPo.Params.ParamByName('MasterRepeatingPOOrSO').AsString:='  ';
       DM.ZUPo.Params.ParamByName('Old_PurchaseOrderNumber').AsString:=DM.ZQPo.FieldByName('PurchaseOrderNumber').AsString;
       DM.ZUPo.Params.ParamByName('Old_Division').AsString:=DM.ZQPo.FieldByName('Division').AsString;
     end;
     Dm.ZQPo.Active:=false;
     Dm.ZUPo.ModifySQL.SaveToFile('adosql.txt');
     Try
      DM.ZQPo.ExecSQL;
      if( DM.ZqPo.RowsAffected>0) then begin; not get update the register
         DM.ZQPo.ApplyUpdates;
      end else begin
        ShowMessage('Purchase Order not Updated');
      end;
    except  on e: Exception do begin
      DM.ZQPo.CancelUpdates;
      Showmessage('Exceptionclass = ' + E.ClassName + ' / ' + E.Message);
     end;
    end;
    DM.ZQPo.Open;
end;



this my sqlmodify
UPDATE PO1_PurchaseOrderEntryHeader SET
PurchaseOrderDate = :PurchaseOrderDate ,
OrderType = :OrderType ,
Division = :Division ,
MasterRepeatingPOOrSO= :MasterRepeatingPOOrSO,
Division=:Division
WHERE PurchaseOrderNumber = :Old_PurchaseOrderNumber
AND Division =:Old_Division

only wanna to update purchaseorderdate, Ordertype, MasterRepeatingPOOrSO

the sql not problem is correct because i don't get any error of sql only not update the record
some body can help me please.... or what i have to....

Re: Where is RequesLive

Posted: 03.06.2024, 10:18
by marsupilami
Hello kikep,

RequestLive is a very old property that was remved with Zeos 7.0. RequestLive had the inverse meaning to the ReadOnly property. When RequestLive was set, an updateable result set was requested. So if the manual says you should set RequestLive to true, this translates to set ReadOnly to false these days.

Unfortunately I never got around to rewriting the documentation. I will take a look at RequestLive and see if I can fix the documentation in that aspect.

Best regards,

Jan

Re: Where is RequesLive

Posted: 04.06.2024, 00:53
by kikep
OK i suppose that in old version was enable but in recently version.... but is now manual of new version is for old version...
some example of use tzupdate with tzquery i tied different way i don't get works for me..

thanks...

Re: Where is RequesLive

Posted: 04.06.2024, 12:41
by marsupilami
As far as TZUpdateSQL goes:
Please use it only if you have to. Zeos should handle these things in a lot of cases automatically.

If you have to use TZUpdateSQL: Fill in the InsertSQL, UpdateSQL and DeleteSQL properties as needed. Use :<FIELDNAME> in the SQL statamants to have parameters for the new field value. Use :OLD_<FIELDNAME> to access the old field values. If you have correct primary keys and generate them in the program (use TZSequence?) then using OLD_ should not be necessary.

Let me know what doesn't work for you.

Best regards,

Jan