#Caché

30 Followers · 4.5K Posts

  

InterSystems Caché is a multi-model DBMS and application server. See more details here.

Documentation.

Question Evgeny Shvarov · Jul 8, 2016

Hi!
There is interesting question in Stackoverflow.
This query works for MS SQL:

SELECT * 
FROM 
(
    SELECT *, ROW_NUMBER() OVER (PARTITION BY client_id ORDER BY date_updated DESC) AS rn
    FROM client_address
) a
WHERE a.rn = 1

There is one answer there,  which solves the task:

SELECT *
FROM 
   client_address a
   LEFT JOIN client_address b
   on a.client_id  = b.client_id 
     and a.date_updated < b.date_updated 
WHERE
   b.client_id is null

But it goes with comment, that there are no Window functions in Caché SQL.

5
0 2447
Article Mike Kadow · Jul 10, 2016 4m read

NewBie's Corner Session 12 Do and Goto

Welcome to NewBie's Corner, a weekly or biweekly post covering basic Caché Material.

InterSystems Caché provides a GUI (Graphical User Interface) based Integrated Development Environment (IDE) called Caché Studio. Developers can use Studio to create and maintain applications.

Controlling Process Flow

Controlling Process Flow means controlling the execution path of code. The execution of code flows from the top to the bottom in a routine, except for the following:

•             Do and Quit commands

•             Goto command

0
0 337
Article Mark Bolinsky · Jul 1, 2016 17m read

++Update: August 2, 2018

This article provides a reference architecture as a sample for providing robust performing and highly available applications based on InterSystems Technologies that are applicable to Caché, Ensemble, HealthShare, TrakCare, and associated embedded technologies such as DeepSee, iKnow, Zen and Zen Mojo.

Azure has two different deployment models for creating and working with resources: Azure Classic and Azure Resource Manager. The information detailed in this article is based on the Azure Resource Manager model (ARM).

4
0 12622
Article Mike Kadow · Jul 7, 2016 2m read

NewBie's Corner Session 11 Routine Line Types and Gotos

Welcome to NewBie's Corner, a weekly or biweekly post covering basic Caché Material.

InterSystems Caché provides a GUI (Graphical User Interface) based Integrated Development Environment (IDE) called Caché Studio. Developers can use Studio to create and maintain applications.

In this session we will cover Routine Line types; which are Label lines, Executable code lines and the Routine Header line as well as Gotos.

0
0 388
Question Paul Riker · Jul 6, 2016

I am writing a static SOAP response to simply test connectivity. The end users is getting an error "Message: The processing instruction target matching [xX][mM][lL] is not allowed.", which I believe is related to white space. if I observe the response, it looks like there are two blank lines between the header and the body, which I'm guessing is the white space problem. But I can't seem to get rid of it.

Any ideas?

Code:

3
0 1415
Question Ondřej Hoferek · Jun 10, 2016

I need to pass an equivalent of .Net Dictionary<string, int> instance from .Net to Caché. In the application, the Caché .Net provider has been used so far, so we came up with passing it as an instance of array of data types. However, the only way to fill the array we are aware of is to use its Add() method which invokes a call to the server instance method of the array for every key-value pair inserted.

Is there any way to fill the array at once - inserting all the pairs in one server call? Alternatively, is their any other .Net (Provider or eXTreme) API we can use for this task?

1
0 768
Article Mike Kadow · Jun 20, 2016 4m read

NewBie's Corner Session 8 Not

Welcome to NewBie's Corner, a weekly or biweekly post covering basic Caché Material.

Click on the Caché Cube in your system tray and select Terminal to try out these commands.

