2

I have this function which has been translated from oracle to postgres:

CREATE OR REPLACE FUNCTION myblah ( values TEXT[], evalues TEXT[], p_pid bigint, c_id bigint, pr_id bigint, p_name TEXT, p_use text default 'N') 
RETURNS VOID
AS $body$

and I am trying to call this function in order to test. But I am having issue inserting the array parameter, unsure of the syntax and cannot find anything to show me.

for example I am trying this but it is not acceptable syntax:

select myblah (TEXT['hello','whynot','jasmine'], 43423, 434234,534534,'fggffgfg','N');

the error is

ERROR:  syntax error at or near ","
LINE 1: select myblah(TEXT['hello','whynot','jasmin...

however removing the ',' does not work

2 Answers 2

3

You need the array keyword:

select myblah (array['hello','whynot','jasmine'], 43423, 434234,534534,'fggffgfg','N');
Sign up to request clarification or add additional context in comments.

Comments

1

As the documentation will tell you, there are two options:

'{string 1,string 2}'

or

ARRAY['string1', 'string 2']

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.