3

For example:

I have a data-table type in SQL:

CREATE TYPE dbo.typTable1 AS TABLE
(
    Field1 INT NOT NULL,
    Field2 NVARCHAR(20) NULL
)

And a stored procedure in SQL, like this:

CREATE PROCEDRE dbo.prcTest
    @XDataTable dbo.typTable1 READONLY
AS
BEGIN
    .
    .
    .

And now problem!!! : When i send a table as parameter in delphi like this:

FireDACStoredProcedure.Params.ParamByName('@XDataTable').AsDataset := 
    FireDACMemTable;

And when i run this, an error accour that say not supported.

Please guide me...thanks to you so much...

3
  • Forget your Delphi code for a moment: can you successfully invoke your prcTest from a TransactSQL script in SSMS? Commented May 13, 2017 at 12:17
  • Please do not post fake code like "CREATE PROCEDRE". Also is there any text missing before @XDataTable? Commented May 13, 2017 at 12:18
  • Hello dear MartinA...Sure...I will post entire code...thank you... Commented May 14, 2017 at 4:29

1 Answer 1

2

I am thinking something like that:

Set the DataType = ftObject;

Set datatypename = <your_procedureName>.<your_parameter>

With FireDACStoredProcedure.Params.ParamByName('@XDataTable') do
begin
DataType := ftObject;
DataTypeName := 'prcTest.@XDataTable';
end;

Inspired in https://delphiaball.co.uk/2016/04/29/interbase-array-fields-firedac/

Sign up to request clarification or add additional context in comments.

1 Comment

@Vahid Accept answer

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.