Subject RE: [ib-support] Re: FB drop table
Author Szakály Balázs
Yes, but i wrote: "> Delete all opened dbExpress sql query, prepared
command, etc."
I destroy all prepared dataset, then this first unprepare yourself.


Szakály Balázs
szoftver fejlesztő
szakalyb@...
www.microraab.hu
GSM: +36(30)9363639
Tel: +36(96)510738
Fax: +36(96)510719
-----Original Message-----
From: robert_hollay [mailto:rhollay@...]
Sent: Monday, December 02, 2002 2:27 PM
To: ib-support@yahoogroups.com
Subject: [ib-support] Re: FB drop table


Hi, Balázs

I don't know whether using temporary tables in FB is discouraged
or not, but I think your problem is the following:
"While a dataset is prepared, it creates an active statement that
lasts until the dataset is unprepared..."
So, you can try:

BEGITRAN
CREATE TABLE TMP_ANY
COMMIT

BEGINTRAN //MySQLConnection.StartTransaction(TD);
INSERT, DELETE, SELECT , etc... on TMP_ANY
COMMIT //MySQLConnection.Commit(TD);
MyDataSet.Prepared := FALSE; // <-- unprepare the dataset

YOU MUST UNPREPARE ALL DATASETS WITH DML COMMANDS (SELECT, UPDATE,
INSERT, DELETE) !!!

Üdvözlet,
Robi


--- In ib-support@y..., Szakály Balázs <szakalyb@f...> wrote:
> Hi!
>
> I have a problem with drop table command.
>
> I use borland dbExpress to connect Firebird server on Win2k. I
connect
> with only one connection to FB.
>
> I must create a table to process any data and drop after prcessing.
>
> BEGITRAN
> CREATE TABLE TMP_ANY
> COMMIT
>
> BEGINTRAN
> INSERT, DELETE, SELECT , etc... on TMP_ANY
> COMMIT
>
> Delete all opened dbExpress sql query, prepared command, etc.
>
> BEGINTRAN
> DROP TABLE TMP_AKARMI
> COMMIT <- here i get 'Unsuccesful metadata update. The object is in
> use.'
>
> But there is not any other connection, or any opened, prepared sql.
>
> How can-i drop table from code?
>
> ((((sorry my english))))
> -----------------------
> Szakály Balázs
> szakalyb@m...
> www.microraab.hu
> GSM: +36(30)9363639
> Tel: +36(96)510738
> Fax: +36(96)510719