0

enter image description here

As shown in the image I'm facing this issue

I'm getting syntax error.

2
  • 1
    Please read meta.stackoverflow.com/questions/285551/… and the accepted answer Commented Apr 25, 2017 at 12:33
  • Where in the Postgres manual did you find that TABLE OF is supported in Postgres? Commented Apr 25, 2017 at 12:34

1 Answer 1

2

PostgreSQL and Oracle are two different relational database systems.

They have different SQL dialects, and the stored procedure languages PL/SQL and PL/pgSQL are somewhat similar, but different when you get to the details.

You probably want to translate

TYPE mytype IS TABLE OF mytab.mycol%TYPE;
myvar mytype;

to

myvar mycoltype[];

(assuming that mytab.mycol is of type mycoltype.)

The syntax will be different, but you can do similar things.

Sign up to request clarification or add additional context in comments.

1 Comment

%TYPE is supported too by PL/pgSQL, but unfortunately, the syntax does not allow arrays to be created from such references.

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.