Pesquisar

Pergunta
· Ago. 22

VS code not importing CSP files

Trying to import a .csp with VS code appears to do nothing.

Making a change to the file, saving it and then doing "Import and compile" results in no output and there is no change to the file on the server.

Plugin version is 3.0.5

4 Comments
Discussão (4)4
Entre ou crie uma conta para continuar
Discussão (0)0
Entre ou crie uma conta para continuar
Pergunta
· Ago. 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
Discussão (7)3
Entre ou crie uma conta para continuar
Artigo
· Ago. 21 4min de leitura

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
Discussão (1)2
Entre ou crie uma conta para continuar
Anúncio
· Ago. 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
Discussão (3)4
Entre ou crie uma conta para continuar