Board index » delphi » Not uniquely indexed?

Not uniquely indexed?

Hi everybody,

does anybody ever came across this message?:

"Table does not support this operation because is is not uniquely
indexed."

This happens in my application as a result of a 'refresh' on a query.
The table out of which the refresh retrieves it's data (through a
parameterized query) is definitely indexed, both with a primary key and
a unique index.
When my application references paradox-tables it does not occur. No
problems with any data-manipulation whatsoever.  But when i change the
alias in de DBE so that it addresses a MS-SQL-server it suddenly
terrorize me with this. If i suppress the refresh no error-message come
up. (And any data-manipulation does get committed. So no problems with
uniqueness of keys or whatever data-constraints there may be.)

Any ideas?

Oscar

P.S
You may want to see the query 'at hand'. Here it is:

select * from Tumor
WHERE statusnr = :StatusNr
 and not ( diagnose is null and tumorsys = 1 )

the table Tumor has a (the) primary key on <statusnr,tumorsys>

 

Re:Not uniquely indexed?


Refresh probably wouldn't work anyway... you might want to try closing and
reopening the query to do a decent refresh.

--

Martijn Tonies
Upscene Productions

For Delphi Components and InterBase tools:
http://www.upscene.com

Quote
"Oscar Schoof" <o...@xs4all.nl> wrote in message

news:38627EDA.B7E1B692@xs4all.nl...
Quote
> Hi everybody,

> does anybody ever came across this message?:

> "Table does not support this operation because is is not uniquely
> indexed."

> This happens in my application as a result of a 'refresh' on a query.
> The table out of which the refresh retrieves it's data (through a
> parameterized query) is definitely indexed, both with a primary key and
> a unique index.
> When my application references paradox-tables it does not occur. No
> problems with any data-manipulation whatsoever.  But when i change the
> alias in de DBE so that it addresses a MS-SQL-server it suddenly
> terrorize me with this. If i suppress the refresh no error-message come
> up. (And any data-manipulation does get committed. So no problems with
> uniqueness of keys or whatever data-constraints there may be.)

> Any ideas?

> Oscar

> P.S
> You may want to see the query 'at hand'. Here it is:

> select * from Tumor
> WHERE statusnr = :StatusNr
>  and not ( diagnose is null and tumorsys = 1 )

> the table Tumor has a (the) primary key on <statusnr,tumorsys>

Re:Not uniquely indexed?


Quote
Martijn Tonies wrote:
> Refresh probably wouldn't work anyway...

I do not understand your response. The refresh did work in my paradox
environment.
Now i am curious why you suppose it wouldn't work anyway? Any technical
reasons for that?

Quote
> you might want to try closing and reopening the query...

Why do you suppose Delphi supports a Refresh method?

Oscar

Re:Not uniquely indexed?


Hi there,

Quote
> > Refresh probably wouldn't work anyway...

> I do not understand your response. The refresh did work in my paradox
> environment.
> Now i am curious why you suppose it wouldn't work anyway? Any technical
> reasons for that?

Yep. The BDE and the underlying database need to support it.

Closing and opening the query (actually, re-querying) makes sure you have
the latest data...

Quote

> > you might want to try closing and reopening the query...

> Why do you suppose Delphi supports a Refresh method?

For local database tables (Paradox, dBase etc...), it works then.

--

Martijn Tonies
Upscene Productions

For Delphi Components and InterBase tools:
http://www.upscene.com

Re:Not uniquely indexed?


Quote
> Yep. The BDE and the underlying database need to support it.
> For local database tables (Paradox, dBase etc...), it works then.

I think you mean that in SQL there is no statement defined that acts as
'refresh'. That is why it did work in a Paradox-setting and not with a
SQL-database.
Ok, i can grab that.

Oscar

Other Threads