検索

Question
· Jan 31, 2022

Getting SQL Table Name For a Given Class

Hi folks!

Consider I have a class "X.Y.Z"

What is the SQL table name for it? How can I obtain it via ObjectScript? 

A quick search doesn't show any methods and properties. Documentation is a bit "wrong" here saying that the SQL table name is the same. It will be at least 'x_y.z'.

Any help is very appreciated!)

15 Comments
Discussion (15)2
Log in or sign up to continue
Article
· Jan 26, 2022 2m read

在 InterSystems IRIS 中使用网页版本的命令行工具 - Web Terminal

 

许多使用InterSystems IRIS的用户在调试代码的时候习惯使用命令行的方式,比如运行一个函数查看输出或者查看代码运行过程中保存在global中的数据等等。

对于将 InterSystems IRIS 安装在 Windows 操作系统的用户,只需要点击右下角图标选择Terminal 就可以很方便的使用。

但是对于将其安装到 Linux 或者Docker 容器中的用户,要使用命令行却不那么方便,下面我将会介绍在我们 Openexchange 中的一个应用 -- Web Terminal。

也就是说可以在网页中直接执行Terminal中的命令。

2016-09-18_212035

或者查看SQL执行结果:

2016-09-18_212244

可以在其中输入 /help ,获取更多帮助信息

2016-09-18_212325

安装

1. 点击进入项目下载页面,选择下载最新的版本。

2. 在任意的命名空间下导入下载的xml文件。

 

 

注意在这里选择导入文件的同时也要勾选上 “编译导入的项”

3. 之后会出现下面提示导入成功的提示

 

如果出现类似于下面的错误提示:

请将下载的 WebTerminal-v4.9.3.xml 文件编辑做下面修改

1 . 第1611行:修改为 

set requiredRole = "%DB_IRISSYS"

2. 第1730行:修改为

set dbPrefix = "IRIS"

重新导入就可以了。

使用

安装上面步骤安装完后,只需要在浏览器中输入网址:http://[host]:[port]/terminal/ (注意最后的 / 符号必须有)(比如:http://localhost:52777/terminal/

输入访问的用户名密码后,就可以进入网页版本的terminal了

在Openexchange中详细介绍的地址在这里,更详细的文档可以点击这里

3 Comments
Discussion (3)2
Log in or sign up to continue
Article
· Jan 24, 2022 1m read

GlobalToJSON-Compact

I have created a package that offers a utility to load a Global into JSON object and reverse     
to create a Global from this type of JSON object. Compact refers to the structure created.
Globals nodes are included with data for a fast data load.   
But also the related code is quite compact.

The export of this Global 

Generates a JSON object that covers all Global nodes 

USER>write $$Do^ZPretty(json)
{
  "gbl":[
    "^dc.MultiD=5",
    "^dc.MultiD(1)=$lb(\"Braam,Ted Q.\",51353)",
    "^dc.MultiD(1,\"mJSON\")=\"{}\"",
    "^dc.MultiD(2)=$lb(\"Klingman,Uma C.\",62459)",
    "^dc.MultiD(2,2,\"Multi\",\"a\")=1",
    "^dc.MultiD(2,2,\"Multi\",\"rob\",1)=\"rcc\"",
    "^dc.MultiD(2,2,\"Multi\",\"rob\",2)=2222",
    "^dc.MultiD(2,\"Multi\",\"a\")=1",
    "^dc.MultiD(2,\"Multi\",\"rob\",1)=\"rcc\"",
    "^dc.MultiD(2,\"Multi\",\"rob\",2)=2222",
    "^dc.MultiD(2,\"mJSON\")=\"{\"\"A\"\":\"\"ahahah\"\",\"\"Rob\"\":\"\"VIP\"\",\"\"Rob2\"\":1111,\"\"Rob3\"\":true}\"",
    "^dc.MultiD(3)=$lb(\"Goldman,Kenny H.\",45831)",
    "^dc.MultiD(3,\"mJSON\")=\"{}\"",
    "^dc.MultiD(4)=$lb(\"\",\"\")",
    "^dc.MultiD(4,\"mJSON\")=\"{\"\"rcc\"\":122}\"",
    "^dc.MultiD(5)=$lb(\"\",\"\")",
    "^dc.MultiD(5,\"mJSON\")=\"{}\""
  ]
}
USER>

And the related Loader creates exactly the same Global

Online Demo Terminal
Online Demo SMP

Video

GitHub

3 Comments
Discussion (3)1
Log in or sign up to continue
Article
· Jan 24, 2022 2m read

GlobalToJSON-Efficient

I have created a package that offers a utility to load a Global into JSON object and reverse     
to create a Global from this type of JSON object. Efficient refers to the structure created.
Only Globals nodes containing data are presented in the generated JSON object.

The export of this Global 

Generates a JSON object that covers all Global nodes 

USER>write $$Do^ZPretty(json)
{
  "gbl":[
    {
      "node":"^dc.MultiD",
      "val":"5"
    },
    {
      "node":"^dc.MultiD(1)",
      "val":"$lb(\"Braam,Ted Q.\",51353)"
    },
    {
      "node":"^dc.MultiD(1,\"mJSON\")",
      "val":"{}"
    },
    {
      "node":"^dc.MultiD(2)",
      "val":"$lb(\"Klingman,Uma C.\",62459)"
    },
    {
      "node":"^dc.MultiD(2,2,\"Multi\",\"a\")",
      "val":"1"
    },
    {
      "node":"^dc.MultiD(2,2,\"Multi\",\"rob\",1)",
      "val":"rcc"
    },
    {
      "node":"^dc.MultiD(2,2,\"Multi\",\"rob\",2)",
      "val":"2222"
    },
    {
      "node":"^dc.MultiD(2,\"Multi\",\"a\")",
      "val":"1"
    },
    {
      "node":"^dc.MultiD(2,\"Multi\",\"rob\",1)",
      "val":"rcc"
    },
    {
      "node":"^dc.MultiD(2,\"Multi\",\"rob\",2)",
      "val":"2222"
    },
    {
      "node":"^dc.MultiD(2,\"mJSON\")",
      "val":"{\"A\":\"ahahah\",\"Rob\":\"VIP\",\"Rob2\":1111,\"Rob3\":true}"
    },
    {
      "node":"^dc.MultiD(3)",
      "val":"$lb(\"Goldman,Kenny H.\",45831)"
    },
    {
      "node":"^dc.MultiD(3,\"mJSON\")",
      "val":"{}"
    },
    {
      "node":"^dc.MultiD(4)",
      "val":"$lb(\"\",\"\")"
    },
    {
      "node":"^dc.MultiD(4,\"mJSON\")",
      "val":"{\"rcc\":122}"
    },
    {
      "node":"^dc.MultiD(5)",
      "val":"$lb(\"\",\"\")"
    },
    {
      "node":"^dc.MultiD(5,\"mJSON\")",
      "val":"{}"
    }
  ]
}
USER>


And the related Loader creates exactly the same Global

Online Demo Terminal
Online Demo SMP

Video

GitHub

2 Comments
Discussion (2)1
Log in or sign up to continue
Article
· Jan 24, 2022 1m read

GlobalToJSON-Academic

I have created a package that offers a utility to load a Global into JSON object and reverse     
to create a Global from this type of JSON object. Academic refers to the structure created.
Each logical node of the Global is presented separately with all its descendants.
Even if they don't contain any stored data.

The export of this Global 

Generates a JSON object that covers all Global nodes 

And the related Loader creates exactly the same Global

Online Demo Terminal
Online Demo SMP

Video

GitHub

1 Comment
Discussion (1)1
Log in or sign up to continue