Version: 6
restore

Contents

Method

TableFromJson

ModuleUtilities
LibraryCore
Action

Serializes a table variable into a JSON string

ParametersTable (table): The table variable to serialise.
Return values

Json (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