see Mermaid
erDiagram
direction LRsee Mermaid
erDiagram
direction LR| drop table if exists t; | |
| create table t (data json(object)); | |
| declare | |
| x varchar2(40 byte) := '{ "greet": "merry x-mas" , "to": "all" }'; | |
| begin | |
| insert into t values (x); | |
| end; | |
| / | |
| declare | |
| x varchar2(20 byte) := '{xmas:[1,2,3,4,5,6]}'; |
The SQL Developer team is planning to release an SDK for their Oracle SQL Developer Extension for VSCode.
This Gist contains a list of features we would like to see in the SDK.
| create or replace package utf8 is | |
| function codepoint_to_bytes(in_codepoint in varchar2) return varchar2 deterministic; | |
| function bytes_to_codepoint(in_bytes in varchar2) return varchar2 deterministic; | |
| function codepoint_to_unistr(in_codepoint in varchar2) return varchar2 deterministic; | |
| function unistr_to_codepoint(in_unistr in varchar2) return varchar2 deterministic; | |
| end utf8; | |
| / | |
| create or replace package body utf8 is | |
| function hex_to_num(in_hex in varchar2) return integer deterministic; |
| -- MLE inline call spec in 23.3 (does not work in 24.4) anymore | |
| /* | |
| create or replace function find_terms ( | |
| "in_terms" in varchar2, | |
| "in_text" in varchar2 | |
| ) return json is mle language javascript q'[ | |
| var found_terms = []; | |
| var terms_array = in_terms.split(','); | |
| for (var i = 0; i < terms_array.length; i++) { | |
| var term = terms_array[i].trim().toLowerCase(); |
| -- -------------------------------------------------------------------------------------------------------------------- | |
| -- Minimal Arbori program (expected by the formatter, also expected: "order_by_clause___0"). | |
| -- -------------------------------------------------------------------------------------------------------------------- | |
| include "std.arbori" | |
| dummy: :indentConditions & [node) identifier; | |
| skipWhiteSpaceBeforeNode: runOnce -> { var doNotCallCallbackFunction;} | |
| dontFormatNode: [node) numeric_literal | [node) path ->; | |
| -- -------------------------------------------------------------------------------------------------------------------- | |
| -- Keep existing whitespace. |
| -- ------------------------------------------------------------------------------------------------ | |
| -- do-it-yourself implementation of any_value for strings | |
| -- based on http://db-oriented.com/2021/02/20/diy-any_value/ | |
| -- use Oracle Database 9i or higher, connected as HR user. | |
| -- ------------------------------------------------------------------------------------------------ | |
| create or replace type any_value_string_t as object | |
| ( | |
| v_value varchar2(4000), | |
| static function odciaggregateinitialize(sctx in out any_value_string_t) return number, |
| [ | |
| { | |
| "name":"com.trivadis.plsql.formatter.TvdFormat", | |
| "methods":[{"name":"main","parameterTypes":["java.lang.String[]"] }]} | |
| , | |
| { | |
| "name":"java.lang.ClassLoader", | |
| "methods":[ | |
| {"name":"getPlatformClassLoader","parameterTypes":[] }, | |
| {"name":"loadClass","parameterTypes":["java.lang.String"] } |
| import com.oracle.truffle.js.scriptengine.GraalJSScriptEngine; | |
| import org.graalvm.polyglot.Context; | |
| import javax.script.ScriptContext; | |
| import javax.script.ScriptEngine; | |
| import javax.script.ScriptException; | |
| import java.util.HashMap; | |
| public class Demo { | |
| public static void main(String[] args) throws ScriptException { |