• Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 266
  • Last Modified:

Another Firebird/delphi problem

I want to update a record of a field.

i have a table "people" with some fields and one of them has the name counter and it has a value for example 123 and i want with delphi to update this value and set it to 0.

I do this

 IBQuery2.SQL.Text:='UPDATE people SET COUNTER="0"';
     IBQuery2.ExecSQL;

but i get an error:
------------------------
Sql error code=-206
column unknown
0
------------------------
0
Alex
Asked:
Alex
1 Solution
 
MerijnBSr. Software EngineerCommented:
COUNTER suggests that the field is an integer

I'd expect something like:  IBQuery2.SQL.Text:='UPDATE people SET COUNTER=0';
0
 
ziolkoCommented:
is counter name of field in table people?


ziolko.
0
 
AlexSoftware EngineerAuthor Commented:
MerijnB yes you are right, i am an idiot i know that the " " is for a string and if the field is an integer you put it without " "  but my mind maybe stops working for a few minutes ;)

i remove the "" and it is ok now!

thank you MerijnB.

thank you ziolko for the post again.
0
 
Nick UpsonPrincipal Operations EngineerCommented:
just to be pedantic its ' ' around a string not " "
0
 
AlexSoftware EngineerAuthor Commented:
Yes, thank you NickUpson for the post ;)
0
Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.

Join & Write a Comment

Featured Post

Improve Your Query Performance Tuning

In this FREE six-day email course, you'll learn from Janis Griffin, Database Performance Evangelist. She'll teach 12 steps that you can use to optimize your queries as much as possible and see measurable results in your work. Get started today!

Tackle projects and never again get stuck behind a technical roadblock.
Join Now