substr function in sqlite code example

Example 1: function in plsql

CREATE FUNCTION function_name … RETURN BOOLEAN IS
	Definitions;
BEGIN
	Statement;
	RETURN "Hello World!";
END;

Example 2: geopoint from json mysql function

Press CTRL+C to copy mysql> SET @json = '{ "type": "Point", "coordinates": [102.0, 0.0]}';
mysql> SELECT ST_AsText(ST_GeomFromGeoJSON(@json));
+--------------------------------------+
| ST_AsText(ST_GeomFromGeoJSON(@json)) |
+--------------------------------------+
| POINT(102 0)                         |
+--------------------------------------+

Tags:

Sql Example