MySQL Forums
Forum List  »  Views

Cannot edit data in view
Posted by: Kenny Holmes
Date: April 18, 2014 09:28AM

Hi,
I am having trouble editing data in a view. I am used to using Microsoft Access and am relatively new to MySQL. I have tried this same query in Access and it updates fine, but the view in MySQL is not editable.

The view references 2 tables which are created as follows.

CREATE TABLE `tblSponsors` (
`SponsorID` int(11) unsigned NOT NULL AUTO_INCREMENT,
`SponsorName` varchar(50) DEFAULT NULL,
`SponsorPhoneNo` varchar(45) DEFAULT NULL,
`SponsorLink` varchar(45) DEFAULT NULL,
`SponsorImage` mediumblob,
`SponsorNote` varchar(255) DEFAULT NULL,
`CompetitionYear` smallint(6) DEFAULT NULL,
PRIMARY KEY (`SponsorID`)

CREATE TABLE `tblCompetitionSponsors` (
`CompetitionID` int(11) NOT NULL,
`SponsorIDCS` int(11) NOT NULL,
PRIMARY KEY (`CompetitionID`,`SponsorIDCS`)

VIEW `qryCompetitionSponsors` AS
select
`tblCompetitionSponsors`.`CompetitionID` AS `CompetitionID`,
`tblCompetitionSponsors`.`SponsorIDCS` AS `SponsorIDCS`,
`tblSponsors`.`SponsorID` AS `SponsorID`,
`tblSponsors`.`SponsorName` AS `SponsorName`,
`tblSponsors`.`SponsorPhoneNo` AS `SponsorPhoneNo`,
`tblSponsors`.`SponsorLink` AS `SponsorLink`,
`tblSponsors`.`SponsorImage` AS `SponsorImage`,
`tblSponsors`.`SponsorNote` AS `SponsorNote`,
`tblSponsors`.`CompetitionYear` AS `CompetitionYear`
from
(`tblSponsors`
left join `tblCompetitionSponsors` ON ((`tblSponsors`.`SponsorID` = `tblCompetitionSponsors`.`SponsorIDCS`)))

Can anyone offer a possible solution to make this view editable?

Cheers

Kenny

Options: ReplyQuote


Subject
Views
Written By
Posted
Cannot edit data in view
4826
April 18, 2014 09:28AM
1520
April 18, 2014 12:09PM
1498
April 22, 2014 07:05AM
1392
April 22, 2014 11:09AM
1510
April 23, 2014 09:28AM
1754
April 23, 2014 10:10AM


Sorry, you can't reply to this topic. It has been closed.

Content reproduced on this site is the property of the respective copyright holders. It is not reviewed in advance by Oracle and does not necessarily represent the opinion of Oracle or any other party.