検索

Discussion (0)0
Log in or sign up to continue
Question
· Aug 21

BI Architect expressions

I work a lot with IRIS BI, but some features are still a mystery to me. There is a great feature here that allows you to create expressions in Architect.

  

I'm already very familiar with it, but I still don't quite understand what environment it uses.

It can execute system classes like $SYSTEM.SQL,  $PIECE(), %cube, %source(), it can do string concatenation, call methods from another classes.

I have two questions actually.
What environment it uses to execute this? Is it ObjectScript, SQL, MDX or maybe even its own? I need to know this to understand the mechanics behind it, how the Architect work

Second, what are the FULL list of what it can do and what it can not. 

I looked through the "wonderful" documents on this and found several pieces of information scattered over 3-5 pages. 

7 Comments
Discussion (7)3
Log in or sign up to continue
Article
· Aug 21 4m read

Um guia para iniciantes para criar tabelas SQL e vê-las como classes

O artigo do August Article Bounty sobre Global Masters, e um dos tópicos propostos me pareceu bastante interessante para uso futuro em minhas aulas. Então, é isso que eu gostaria de dizer aos meus alunos sobre tabelas no IRIS e como elas se correlacionam com o modelo de objeto.

Primeiro, o InterSystems IRIS possui um modelo de dados unificado. Isso significa que, ao trabalhar com dados, você não está preso a um único paradigma. Os mesmos dados podem ser acessados e manipulados como uma tabela SQL tradicional, como um objeto nativo, ou até mesmo como um array multidimensional (um global). Isso significa que, ao criar uma tabela SQL, o IRIS cria automaticamente uma classe de objeto correspondente. Ao definir uma classe de objeto, o IRIS a torna automaticamente disponível como uma tabela SQL. Os dados em si são armazenados apenas uma vez no eficiente motor de armazenamento multidimensional do IRIS. O motor SQL e o motor de objeto são simplesmente diferentes "lentes" para visualizar e trabalhar com os mesmos dados.

Primeiro, vamos ver a correlação entre o modelo relacional e o modelo de objeto:

Relacional Objeto
Tabela Classe
Coluna Propriedade
Linha Objeto
Chave primária Identificador de objeto

Nem sempre é uma correlação de 1:1, já que você pode ter várias tabelas representando uma classe, por exemplo. Mas é uma regra geral.

Neste artigo, discutirei a criação de uma tabela listando suas colunas.

A abordagem mais básica:

CREATE TABLE [IF NOT EXISTS] table (
   column1 type1 [NOT NULL], 
   column2 type2 [UNIQUE], 
   column3 type3 [PRIMARY KEY]
   ...
   [CONSTRAINT fKeyName FOREIGN KEY (column) REFERENCES refTable (refColumn)]
)

[ ] designam as partes opcionais.

Vamos criar uma tabela DC.PostType,que consiste em três colunas: TypeID(chave primária), Name, eDescription:

CREATE TABLE DC.PostType (
  TypeID        INT NOT NULL,
  Name          VARCHAR(20), 
  Description   VARCHAR(500),
  CONSTRAINT Type_PK PRIMARY KEY (TypeID)
)

Como resultado, obteremos a seguinte classe após a execução da instrução SQL acima:

