Eduard Lebedyuk · May 24, 2017

DDL for collection properties

How do I write DDL script for collection properties?

For example I want to create the following class:

Class SQLUser.Person {

Property Name As %String;

Property FavoriteColors As list Of %String;


My DDL script looks like this:

CREATE TABLE Person (Name varchar(50), FavoriteColors ???)
0 284
Discussion (4)1
Log in or sign up to continue

In general, "list of ___" properties don't play well with SQL.   Looks like we just present the list as a string.

Using the Generate CREATE TABLE statement feature of WinSQL for Sample.Person gives:

    FavoriteColors VARCHAR(4096)

I thought there's maybe some special keyword.

Pass-through if No DDL Mapping is Found


CREATE TABLE Person (Name varchar(50), FavoriteColors %Collection.ListOfDT)

CREATE TABLE Person (Name varchar(50), FavoriteColors %List)

CREATE TABLE Person (Name varchar(50), FavoriteColors %ListOfDataTypes)