Solved

Am I missing a database update?

Posted on 2004-03-25
5
204 Views
Last Modified: 2010-05-19
Im using interbase as my back end db.

Im updating a record using a TIBQuery, setting the params and using ExecSQL command to execute it.
The record seems to be updating in the grids etc I am using, but when I use another query to retrieve data fom the table Ive updated it doesnt seem to be there.
If I shut the program down again and restart, the information then appears.

Im not using cached updates.

Whe I use the execsql, do I need to apply/commit somewhere?
I cant do applydates on the dataset as it is closed (just using execsql command to update)
0
Comment
Question by:mikelittlewood
  • 3
  • 2
5 Comments
 
LVL 27

Expert Comment

by:kretzschmar
ID: 10677834
yep, seems that a commit is missed
0
 
LVL 15

Author Comment

by:mikelittlewood
ID: 10678827
hmm ...

what part of the code needs the commit?
If I put it after execsql it won't compile.
Which object needs the .commit?
Or is there a commit setting on the object Im missin?
0
 
LVL 15

Author Comment

by:mikelittlewood
ID: 10678856
I thought if your query is just -

update TABLE set blah blah blah

- then execsql would just update the record and commit automatically (bearing in mind no cache updates)
0
 
LVL 27

Accepted Solution

by:
kretzschmar earned 50 total points
ID: 10679658
sorry for delay, was absent

usual u have three components

IBDatabase -> for connection
IBTransaction -> for TransactionControl
IBQuery -> for DDL/DML SQL-Statements

simplest use

IBQuery.ExecSQL;
IBTransaction.Commit;  

// IBTransaction must assigned at the property Transaction of the IBQuery
//usual an assgniment should be enough to commit automatically
//if the properties of the IBTransaction are left as default
//<-- means no explicit commit must be done

hope thats it

meikl ;-)
0
 
LVL 15

Author Comment

by:mikelittlewood
ID: 10679802
Got it working :)

thx again ... I just need that odd poke in the right direction sometimes :)
0

Featured Post

What Is Threat Intelligence?

Threat intelligence is often discussed, but rarely understood. Starting with a precise definition, along with clear business goals, is essential.

Join & Write a Comment

A lot of questions regard threads in Delphi.   One of the more specific questions is how to show progress of the thread.   Updating a progressbar from inside a thread is a mistake. A solution to this would be to send a synchronized message to the…
Have you ever had your Delphi form/application just hanging while waiting for data to load? This is the article to read if you want to learn some things about adding threads for data loading in the background. First, I'll setup a general applica…
Internet Business Fax to Email Made Easy - With eFax Corporate (http://www.enterprise.efax.com), you'll receive a dedicated online fax number, which is used the same way as a typical analog fax number. You'll receive secure faxes in your email, fr…
When you create an app prototype with Adobe XD, you can insert system screens -- sharing or Control Center, for example -- with just a few clicks. This video shows you how. You can take the full course on Experts Exchange at http://bit.ly/XDcourse.

758 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

22 Experts available now in Live!

Get 1:1 Help Now