Board index » delphi » EDBEngineError: "Operation not applicable.", when trying to execute a query

EDBEngineError: "Operation not applicable.", when trying to execute a query

I am attempting to insert a record into an InterBase database, using a
TQuery component.  I have set the sql to be roughly, "INSERT INTO MYTABLE
(A,B,C,D) VALUES (:A,:B,:C,:D);"
And of course, Query1.ParamByName('A').AsString := A;, etc, etc.

As soon as I call ExecSQL, I get the exception, EDBEngineError: "Operation
not applicable".

Using SQL Monitor, I observe that the INSERT statement never gets sent to
InterBase (doesn't show up in the monitor).  So for some reason the BDE
doesn't like my query, and wont sent it through to InterBase.

I'm stumped.  Any help would be appreciated :-) Thanks in advance!

--

{
   Dave Calkins, <dc...@erols.com>,
   New River Kinematics,
   MEDBASE SYSTEMS

Quote
};

 

Re:EDBEngineError: "Operation not applicable.", when trying to execute a query


David,

Sorry to ask the obvious, but, you are not trying to OPEN the query
are you?

Does your SQL work (with the parameters substituted for values) in
WISQL?

Is your database connection OK (ie you have other queries working)?

Good luck :-)

Brian

Quote
David Calkins wrote in message <6c319a$i...@forums.borland.com>...
>I am attempting to insert a record into an InterBase database, using
a
>TQuery component.  I have set the sql to be roughly, "INSERT INTO
MYTABLE
>(A,B,C,D) VALUES (:A,:B,:C,:D);"
>And of course, Query1.ParamByName('A').AsString := A;, etc, etc.

>As soon as I call ExecSQL, I get the exception, EDBEngineError:
"Operation
>not applicable".

>Using SQL Monitor, I observe that the INSERT statement never gets
sent to
>InterBase (doesn't show up in the monitor).  So for some reason the
BDE
>doesn't like my query, and wont sent it through to InterBase.

>I'm stumped.  Any help would be appreciated :-) Thanks in advance!

>--

>{
>   Dave Calkins, <dc...@erols.com>,
>   New River Kinematics,
>   MEDBASE SYSTEMS
>};

Re:EDBEngineError: "Operation not applicable.", when trying to execute a query


David,

Don't know if this'll help, but have you tried removing the ";" from the
end of the SQL statement.  The BDE seems to balk at these things (even
though we all know that they belong there!).

HTH - Mike

--
==========================================================
=  Beauty = class(Thing)
=
=  ie: A Thing of Beauty is (still) a Thing...
==========================================================

Re:EDBEngineError: "Operation not applicable.", when trying to execute a query


Thanks for the replys! :-)  I figured out my problem.  One of the fields in
my table was a boolean (actually a varchar(1), which is either "T" or "F").
I was trying to do

    ParamByName('...').AsBoolean := False;

To get it to work, you must instead do

    ParamByName('...').AsString := 'F';

This is VERY strange, because I have been able to do the following
successfully

    FieldByName('...').AsBoolean := False;

--

{
   Dave Calkins, <dc...@erols.com>,
   New River Kinematics,
   MEDBASE SYSTEMS

Quote
};
David Calkins wrote in message <6c319a$i...@forums.borland.com>...
>I am attempting to insert a record into an InterBase database, using a
>TQuery component.  I have set the sql to be roughly, "INSERT INTO MYTABLE
>(A,B,C,D) VALUES (:A,:B,:C,:D);"
>And of course, Query1.ParamByName('A').AsString := A;, etc, etc.

>As soon as I call ExecSQL, I get the exception, EDBEngineError: "Operation
>not applicable".

>Using SQL Monitor, I observe that the INSERT statement never gets sent to
>InterBase (doesn't show up in the monitor).  So for some reason the BDE
>doesn't like my query, and wont sent it through to InterBase.

>I'm stumped.  Any help would be appreciated :-) Thanks in advance!

>--

>{
>   Dave Calkins, <dc...@erols.com>,
>   New River Kinematics,
>   MEDBASE SYSTEMS
>};

Other Threads