Skip to content

Instantly share code, notes, and snippets.

@phpdave
Last active August 29, 2015 14:25
Show Gist options
  • Save phpdave/a2ac7cd369976d9da103 to your computer and use it in GitHub Desktop.
Save phpdave/a2ac7cd369976d9da103 to your computer and use it in GitHub Desktop.
--Create an Array type
CREATE TYPE phone_numbers_array_type AS VARCHAR(12) ARRAY[1000]
--Create a variable default_array of type phonenumberarray with a default array specified
CREATE OR REPLACE VARIABLE default_array phone_numbers_array_type DEFAULT ARRAY['416-413-9394', '416-413-7727', '416-413-6254'];
--Create a function using the array
CREATE OR REPLACE FUNCTION do_something_with_phone_numbers (
my_phone_numbers phone_numbers_array_type DEFAULT default_array)
RETURNS INTEGER
LANGUAGE JAVA
EXTERNAL NAME 'phone_tools.Phone.do_something_with_phonenumbersarray'
PARAMETER STYLE JAVA
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment