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

Another Firebird/Delphi Q....

I want to empty a table of a firebird db with truncate as i know and no to delete using the delete statement.

here what i'd try but i get an error...

 ibquery1.SQL.Text:='Truncate from people';
            ibquery1.ExecSQL;
                ibtransaction1.Commit;

which is the right way to empty(truncate) table?
0
Alex
Asked:
Alex
  • 3
  • 3
1 Solution
 
ziolkoCommented:
i'm not sure but i think TRUNCATE TABLE is supported by MSSQL not by firebird

ziolko.
0
 
AlexSoftware EngineerAuthor Commented:
hmm... so is there a way to empty the table except of the delete statement?
0
 
ziolkoCommented:
you can either use: delete from table_name or drop table table_name
but droping means not only removing all data rows but also removing table from db schema, so i'm afraid you have to stick to delete from table_name. is there any reason why you dont want to use it?

ziolko.
0
Cloud Class® Course: C++ 11 Fundamentals

This course will introduce you to C++ 11 and teach you about syntax fundamentals.

 
AlexSoftware EngineerAuthor Commented:
yes i know about drop... i am new only  in firebird, i know sql commands what doing :-) i just wondering if i can use and to the firebird the truncate statement...
0
 
ziolkoCommented:
nope, there's no truncate on firebird

ziolko.
0
 
AlexSoftware EngineerAuthor Commented:
as i search yes you are right... in the firebird i can not use truncate but only delete.thank you again ziolko.
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

Free Tool: Site Down Detector

Helpful to verify reports of your own downtime, or to double check a downed website you are trying to access.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

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