Board index » delphi » Using TIBQuery to alter and manipulate an Interbase database

Using TIBQuery to alter and manipulate an Interbase database

I'm trying to manipulate an Interbase database using TIBQuery. I've
got the connection to the database but I seem to be getting an error
with the SQL.

I add the following statements to my query :
Query.SQL.Add('DROP TRIGGER "INS_TRANSACTIONS";');
Query.SQL.Add('');
Query.SQL.Add('DROP PROCEDURE "TRNSFR_REFERENCENUMBER";');

I get the following error:
SQL error code = -104
Token unknown - line 3, char - 1
DROP'. Process stopped. Use step or run to continue.

If I use Interbase console the SQL statements work but they don't want
to work in Delphi.

Any help would be appreciated.

Thank you,
B. Duguay

 

Re:Using TIBQuery to alter and manipulate an Interbase database


Thank you.

On Mon, 15 Jul 2002 19:25:29 -0400, "Wayne Niddery [TeamB]"

Quote
<wnidd...@chaffaci.on.ca.com> wrote:
>"B. Duguay" <techni...@StoneOrchardSoftware.com> wrote in message
>news:3d332ea9.112701195@newsgroups.borland.com...
>> I'm trying to manipulate an Interbase database using TIBQuery. I've
>> got the connection to the database but I seem to be getting an error
>> with the SQL.

>> I add the following statements to my query :
>> Query.SQL.Add('DROP TRIGGER "INS_TRANSACTIONS";');
>> Query.SQL.Add('');
>> Query.SQL.Add('DROP PROCEDURE "TRNSFR_REFERENCENUMBER";');

>> I get the following error:
>> SQL error code = -104
>> Token unknown - line 3, char - 1
>> DROP'. Process stopped. Use step or run to continue.

>You can only execute one statement at a time using a query component:

> Query.SQL.Text := 'DROP TRIGGER "INS_TRANSACTIONS";';
> Query.SQL.ExecQuery;
> Query.SQL.Text := 'DROP PROCEDURE "TRNSFR_REFERENCENUMBER";';
> Query.SQL.ExecQuery;

>--
>Wayne Niddery (Logic Fundamentals, Inc.)
>RADBooks: http://www.logicfundamentals.com/RADBooks/delphibooks.html
>Those who disdain wealth as a worthy goal for an individual or a society
>seem not to realize that wealth is the only thing that can prevent
>poverty. - Thomas Sowell

Re:Using TIBQuery to alter and manipulate an Interbase database


Quote
"B. Duguay" <techni...@StoneOrchardSoftware.com> wrote in message

news:3d332ea9.112701195@newsgroups.borland.com...

Quote
> I'm trying to manipulate an Interbase database using TIBQuery. I've
> got the connection to the database but I seem to be getting an error
> with the SQL.

> I add the following statements to my query :
> Query.SQL.Add('DROP TRIGGER "INS_TRANSACTIONS";');
> Query.SQL.Add('');
> Query.SQL.Add('DROP PROCEDURE "TRNSFR_REFERENCENUMBER";');

> I get the following error:
> SQL error code = -104
> Token unknown - line 3, char - 1
> DROP'. Process stopped. Use step or run to continue.

You can only execute one statement at a time using a query component:

 Query.SQL.Text := 'DROP TRIGGER "INS_TRANSACTIONS";';
 Query.SQL.ExecQuery;
 Query.SQL.Text := 'DROP PROCEDURE "TRNSFR_REFERENCENUMBER";';
 Query.SQL.ExecQuery;

--
Wayne Niddery (Logic Fundamentals, Inc.)
RADBooks: http://www.logicfundamentals.com/RADBooks/delphibooks.html
Those who disdain wealth as a worthy goal for an individual or a society
seem not to realize that wealth is the only thing that can prevent
poverty. - Thomas Sowell

Other Threads