You are viewing a plain text version of this content. The canonical link for it is here.
Posted to derby-user@db.apache.org by Hong Ji <ho...@gmail.com> on 2006/08/11 09:46:13 UTC
ARRAY
Hello,
How to create a table with a colume is of type ARRAY?
The following SQL statement fails at "ARRAY."
"create table APP.Rooms (" +
"ID INTEGER NOT NULL PRIMARY KEY GENERATED
ALWAYS AS IDENTITY (START WITH 1, INCREMENT BY 1)," +
"SYMBOL VARCHAR(30), " +
"TYPE VARCHAR(30), " +
"TICKET_IDS ARRAY" +
")";
So how to define the TICKET_IDS field as array of integers in Derby?
Thanks.
Hong
Re: ARRAY
Posted by Hong Ji <ho...@gmail.com>.
Thanks for the wiki link and the child table suggestion.
On 8/11/06, Stanley Bradbury <St...@gmail.com> wrote:
>
> Hong Ji wrote:
> > Hello,
> >
> > How to create a table with a colume is of type ARRAY?
> > The following SQL statement fails at "ARRAY."
> >
> > "create table APP.Rooms (" +
> > "ID INTEGER NOT NULL PRIMARY KEY
> > GENERATED ALWAYS AS IDENTITY (START WITH 1, INCREMENT BY 1)," +
> > "SYMBOL VARCHAR(30), " +
> > "TYPE VARCHAR(30), " +
> > "TICKET_IDS ARRAY" +
> > ")";
> >
> > So how to define the TICKET_IDS field as array of integers in Derby?
> >
> > Thanks.
> >
> > Hong
> >
> >
> To set this up in Derby you could list the array values in a child table
> the load the array programatically when reading the records.
>
>
Re: ARRAY
Posted by Stanley Bradbury <St...@gmail.com>.
Hong Ji wrote:
> Hello,
>
> How to create a table with a colume is of type ARRAY?
> The following SQL statement fails at "ARRAY."
>
> "create table APP.Rooms (" +
> "ID INTEGER NOT NULL PRIMARY KEY
> GENERATED ALWAYS AS IDENTITY (START WITH 1, INCREMENT BY 1)," +
> "SYMBOL VARCHAR(30), " +
> "TYPE VARCHAR(30), " +
> "TICKET_IDS ARRAY" +
> ")";
>
> So how to define the TICKET_IDS field as array of integers in Derby?
>
> Thanks.
>
> Hong
>
>
To set this up in Derby you could list the array values in a child table
the load the array programatically when reading the records.