Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Chris Miller on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Table is read only error

Status
Not open for further replies.

cpmasesa

Programmer
Oct 24, 2002
78
AE
Hi
I am attempting to execute this sql but I get a table is read only error BDE error code 10763
select movie.*
from movie m, personmovieroles pmr, zpersons p
where m.movieid = pmr.pmmovieid
and pmr.pmpersonid = p.personid
and pmr.pmpersonid = 626

what I'm trying to do is get a list of movie titles in which a particular person has featured
I have 3 tables, Movies, persons, and person movie roles

could someone please tell me why I get the "Table is read only" error

TIA

cpmasesa
 
try, see if it is better

select [red]m[/red].*
from movie m, personmovieroles pmr, zpersons p
where m.movieid = pmr.pmmovieid
and pmr.pmpersonid = p.personid
and pmr.pmpersonid = 626


It may run faster if you use an inner join - depends how big the tables are.
 
The table is readonly message normally occurs because your query is referencing more than one table, so it doesn't know which you are trying to update. Robertio
Alias: Robbie Calder
Software Developer
urc@walkermartyn.co.uk
 
I have also seen the read-only when people bring data tables from CD's and in folder rights issues on NT/2000/xp.
 
She's only trying to read it! That's all a SELECT statement does!

It could be since you are returning everything from all tables it has a problem with mulitple fields named movieid and personid since those fields are in multiple tables.

Try using the INNER JOIN syntax:

so movie has movieid,
person has personid
personmovieroles has movieid and personid

Code:
select *  
from movie m
inner join personmovieroles pmr on m.movieid = pmr.movieid
where pmr.pmpersonid = 626

to find all the people's names from a particular movie you would do:
Code:
select * from person p
inner join personmovieroles pmr on p.personid = pmr.personid 
where pmr.movieid = 16

Also you say you are trying to 'execute' the SQL. With SQL statements that are SELECT you use Query.Active := True; with SQL INSERT or UPDATE statements you use Query.ExecSQL.

Good Luck!

Leslie
landrews@metrocourt.state.nm.us

SELECT * FROM USERS WHERE CLUE > 0
No Rows Returned
 
Sorry about that. I guess I should actually read the post before responding. We don't use SQL much, so my eyes glaze over when I see it. We do run into lots of read only error with the bde.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top