Link to home
Create AccountLog in
Delphi

Delphi

--

Questions

--

Followers

Top Experts

Avatar of alsantos
alsantos

UpdateSql on Delphi 7
Hi.... I'm using a IBQuery, and I would like to use a IBQuery.Edit, so, I have to use the UpdateSql, so, a link the query to updatesql, and then generate the Sql code to update on updatesql component.

So... I'm using this code to select and start the edit mode:

   with ibqCliente do
   begin
     SQL.Strings[1]:='where codigo = :codigo';
     ParamByName('codigo').asInteger:=strtoint(edtCodigo.Text);
     Open;
     Edit;
   end;


and when the user edit the informations and want to save, I'm using this code:

  ibuCliente.Query[ukModify].Prepare;
  ibuCliente.ExecSQL(ukModify);
  ibqCliente.Post;

but, it shows me an error message, "Update Failed", so, I don't know how I can solve this problem?
So... please, if possible, show me how I can solve that, an example using the update sql, with the options checked and the source code to exec the sql

Thanks, Alexandre Junior

Zero AI Policy

We believe in human intelligence. Our moderation policy strictly prohibits the use of LLM content in our Q&A threads.


Avatar of kretzschmarkretzschmar🇩🇪

did you provide an
update-sql-statement
in the updateSQL-Object?


Avatar of alsantosalsantos

ASKER

How?

Avatar of kretzschmarkretzschmar🇩🇪

>How?
dblClick the TUpdateSQL-Component,
an editor pops up,
there you can autogenerate sql-statements now
or write your statements by hand

it is required by doing so,
that the TUpdateSQL-Component is assigned
as updateObject (property) in your select query-object

meikl ;-)

Reward 1Reward 2Reward 3Reward 4Reward 5Reward 6

EARN REWARDS FOR ASKING, ANSWERING, AND MORE.

Earn free swag for participating on the platform.


On the question, I wrote that I've already generate the sql code.... my problem is when I put the ibquery in edit mode, and then try to do the: ibuCliente.Query.ukModify].Prepare;
ibuCliente.ExecSQL(ukModify);

because it shows me an error message: Upload failed ... I don't know why....

Alexandre

ASKER CERTIFIED SOLUTION
Avatar of kretzschmarkretzschmar🇩🇪

Link to home
membership
Log in or create a free account to see answer.
Signing up is free and takes 30 seconds. No credit card required.
Create Account

It works fine when I don't write on a blob field, so, when I write some text, it shows an error: "internal error" .
Do you know why?

Update your IBX to latest 7.05
Find at
Codecentral.Borland.com
the page of Jeff Overcash

Bojidar Alexandrov

Free T-shirt

Get a FREE t-shirt when you ask your first question.

We believe in human intelligence. Our moderation policy strictly prohibits the use of LLM content in our Q&A threads.


If you can help me with the internal error, I'd appreciate.

Thanks, Alexandre
Delphi

Delphi

--

Questions

--

Followers

Top Experts

Delphi is the most powerful Object Pascal IDE and component library for cross-platform Native App Development with flexible Cloud services and broad IoT connectivity. It provides powerful VCL controls for Windows 10 and enables FMX development for Windows, Mac and Mobile. Delphi is your choice for ultrafast Enterprise Strong Development™. Look for increased memory for large projects, extended multi-monitor support, improved Object Inspector and much more. Delphi is 5x faster for development and deployment across multiple desktop, mobile, cloud and database platforms including 32-bit and 64-bit Windows 10.