title: How to declare Stored procedure with Table-valued parameter in PowerBuilder
body: <p>I made a TVP stored procedure in MS SQL Server 2008:</p>
  
  <pre><code>CREATE PROCEDURE [TVPSP] @CID INT
      ,@OID INT = NULL
      ,@GAS ParamTypeTVP readonly
      ,@ErrorText VARCHAR(100) OUTPUT
  AS
  BEGIN
      select 1
  
      RETURN
  END
  </code></pre>
  
  <p>I have also created a TVP Type:</p>
  
  <pre><code>CREATE TYPE [MDF].[ParamTypeTVP] AS TABLE(
      [ParamID] [int] IDENTITY(1,1) NOT NULL,
      [pInt1] [int] NULL,
      [pVarchar1] [varchar](777) NULL,
      PRIMARY KEY CLUSTERED 
  (
      [ParamID] ASC
  )WITH (IGNORE_DUP_KEY = OFF)
  )
  </code></pre>
  
  <p>I generated the declaration with the Powerbuilder built-in method, the result is:</p>
  
  <pre><code>function long TVPSP(long CID,long OID,string GAS,ref string ErrorText) RPCFUNC ALIAS FOR "TVPSP"
  </code></pre>
  
  <p>So as you see the PB generated a string variable for the TVP parameter which is false (and of course the call fails from PB).
  Is it possible to make it work somehow? Of course I have ideas for workarounds (for example making a wrapper sp to ignore the TVP parameters), but I would like to know how to make it work in this way with TVP!</p>
  
  <p>Thx in advance!</p>
  
  <p>Gábor</p>