Jump to content

[SOLVED] Equivalent of Oracle's "TYPE" in PostgreSQL.


ghe

Recommended Posts

For the benefit of those who does not know.

 

The oracle code that i had posted yesterday was a way of declaring an "Associative Array"

in oracle. for which, in PostgreSQL, its just the same as declaring a simple array.

 

Let us discuss.

 

ORACLE CODE: TYPE myTable IS TABLE OF varchar2(1) INDEX BY BINARY_INTEGER;

 

The oracle code specified above means that you are declaring an ARRAY of type "varchar2" with the size of 1 ,

and it is named "myTable".

 

The sub-code "INDEX BY BINARY_INTEGER" means that you are indexing the ARRAY by an "INTEGER".

Note that in Oracle, ARRAYS can be indexed either by an "INTEGER" or a "STRING".

 

And that's it, hope this would help someone here.

 

Link to comment
Share on other sites

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.