Odd message, updating a view with no primary key

I've created this view and upon opening it I'm getting this od

Page 1 of 1

1 Replies - 1065 Views - Last Post: 05 September 2007 - 11:36 AM Rate Topic: -----

#1 stingray2772  Icon User is offline

  • New D.I.C Head

Reputation: 2
  • View blog
  • Posts: 48
  • Joined: 12-February 06

Odd message, updating a view with no primary key

Post icon  Posted 05 September 2007 - 07:34 AM

So I have a set of tables and I need to get data from them. The tables consist of

tbldevice
-----
deviceid
modelid
serialnumber
firmwareversion

tblmodel
-----
modelid
modelnumber

tblsystemsettings
-----
deviceid
settings
powersupplyconfig

tblprocesssignature
-----
processsignatureid
processid
deviceid

tblpowercalibration
-----
powerid
processsignatureid
powertable
adcvalues
rfpower

tblgaincalibration
-----
gainid
processsignatureid
gaintable
temperatures
attenuations
dacvalues
nominalgain


A quick run down shows...
tblmodel.modelid = tbldevice.modelid
tblsystemsettings.deviceid = tbldevice.deviceid
tblprocesssignature.deviceid = tbldevice.deviceid
tblpowercalibration.processsignatureid = tblprocesssignature.processsignatureid
tblgaincalibration.processsignatureid = tblprocesssignature.processsignatureid

Now if I just pull out the data, a deviceid can have multiple rows in the tblpowercalibration and tblgaincalibration tables. So I want to use the max powerid and gainid. This data will be pulled out for project, so I wanted to make a view for this. The view is as follows...

select `ataf`.`tbldevice`.`deviceid` AS `deviceid`,`ataf`.`tbldevice`.`firmwareversion` AS `firmwareversion`,`ataf`.`tblmodel`.`modelid` AS `modelid`,`ataf`.`tblmodel`.`modelnumber` AS `modelnumber`,`ataf`.`tblsystemsettings`.`settings` AS `settings`,`ataf`.`tblsystemsettings`.`powersupplyconfig` AS `powersupplyconfig`,`ataf`.`tblpowercalibration`.`rfpower` AS `rfpower`,`ataf`.`tblpowercalibration`.`adcvalues` AS `adcvalues`,`ataf`.`tblpowercalibration`.`powertable` AS `powertable`,`ataf`.`tblgaincalibration`.`nominalgain` AS `nominalgain`,`ataf`.`tblgaincalibration`.`dacvalues` AS `dacvalues`,`ataf`.`tblgaincalibration`.`attenuations` AS `attenuations`,`ataf`.`tblgaincalibration`.`temperatures` AS `temperatures`,`ataf`.`tblgaincalibration`.`gaintable` AS `gaintable`,max(`ataf`.`tblgaincalibration`.`id`) AS `gainID`,max(`ataf`.`tblpowercalibration`.`id`) AS `powerID` from (((((`ataf`.`tbldevice` join `ataf`.`tblmodel` on((`ataf`.`tbldevice`.`modelid` = `ataf`.`tblmodel`.`modelid`))) left join `ataf`.`tblsystemsettings` on((`ataf`.`tbldevice`.`deviceid` = `ataf`.`tblsystemsettings`.`deviceid`))) join `ataf`.`tblprocesssignature` on((`ataf`.`tblprocesssignature`.`deviceid` = `ataf`.`tbldevice`.`deviceid`))) left join `ataf`.`tblpowercalibration` on((`ataf`.`tblprocesssignature`.`processsignatureid` = `ataf`.`tblpowercalibration`.`processsignatureid`))) left join `ataf`.`tblgaincalibration` on((`ataf`.`tblprocesssignature`.`processsignatureid` = `ataf`.`tblgaincalibration`.`processsignatureid`))) group by `ataf`.`tbldevice`.`deviceid` order by `ataf`.`tbldevice`.`deviceid`


When I run this view I get the following...

webdata does not have a primary key.
Updates to this table will be done using the following pseudo statement:
Update webdata SET "ModifiedFieldsAndValues" WHERE "AllFieldsAndOldValues" LIMIT 1

Can anybody explain to me why I'm getting this message? If I need to explain things more I can. Thanks in advance.

Is This A Good Question/Topic? 0
  • +

Replies To: Odd message, updating a view with no primary key

#2 PsychoCoder  Icon User is offline

  • Google.Sucks.Init(true);
  • member icon

Reputation: 1633
  • View blog
  • Posts: 19,853
  • Joined: 26-July 07

Re: Odd message, updating a view with no primary key

Posted 05 September 2007 - 11:36 AM

What database are you using?

<edit>PLEASE put your code in code blocks (button with the % on it in the tool bar)</edit>

This post has been edited by PsychoCoder: 05 September 2007 - 11:37 AM

Was This Post Helpful? 0
  • +
  • -

Page 1 of 1