The functions on this page are used to convert data from one type to another in the GSQL query language.
parse_json_array()
parse_json_array( str )
Converts a string into a JSON array. The string must be properly formatted, or the function will generate a run-time error. To be properly formatted, besides having the proper nesting and matching of curly braces { }
and brackets [ ]
, each value field must be one of the following:
a string
a number
a boolean
a JSONOBJECT - Each key of a key-value pair must be a string in double quotes.
a JSON array
JSONARRAY
parse_json_object()
parse_json_object( str )
Converts a string into a JSON object. The string must be properly formatted, or the function will generate a run-time error. To be properly formatted, besides having the proper nesting and matching of curly braces { }
and brackets [ ]
, each value field must be one of the following:
a string
a number
a boolean
a JSONOBJECT - Each key of a key-value pair must be a string in double quotes, and the quotes need to be escaped with a backlash-escape \
. However, if you are supplying the string in GraphStudio as a parameter, you do not need the backlash-escape since string values are not enclosed in double quotes.
a JSON array
JSONOBJECT
str_to_int ()
str_to_int (str)
Converts a string to an integer.
INT
to_datetime ()
to_datetime ( str )
Converts a string value into a DATETIME
value.
DATETIME
to_string()
to_string(num)
Converts a number to a string.
STRING
Parameter
Description
Data type
str
The string to be converted into a JSON array.
STRING
Parameter
Description
Data type
str
The string to be converted into a JSON object.
STRING
Parameter
Description
Data type
str
The string that contains an integer to convert to an integer
STRING
Parameter
Description
Data type
str
A string value
STRING
Parameter
Description
Data type
num
The number to turn into a string
Number