/// 
Class DC.PostType Extends %Persistent [ ClassType = persistent, DdlAllowed, Final, Owner = {UnknownUser}, ProcedureBlock, SqlRowIdPrivate, SqlTableName = PostType ]
{

Property TypeID As %Library.Integer(MAXVAL = 2147483647, MINVAL = -2147483648) [ Required, SqlColumnNumber = 2 ];
Property Name As %Library.String(MAXLEN = 20) [ SqlColumnNumber = 3 ];
Property Description As %Library.String(MAXLEN = 500) [ SqlColumnNumber = 4 ];
Parameter USEEXTENTSET = 1;
/// Bitmap Extent Index auto-generated by DDL CREATE TABLE statement.  Do not edit the SqlName of this index.
Index DDLBEIndex [ Extent, SqlName = "%%DDLBEIndex", Type = bitmap ];
/// DDL Primary Key Specification
Index TypePK On TypeID [ PrimaryKey, SqlName = Type_PK, Type = index, Unique ];
Storage Default
{
<Data name="PostTypeDefaultData">
<Value name="1">
<Value>TypeID</Value>
</Value>
<Value name="2">
<Value>Name</Value>
</Value>
<Value name="3">
<Value>Description</Value>
</Value>
</Data>
<DataLocation>^B3xx.DXwO.1</DataLocation>
<DefaultData>PostTypeDefaultData</DefaultData>
<ExtentLocation>^B3xx.DXwO</ExtentLocation>
<IdFunction>sequence</IdFunction>
<IdLocation>^B3xx.DXwO.1</IdLocation>
<Index name="DDLBEIndex">
<Location>^B3xx.DXwO.2</Location>
</Index>
<Index name="IDKEY">
<Location>^B3xx.DXwO.1</Location>
</Index>
<Index name="TypePK">
<Location>^B3xx.DXwO.3</Location>
</Index>
<IndexLocation>^B3xx.DXwO.I</IndexLocation>
<StreamLocation>^B3xx.DXwO.S</StreamLocation>
<Type>%Storage.Persistent</Type>
}

}

Principais Observações:

  • TABLE DC.PostType se tornouClass DC.PostType.
  • A classe Extends %Persistent,que é o que informa ao IRIS para armazenar seus dados no banco de dados.
  • VARCHAR se tornou %String.
  • INT se tornou%Integer.
  • A restriçãoPRIMARY KEY criou um Indexcom a palavra-chave PrimaryKey.

Agora você pode usar esta tabela/classe de qualquer lado, por exemplo, usando SQL:

INSERT INTO DC.PostType (TypeID, Name, Description) VALUES (1, 'Question', 'Ask a question from the Community')

Há muito mais sobre a criação de tabelas usando SQL, por favor, leia a documentação fornecida abaixo.

1 Comment
Discussion (1)2
Log in or sign up to continue
Announcement
· Aug 21

[New DC Feature] Add Documentation Links to Your Articles

Hi Community,

Please welcome a new feature on Developer Community – the ability to add a link to the official InterSystems Documentation directly at the end of your post.

How it works

When publishing an article, paste the relevant URL from docs.intersystems.com into the InterSystems Documentation link field.

Your article will then display a clear callout with the related documentation, making it easier for readers to dive deeper into the topic.

Special thanks to @Luis Angel Pérez Ramos , who suggested this idea via the Ideas portal

You asked – we did it :)

Hope you'll find this feature useful. 

3 Comments
Discussion (3)4
Log in or sign up to continue
Announcement
· Aug 21

Meetup Brazil - Gen AI e Agentic AI Meetup para Desenvolvedores e Startups

Olá Comunidade! 

Esse ano teremos pela primeira vez o Meetup no Brasil 🇧🇷.

 

O Meetup Brazil será um encontro em📍São Paulo para desenvolvedores e startups explorarem tendências de inteligência artificial, interoperabilidade e orquestração de dados, com foco em conteúdo técnico e networking de qualidade.

Os ingressos são gratuitos. Garanta logo o seu ! 

 

Teremos 2 palestras: 

  • Palestra 1: Assistentes de Programação de IA - por @Fernando Ferreira, Sales Engineer, InterSystems
  • Palestra 2: O Futuro Já Chegou? Uma Nova Era de Interoperabilidade e Orquestração de Dados com RAG e MCP - ​​​​@Claudio Devecchi, Senior Sales Engineer, InterSystems 

Será uma excelente oportunidade para reunirmos essa fantástica Comunidade de Desenvolvedores para trocarmos idéias e experiencias, e comermos uma pizza 🍕 super saborosa para celebrarmos este encontro.

Esperamos por vocês ! 😉

6 Comments
Discussion (6)4
Log in or sign up to continue