I'm an idiot. I forgot to include the "OUTPUT" in the VFP side stored procedure call.
Should have been:
Exec Attribute_InsProc @Description=?ca_Attribute.Description,@id=?ca_Attribute.kAttribute OUTPUT
Aloha,
James
>Hi All,
>
>I know this subject has been beaten to death on these boards, but I have gone through old posts on this forum and others and just cannot get this to work. It's using SQL Stored Procedures through the CursorAdapter class.
>
>Here's the SQL Stored Proc:
>
>CREATE PROCEDURE Attribute_InsProc
> ( @Description NVARCHAR(30), @id int Output )
>AS
>BEGIN
> BEGIN TRAN
> INSERT INTO Attribute
> ( Description )
> VALUES ( @Description )
> Select @id = SCOPE_IDENTITY( )
> IF (@@error!=0)
> BEGIN
> RAISERROR 20000 'Attribute_InsProc: Cannot insert because primary key value not found in Attribute'
> ROLLBACK TRAN
> RETURN(1)
> END
> COMMIT TRAN
>END
>
>
>Here is the CursorAdapter InsertCmd value:
>
>Exec Attribute_InsProc @Description=?ca_Attribute.Description,@id=?ca_Attribute.kAttribute
>
>
>It is my understandig that the new ID value should be placed in kAttribute. I append a record and TableUpdate(.T.). TableUpdate executes OK but the new ID value is not in the cursor. Any ideas? Did I go wrong somewhere?
>
>Aloha,
>
>James