Version: 9
restore

Contents

Method

TableFromJson

ModuleUtilities
LibraryCore
Action

Serializes a table variable into a JSON string

ParametersTable (table): The table variable to serialise.
Return valuesJson (string): The Json serialisation that represents the table variable supplied.
Example

Serialise a table variable as Json ...

@scalar = SELECT 'abc' AS col1;
@scalarJson = Utilities.JsonFromTable(Table:@scalar);
//@scalarJson = '[{"col1":"abc"}]'

@tableJson = SELECT 'abc' AS col1 , 'def' AS col2
             UNION
        	 SELECT 'ghi' AS col3, 'jkl' AS col4;
@json = Utilities.JsonFromTable(Table:@tableJson);
//@tableJson = '[{"col1":"abc","col2":"def"},{"col1":"ghi","col2":"jkl"}]'

Platforms
  • Windows
  • Linux
  • MacOS
  • Solaris Intel
  • Solaris Sparc
  • Android
Notes