Written by

Senior Cloud Architect at InterSystems
Question 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 ???)

Comments

Matthew Giesmann · May 24, 2017

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)

0
Eduard Lebedyuk  May 24, 2017 to Matthew Giesmann

I thought there's maybe some special keyword.

0
Vitaliy Serdtsev · May 24, 2017

Pass-through if No DDL Mapping is Found

E.g.:

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)

0
Evgeny Shvarov · Jun 20

Do we have any new options for collections in DDL? Something like:

CREATE TABLE Aricle (tags varchar50[])

?

0