NOT operator ('), single quote or apostrophe 

The "NOT" operator reverses the truth-value and is intended for numeric operands, however it can be used on alphanumeric operands.

Set X=1
Write  'X
0
 
Set X=1
If X Write "True"                               ; 1 is always true and 0 is always false
True
 
Set X=0
Write 'X                                                ; X is 0, so "Not X" is 1 or true
1
9
0 555
Edit
Article Mike Kadow · Jul 4, 2016 2m read

NewBie's Corner Session 10, Subject: Routines and Studio

Welcome to NewBie's Corner, a weekly or biweekly post covering basic Caché Material.

InterSystems Caché provides a GUI (Graphical User Interface) based Integrated Development Environment (IDE) called Caché Studio. Developers can use Studio to create and maintain applications.

InterSystems has a new IDE called Atelier but that is for later.

0
0 2
Question Yongfeng Hou · Jul 1, 2016

在Aix7.1上安装使用root用户安装cache2016.1.1.107,且在安装过程中创建cacheusr用户;更改操作系统上的cacheusr的umask后,通过数据库修改编译后的文件(如,js,csp等)在小机上查看权限不变(-rwxrw-r--  cacheusr cacheusr test.js)。

目的:通过数据库编译后的文件的other用户有读写权限。

3
0 1091
Question Ryan Vanden Heuvel · Jun 20, 2016

I am trying to write this loop as efficient as possible.  The global has over 10 million records.

SET PIDX=""    
For
 { 
              Set PIDX=$ORDER(^[Nspace]LAB(PIDX))
              Quit:PIDX=""  
              Set Data=$GET(^[Nspace]LAB(PIDX))
              Set BBData=$P(Data,"\",6)
              If BBData'=""
              {
              If BBData'="########"
              {

Am I better off not setting the variable BBData and using If $P(Data,"\",6)'=""

Also, is there a better way to write the two If statements in one line so it only continues if it is either "" or ########

6
0 901
Question Nikita Savchenko · Jun 14, 2016

Hello!

In Caché there is a way to print all current variables using write command without arguments:

USER>set Einstein = 1879
USER>set Mozart = 1756
USER>write
Einstein=1879
Mozart=1756

But is there a way to get a list of this variables? I am looking for something that would return value like $LB("Einstein", "Mozart") for this case.

Thanks!

16
0 1787
Question Evgeny Shvarov · Jun 23, 2016

Hi!

Here is the question in Russian Forum regarding roots extracting.

In Caché ObjectScript we use exponentiation operator (**) to raise an exponent to power. F.e. let's raise 3 to power of 3: 

USER> write 3**3 

27

And we use the same operator to extract the root. 

USER> write 27**(1/3) 

2.999999999999999963

And 2.999999999999999963 is not 3, obviously.

How to extract roots properly in Caché ObjectScript?

5
0 470
Question Eduard Lebedyuk · Jun 23, 2016

I have a MySQL server with "posts" table.

I also have a Caché server with "downloadedposts" table. 

They are connected from Caché to MySQL via SQL Gateway

I want to keep Caché table synced with MySQL one  (MySQL "posts" table is a master copy), so periodically Caché queries MySQL server and downloads data. So far so good, and if a record appears or changes in MySQL table, Caché downloads the changes.

The problem I'm encountering is that sometimes rows would be deleted from  MySQL "posts" table.

How do I synchronize deletions?

4
0 1228
Article Bill McCormick · May 27, 2016 1m read

Steve Glassman is on vacation today so in his place I wanted to announce the availability of a new kit for the 2016.2 Field Test. The kit details are: 2016.2.0.665.0

There is a wide range of changes to the 2016.2 Field Test, 145 of them in total.  You can find a complete listing here:

https://wrc.intersystems.com/wrc/WRC.StreamServer.cls?FILE=/wrc/FieldTe…

Bill McCormick

Director of Product Management

4
0 472
Article Steve Glassman · Jun 24, 2016 1m read

I am pleased to announce the next 2016.2 field test kit, 2016.2.0.677.0.

I haven’t sent an update to this thread in a while and it should come as no surprise that there has been quite a lot of development going on since I wrote about build 632.  In fact, there have been almost 300 changes covering most areas of the product.

The accumulated list of fixes to problems found in the field since build 632 includes the following changes:

0
0 400
Question David Losiewicz · Jun 23, 2016

I am testing application code and want to simulate error conditions. 

I am trying to use the following to define a custom error with a class method.

$SYSTEM.Status.Error($$$GeneralError,"Any text here")

My class method code looks like this....

set RunStatus=$System.Status.Error($$$GeneralError,"DXL Testing Run Error")

Class compile fails because the $$$GeneralError is unknown. 

ERROR: DBMS.Reports.TaskPage.1(5) : MPP5610 : Referenced macro not defined: 'GeneralError'
 TEXT: set RunStatus=$System.Status.Error($$$GeneralError,"DXL Testing Run Error")
 

5
0 1504