Thread: CREATE TYPE error in PostgreSQL database!!!!!!
- Need to create type
- Declare array variable in type datatype.
.EmailQuote { margin-left: 1pt; padding-left: 4pt; border-left: #800000 2px solid; } Hi TeamWhile creating function I have encountered the below error in PostgreSQL database.I need to know how to use the array declaration in Type datatype in postgreSQL database. Could you please help or share some exmple to use it?
- Need to create type
- Declare array variable in type datatype.
ERROR: syntax error at or near "c_db_fieldvalues" LINE 113: ... fetch usage_cursor into c_db_fieldvalues c_db_field... ^ SQL state: 42601 Character: 9447Thanks & Best Wishes,Ashok
What have you tried? All types in PostgreSQL can also be used as arrays. Put empty brackets after the type an it's a one-dimensional array. Put two pairs of empty brackets after the type and it's a two-dimensional array.
There is no need to explicitly create an array type.
see https://www.postgresql.org/docs/current/arrays.html
-- Holger Jakobs, Bergisch Gladbach, Tel. +49-178-9759012
Attachment
From: Ashok Kumar Mani <ashokkumar.mani@dnata.com>
Sent: Monday, January 03, 2022 02:40
To: pgsql-admin@postgresql.org
Subject: CREATE TYPE error in PostgreSQL database!!!!!!
Hi Team
While creating function I have encountered the below error in PostgreSQL database.
I need to know how to use the array declaration in Type datatype in postgreSQL database. Could you please help or share some exmple to use it?
- Need to create type
- Declare array variable in type datatype.
ERROR: syntax error at or near "c_db_fieldvalues" LINE 113: ... fetch usage_cursor into c_db_fieldvalues c_db_field... ^ SQL state: 42601 Character: 9447
Thanks & Best Wishes,
Ashok
[Laurent Hasson]
Can you post your code that’s erroring out?