Error Updating a record with a stored procedure


Author
Message
Rob Toyias
Rob Toyias
StrataFrame Beginner (47 reputation)StrataFrame Beginner (47 reputation)StrataFrame Beginner (47 reputation)StrataFrame Beginner (47 reputation)StrataFrame Beginner (47 reputation)StrataFrame Beginner (47 reputation)StrataFrame Beginner (47 reputation)StrataFrame Beginner (47 reputation)StrataFrame Beginner (47 reputation)
Group: Forum Members
Posts: 31, Visits: 179
Trying to update a record using a stored procedure I recieve the following error:

Trying to update a record I recieve the following error:"Cannot create UPDATE command because a business object with PrimaryKeyIsAutoIncremented = True must have exactly 1 primary key field"

This error makes sense since I have specified two keys for the table I'm updating.  Now I'm not here to discuss the merits of combined keys (not my database design) I'd like to know how to best handle this situation.  If I don't specify both fields as keys then the delete SP call does not send both fields.  If I do set up two keys then I get the above error.  And since the database is most definatly handling the field incrementing turning that off seems a bad idea.  Is there an easy way around this or do I need to go hog tie our DBA?  btw, if it matters this is Oracle (of course).

thanks

Replies
Rob Toyias
Rob Toyias
StrataFrame Beginner (47 reputation)StrataFrame Beginner (47 reputation)StrataFrame Beginner (47 reputation)StrataFrame Beginner (47 reputation)StrataFrame Beginner (47 reputation)StrataFrame Beginner (47 reputation)StrataFrame Beginner (47 reputation)StrataFrame Beginner (47 reputation)StrataFrame Beginner (47 reputation)
Group: Forum Members
Posts: 31, Visits: 179
Additionally, I set the PrimaryKeyIsAutoIncremented property to false, try my update and it errors out because it actually sends the two feilds I set as primary keys twice in the parameters list.  This seems like a bug. 

So to address this I tried including the two fields I set as keys in the FieldsToExcludeFromUpdate list and tried my update again.  This time I get an error about keys not existing in the table.

What am I doing wrong here? 

Trent Taylor
Trent Taylor
StrataFrame Developer (14K reputation)StrataFrame Developer (14K reputation)StrataFrame Developer (14K reputation)StrataFrame Developer (14K reputation)StrataFrame Developer (14K reputation)StrataFrame Developer (14K reputation)StrataFrame Developer (14K reputation)StrataFrame Developer (14K reputation)StrataFrame Developer (14K reputation)
Group: StrataFrame Developers
Posts: 6.6K, Visits: 7K
Rob,

I do not beleive this is a bug, but I never like to rule anything out Smile.  It sounds to me that the sproc is not correct.  Based on this thread alone there is not enough information to diagnose your problem.  The first thing that I would do is turn on debugging for your data source:

MicroFour.StrataFrame.Data.Databasics.DataSources("").SetDebugOn("c:\MyOutput.html",True)

This will show you what is being sent via the DAL to the database.  You could then compare this to the actual SPROC to see what is going on.  This is the first place I would look.

Trent Taylor
Trent Taylor
StrataFrame Developer (14K reputation)StrataFrame Developer (14K reputation)StrataFrame Developer (14K reputation)StrataFrame Developer (14K reputation)StrataFrame Developer (14K reputation)StrataFrame Developer (14K reputation)StrataFrame Developer (14K reputation)StrataFrame Developer (14K reputation)StrataFrame Developer (14K reputation)
Group: StrataFrame Developers
Posts: 6.6K, Visits: 7K
One more thing, you may want to look at this post as well: http://forum.strataframe.net/FindPost11014.aspx

Do a search of the forum for Oracle and you will find a lot fo threads where other developers have setup SPs for Oracle which may give you some ideas.

GO

Merge Selected

Merge into selected topic...



Merge into merge target...



Merge into a specific topic ID...




Threaded View
Threaded View
Rob Toyias - 18 Years Ago
Peter Jones - 18 Years Ago
Rob Toyias - 18 Years Ago
Rob Toyias - 18 Years Ago
Trent L. Taylor - 18 Years Ago
Trent L. Taylor - 18 Years Ago
Rob Toyias - 18 Years Ago
Rob Toyias - 18 Years Ago
StrataFrame Team - 18 Years Ago
StrataFrame Team - 18 Years Ago
Rob Toyias - 18 Years Ago
                         Ah, I forgot that further up the line, the primary key is added to the...
StrataFrame Team - 18 Years Ago
Rob Toyias - 18 Years Ago
StrataFrame Team - 18 Years Ago

Similar Topics

Reading This Topic

Login

Explore
Messages
Mentions
Search