Error Updating a record with a stored procedure


Author
Message
Rob Toyias
Rob Toyias
StrataFrame Beginner (37 reputation)StrataFrame Beginner (37 reputation)StrataFrame Beginner (37 reputation)StrataFrame Beginner (37 reputation)StrataFrame Beginner (37 reputation)StrataFrame Beginner (37 reputation)StrataFrame Beginner (37 reputation)StrataFrame Beginner (37 reputation)StrataFrame Beginner (37 reputation)
Group: Forum Members
Posts: 31, Visits: 179
The PrimaryKeyFields property containes the two values I added via the BOM.

What I'd really like to know is why the SqlDataSourceItem.BuildUpdateCommand_SP includes logic that the Oracle version does not?  Especially since that bit of logic if expressly preventing the duplication of the pk names.

Could it be an issue with the creation of the QueryInfo object?  should QueryInfo.Fields normally contain the pk names in it?  What about when PrimaryKeyIsAutoIncremented is set to false, would that change the construction of QueryInfo.Fields and add the PK names?

Thanks

Attachments
BusinessObject1.Designer.zip (90 views, 4.00 KB)
StrataFrame Team
S
StrataFrame Developer (4.6K reputation)StrataFrame Developer (4.6K reputation)StrataFrame Developer (4.6K reputation)StrataFrame Developer (4.6K reputation)StrataFrame Developer (4.6K reputation)StrataFrame Developer (4.6K reputation)StrataFrame Developer (4.6K reputation)StrataFrame Developer (4.6K reputation)StrataFrame Developer (4.6K reputation)
Group: StrataFrame Developers
Posts: 3K, Visits: 2.5K
Ah, I forgot that further up the line, the primary key is added to the fields to be updated because it's not auto incremented.

What I'd really like to know is why the SqlDataSourceItem.BuildUpdateCommand_SP includes logic that the Oracle version does not?

That's a really good question.  I think it's because when we added the functionality to allow users to change the primary key (a big no-no for most people, since it's a PK, but whatever), we made the change to the business layer to pass the pk fields as updatable fields, but the change just didn't get propagated to the OracleDataSourceItem.

Anyways, here's the update:

http://forum.strataframe.net/FindPost12485.aspx

Rob Toyias
Rob Toyias
StrataFrame Beginner (37 reputation)StrataFrame Beginner (37 reputation)StrataFrame Beginner (37 reputation)StrataFrame Beginner (37 reputation)StrataFrame Beginner (37 reputation)StrataFrame Beginner (37 reputation)StrataFrame Beginner (37 reputation)StrataFrame Beginner (37 reputation)StrataFrame Beginner (37 reputation)
Group: Forum Members
Posts: 31, Visits: 179
Ben



I've got a problem with that update release.



What I am seeing now is anytime I call update on a BO with a single primary key I end up with a SP that passes the key as a param but labels it "Parameter1", notice it's without the prepend.



For example my debug file looks like this:



i_SOMEID: '69' [DbType: VarNumeric | Size: 0 | Direction: Input | SourceColumn: SOMEID| SourceVersion: Current]

i_SOMETEXT: 'NA aaa' [DbType: AnsiString | Size: 6 | Direction: Input | SourceColumn: SOMETEXT| SourceVersion: Current]

i_RECORDUPDATEDT: '10/5/2007 10:12:40 AM' [DbType: DateTime | Size: 0 | Direction: Input | SourceColumn: RECORDUPDATEDT | SourceVersion: Current]

i_SYSTEMNM: 'FOO' [DbType: AnsiString | Size: 3 | Direction: Input | SourceColumn: SYSTEMNM | SourceVersion: Current]

i_UPDATEDBY: 'somebody' [DbType: AnsiString | Size: 8 | Direction: Input | SourceColumn: UPDATEDBY | SourceVersion: Current]

Parameter1: '81' [DbType: VarNumeric | Size: 0 | Direction: Input | SourceColumn: SOMEPRIMARYKEY | SourceVersion: Current]

i_ROWREVISION: '0' [DbType: VarNumeric | Size: 0 | Direction: InputOutput | SourceColumn: ROWREVISION | SourceVersion: Current]

i_ROWCOUNT: 'null (Nothing)' [DbType: VarNumeric | Size: 0 | Direction: Output | SourceColumn: | SourceVersion: Current]



This does not occur when I define > 1 PK.



This only occurs when I use the new SF Base class dll, when I swap out and add the old one back in the error goes away.



Any ideas?
StrataFrame Team
S
StrataFrame Developer (4.6K reputation)StrataFrame Developer (4.6K reputation)StrataFrame Developer (4.6K reputation)StrataFrame Developer (4.6K reputation)StrataFrame Developer (4.6K reputation)StrataFrame Developer (4.6K reputation)StrataFrame Developer (4.6K reputation)StrataFrame Developer (4.6K reputation)StrataFrame Developer (4.6K reputation)
Group: StrataFrame Developers
Posts: 3K, Visits: 2.5K
I should have it fixed.  Give this update a try:

http://forum.strataframe.net/FindPost12716.aspx

GO

Merge Selected

Merge into selected topic...



Merge into merge target...



Merge into a specific topic ID...




Similar Topics

Reading This Topic

Login

Explore
Messages
Mentions
Search