# create container
docker run -d \
--name oracledb \
-p 1523:1521 \
-v oradata:/opt/oracle/oradata \
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
-- 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(); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
-- -------------------------------------------------------------------------------------------------------------------- | |
-- 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. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
-- ------------------------------------------------------------------------------------------------ | |
-- 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, |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
[ | |
{ | |
"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"] } |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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 { |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
CREATE OR REPLACE PACKAGE BODY om_tapigen IS | |
----------------------------------------------------------------------------- | |
-- private global constants (c_*) | |
----------------------------------------------------------------------------- | |
c_generator_error_number CONSTANT PLS_INTEGER := -20000; | |
c_lf CONSTANT VARCHAR2(2 CHAR) := chr(10); | |
c_lflf CONSTANT VARCHAR2(3 CHAR) := chr(10) || chr(10); | |
c_list_delimiter CONSTANT VARCHAR2(3 CHAR) := ',' || c_lf; | |
c_custom_defaults_present_msg CONSTANT VARCHAR2(30) := 'SEE_END_OF_API_PACKAGE_SPEC'; |
NewerOlder