Procedure with table-value parameter

Discussion of open issues, suggestions and bugs regarding SDAC (SQL Server Data Access Components) for Delphi, C++Builder, Lazarus (and FPC)
Post Reply
keiichi
Posts: 2
Joined: Fri 18 Jan 2013 07:33

Procedure with table-value parameter

Post by keiichi » Fri 18 Jan 2013 08:52

Hello

I have stored procedure with table-value parameter. Procedure and table type are defined in a schema other than dbo, ie. myschema.myproc and myschema.mytype.

Code: Select all

Items := TMSTableData.Create(nil);
Items.Connection := SomeConnection;
Items.TableTypeName := 'myschema.mytype';
Items.Open;
Items.Append;
Items.Fields[0].AsString := 'abc';
Items.Post;

Proc.ParamByName('tableparam').AsTable := Items.Table;
Proc.ExecProc; // Error
On execution I get error: Column, parameter, or variable #1: Cannot find data type myschema.mytype.

When I set TableTypeName property as 'mytype' (without schema name) i can succesfully execute procedure, but in this case mytype cannot exist in more, then one schema. If it does TMSTableData object contains fields from types from all schemas.

Also Delphi designer lists and saves to .dfm file table-value types without schemas (TMSTableData component, TableTypeName dropdown list).

I use SDAC v.6.6.11, Delphi XE2 Update 4 HotFix 1 and SQL Server 2008 R2.

AndreyZ

Re: Procedure with table-value parameter

Post by AndreyZ » Fri 18 Jan 2013 09:34

Hello,

Thank you for the information. We reproduced the problem and the investigation is in progress. We will notify you when we have any results.

AndreyZ

Re: Procedure with table-value parameter

Post by AndreyZ » Mon 11 Feb 2013 16:23

We have fixed the problem. This fix will be included in the next SDAC build.

Post Reply