Skip to main content
August 8, 2022
Question

Table function

  • August 8, 2022
  • 11 replies
  • 0 views

Hello everyone,  

I have a question that table function is created in the database with set of columns and How will I use the table function in appian with some parameters?

Can anyone please help me to further proceed?

Thanks in advance.

    11 replies

    stefanhelzle0001
    Brainy
    August 8, 2022

    For me, it is pretty much unclear what you want to achieve. Can you give us a few more details?

    August 8, 2022

    I think you want to use your table into Appian to either fetch the data or update the data. If yes, then you have to create the CDT by using create from existing Table or view option into Data type and post that you have to provide the datastore name and the table name and after that create a constant to use that CDT into queryEntity or writetoDatastoreEntity function to fetch or update the data respectively. 

    csteward
    August 8, 2022

    If you want to obtain data from a Table-valued Function in your database, you can create a view that queries the function, and set a data type / data store up on the view, same way as you would for a normal table. 

    I do this in one scenario where a report is generated by a function that creates/returns a temporary table, ended up being better for performance this way in my scenario, where lots of data is aggregated for a weekly summary.

    CREATE view [dbo].[VIEW_FROM_FUNCTION]
    as
    
    select 
    [Col1],
    [Col2]
    /*etc*/
    from dbo.fn_YOUR_TABLE_VALUED_FUNCTION()
    
    GO
    

    August 9, 2022

    I am getting the error while creating new Data type

    stefanhelzle0001
    Brainy
    August 9, 2022

    Did you try to follow the advised steps in the error message?