I have strange problem while using Prepare statement.
I have a table
create table tab
(
Time datetime not null,
a uniqueidentifier not null
);
and call a statement:
select *
from tab
-- some comment
where a < :param
After calling prepare on that statement I can't work with database anymore.
This only happens if the table looks like that (datetime and uniqueidentifier). When columns are another type then it works fine.
The same thing is when there is no comment in sql statement.
Then it works ok.
But when a comment is befoer 'where' word then it crashes my database, and I cant work with it anymore.
Anyone had the same problem or resolved it?
Or maybe this is a bug?
Kind regards
Bagieta
Bug or something
There is no connection with "greater" or "less" sing. There can also be a "=" sign.
To reproduce this situation try to use MSDE.
Create this table, execute or prepare that statement.
Then some error occurs. But it is ok.
The trouble is when you try to open another query. It gives you no records. The strange thing is that you can see the right columns but there are no data in the tables at all.
F.ex. try folowing query:
"select * from sysobjects"
I have no data in it after querying this problematic query.
This is not a big error for me but I only wanted to tell you that there is such a problem. Maybe in future you will meet something similar.
To reproduce this situation try to use MSDE.
Create this table, execute or prepare that statement.
Then some error occurs. But it is ok.
The trouble is when you try to open another query. It gives you no records. The strange thing is that you can see the right columns but there are no data in the tables at all.
F.ex. try folowing query:
"select * from sysobjects"
I have no data in it after querying this problematic query.
This is not a big error for me but I only wanted to tell you that there is such a problem. Maybe in future you will meet something similar.