• Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 752
  • 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
Concerto's Cloud Advisory Services

Want to avoid the missteps to gaining all the benefits of the cloud? Learn more about the different assessment options from our Cloud Advisory team.

 
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

Featured Post

Keep up with what's happening at Experts Exchange!

Sign up to receive Decoded, a new monthly digest with product updates, feature release info, continuing education opportunities, and more.

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