Board index » delphi » Table does not exists - No key specified ???

Table does not exists - No key specified ???

Hello

I created new form, put there SQLConnection, SQLDataset, Datasetprovider,
Clientdataset, datasource, dbgrid and button. I didn't specify any options
on any of these components. After changing some fields in a record I wanted
to call ApplyUpdates and I got an error:

ORA-00942 table or view does not exists. (but data is read good, so table
name is correct)

and second message I got:

.....'Unable to find record. No key specified.'.....

Then I realised that when I use select * from TSTRED instead os select *
from tstred everything is OK. So it means that Delphi tries to use update in
the form update "tstred" set .... and in this case it is important if table
name is in uppercase or not.

It's quite confusing because select works fine but no update.

Can anyone of you tell me if there is some property specifying not to use
double quotas?

thx
Jaro

 

Re:Table does not exists - No key specified ???


Try setting the table name in your provider's OnGetTableName event. Also,
make sure your key fields are defined in the SQLDataSet by specifying
pfInkey in the ProviderFlags of the TField.

Natalie

Quote
"Jaro" <j...@molis.be> wrote in message news:3bfa4658$1_1@dnews...
> Hello

> I created new form, put there SQLConnection, SQLDataset, Datasetprovider,
> Clientdataset, datasource, dbgrid and button. I didn't specify any options
> on any of these components. After changing some fields in a record I
wanted
> to call ApplyUpdates and I got an error:

> ORA-00942 table or view does not exists. (but data is read good, so table
> name is correct)

> and second message I got:

> .....'Unable to find record. No key specified.'.....

Re:Table does not exists - No key specified ???


And set the where flags to just the key.
Quote
Natalie Boodram wrote:
> Try setting the table name in your provider's OnGetTableName event. Also,
> make sure your key fields are defined in the SQLDataSet by specifying
> pfInkey in the ProviderFlags of the TField.

> Natalie

> "Jaro" <j...@molis.be> wrote in message news:3bfa4658$1_1@dnews...

>>Hello

>>I created new form, put there SQLConnection, SQLDataset, Datasetprovider,
>>Clientdataset, datasource, dbgrid and button. I didn't specify any options
>>on any of these components. After changing some fields in a record I

> wanted

>>to call ApplyUpdates and I got an error:

>>ORA-00942 table or view does not exists. (but data is read good, so table
>>name is correct)

>>and second message I got:

>>.....'Unable to find record. No key specified.'.....

Re:Table does not exists - No key specified ???


By the way, the fact that you retrieved the data does not necessarily mean that
the tablename you specified is correct.  For example, if you have a table on an
Oracle server 'USER.TABLENAME' and you refer it as 'user.tablename', Oracle will
automatically uppercase the object name since you are not using the quote char.
However, when you do an ApplyUpdates, DataSnap will add the quote char to the
update query, and Oracle will then report that the table 'user.tablename' does
not exist.

John Keegan

Delphi R&D

Quote
Jaro wrote:
> Hello

> I created new form, put there SQLConnection, SQLDataset, Datasetprovider,
> Clientdataset, datasource, dbgrid and button. I didn't specify any options
> on any of these components. After changing some fields in a record I wanted
> to call ApplyUpdates and I got an error:

> ORA-00942 table or view does not exists. (but data is read good, so table
> name is correct)

> and second message I got:

> .....'Unable to find record. No key specified.'.....

> Then I realised that when I use select * from TSTRED instead os select *
> from tstred everything is OK. So it means that Delphi tries to use update in
> the form update "tstred" set .... and in this case it is important if table
> name is in uppercase or not.

> It's quite confusing because select works fine but no update.

> Can anyone of you tell me if there is some property specifying not to use
> double quotas?

> thx
> Jaro

Other Threads