#Caché

30 Followers · 4.5K Posts

  

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

Documentation.

Question infi livi · Aug 7, 2019

Hi All,

While Executing Custom SOAP fault got an error.Please help me out of this.

Sample Code:

set fault=##class(%SOAP.Fault).%New()
set fault.faultcode=$$$FAULTServer
set fault.detail="<mymessage>Division error detail</mymessage>"
set fault.faultstring="Division error"
// ReturnFault must be called to send the fault to the client.
// ReturnFault will not return here.
do ..ReturnFault(fault)

Error Details:

<ZSOAP>zReturnFault+3^%SOAP.WebService.1

Advance Thanks

1
0 456
Question Jereme Hall · Aug 7, 2019

For Cache client install automation, where are the remote server settings stored on a Windows 10 PC? 

Are they stored in the registry?  I found the Cache registry key, but it only lists the remote server address and not the ports.

Are they stored in an INI file?  If so, I haven't found it yet.

I can push the client install via the very helpful CEDocs URL (https://cedocs.intersystems.com/latest/csp/docbook/DocBook.UI.Page.cls?KEY=GCI_windows_silentinst

2
0 483
Article David Crawford · Jul 31, 2019 2m read

IRIS provides us with anti login CSRF attack mitigation, however this is not the same as a CSRF attack, as login attacks only occur on the login form. There are currently no built-in tools to mitigate CSRF attacks on api calls and other forms, so this is a step in mitigating these attacks.

See the following link from OWASP for the definition of a CSRF attack:

https://www.owasp.org/index.php/Cross-Site_Request_Forgery_(CSRF)

5
1 830
Article Sean Connelly · May 31, 2017 28m read

Cogs Library

Over the next few months I will be releasing a number of open source libraries and tools to the Caché community.

Most of the code has evolved from previous production grade solutions over the years and I am collating it together under a single overarching library package that I am calling Cogs.

38
4 1661
Article Alexander Koblov · Jul 29, 2016 10m read

In this article we are going to compare $Increment and $Sequence functions.

First of all, a note for readers who have never heard of $Increment. $Increment is a Caché ObjectScript function which performs an atomic operation to increment its argument by 1 and return the resulting value. You can only pass a global or local variable node as a parameter to $Increment, not an arbitrary expression. $Increment is heavily used when assigning sequential IDs. In such cases parameter of $Increment is usually a global node. $Increment guarantees that each process using it gets a unique ID.

11
5 1965
Discussion Eduard Lebedyuk · Jul 31, 2019

Let's have a round of CodeGolf!

As usual the goal is to write the shortest solution for a specified problem.

Today we have one of the classics: FizzBuzz.

Write a program that prints the numbers from 1 to 100.

But for multiples of three print “Fizz” instead of the number and for the multiples of five print “Buzz”.

For numbers which are multiples of both three and five print “FizzBuzz”

22
1 798
Question Zdeněk Bartušek · Jul 31, 2019

Hello community,

I need to know if there is any method which can me say specified imported files or namespaces in Cache.

To better specification of my problem, I've got two installer manifests. Firts one did some resource changing and import some files and classes, second one must be started after the first one, because it's only his update, which creates some nemaspaces. So i need to check if the first manifest ran succesful and I can start the second one.

Is it good way trying to do this by some method or are there some other, better ways maybe by ccontrol, I don't know?

1
0 255
Question James Hipp · Jul 29, 2019

Hello,

Is it possible to write global output values to STDOUT, in a similar way to how csession can take routine intput, like below:

(In Cache Terminal)

%SYS>d ##class(%SYSTEM.License).ShowSummary()

License Server summary view of active key.

     Distributed license use:

Current License Units Used =        1

Maximum License Units Used =        1

License Units   Authorized =      200

     Local license use:

Current Connections =      1  Maximum Connections =      1

Current Users       =      1  Maximum Users       =      2

(From Linux OS Terminal)

5
0 671
Question Zdeněk Bartušek · Jul 30, 2019

Good morning,

I'm trying to understand $ZF function, but only documentation isn't enought in this way. So my question is is there any possibility to get enviroment variable by this function into ensemble?

I've tried this as example from ducumentation, but there is an error and  I don't know why...

Thanks for your solutions.

Zdenek

17
0 1435
Article David Crawford · Jul 26, 2019 3m read

Hello community! I have to work with queries using all kinds of methods like embedded sql and class queries. But my favorite is dynamic sql, simply because of how easy it is to manipulate them at runtime. The downside to writing a lot of these is the maintenance of the code and interacting with the output in a meaningful way. In an effort to have as much dynamism as possible so that we're not rewriting code constantly, and so that we have as little code possible (while still making sense and getting the job done), I made a function that takes in any dynamic query and outputs a dynamic object.

7
2 1263
Question Dan Pahnke · Jul 23, 2019

Hello,

I've got a csp page that has successfully set up a websocket connection to a Cache class. When the websocket object's close function is triggered at the browser I was expecting one of the class' methods to fire at the server. The onclose method is triggered at the browser but nothing at the server. Is a method supposed to fire at the server?

Thanks,

Dan

Cache for Windows (x86-64) 2015.1.4 (Build 803_6) Tue May 15 2018 12:08:36 EDT

4
0 1289
Article Sean Klingensmith · Nov 18, 2016 10m read

As a developer, you have probably spent at least some time writing repetetive code. You may have even found yourself wishing you could generate the code programmatically. If this sounds familiar, this article is for you!

We'll start with an example. Note: the following examples use the %DynamicObject interface, which requires Caché 2016.2 or later. If you are unfamiliar with this class, check out the documentation here: Using JSON in Caché. It's really cool!

##Example

2
3 3581
Question Hendri Schoeman · Jun 4, 2018

Hi all,I hope this is the right forum to ask this type of question, but I'm running out of ideas.For reasons beyond my control, we run a version of Intersystems Caché (2013.1) that is not supported by Atelier. As such, I use Caché Studio to do my development.The issue I have is, I don't run Windows or MAC, but Linux (Ubuntu 18.04 in my case). I've successfully managed to get Studio working using Wine and pretty much everything is usable. There is just *one* issue which neither me or my peers can solve. If you hover over a line in the code editor, a tooltip reading 'First record' appears. This

8
0 2181
Article Rubens Silva · Jul 25, 2019 2m read

Hello everyone, it took some time but I'm finally getting things done again. Phew! But for now, allow me to introduce a tool that I've been using frequently.

I call it Forgery.

This description has been taken from my GitHub repository, also available on OpenExchange:

Forgery is a server-side utility that allows executing simulated HTTP request by forging calls to REST applications. This makes Forgery ideal for using together with test suites that need to call the API via HTTP but could face issues with license usage and its grace period.

0
2 469
Question Russell Knight · Jul 3, 2017

Greetings,

Can someone please show me via coding example(s) how to write an input prompt that will read in a function key, F7 for example, validate that the key pressed is F7 and then process it all via cache.

7
0 519
Question Bob Ebbert · Jul 18, 2019

Hi,

I have  a program that displays the current running processes to the screen. I need to have a program execute that display program and capture the results to a file. The display program does pause at the bottom of each page waiting for an 'enter' to go to the next page.

Note( the display program will not successfully compile on the current system but it does work)

Also - very, very new to Mumps. 

Thanks,

Bob

23
0 674
Question Jimmy Christian · Jul 16, 2019

Hello community,

I am trying to parse the below HttpResponse in Cache. Cannot get the Iterator to work. Is there a single loop which can parse both or single messages and grab the error?

{
error:[
{ txt1:'error msg1'},

{ txt2:'error msg2'},
]
}

 

{
error: {
txt1:[
'error msg1',

'error msg2'
]
}

 

Thanks,

Jimmy Christian

16
0 2374
Question lw wei · Jul 17, 2019

The steps are as follows:

1. create global

 For I=1:1:200 Set ^ABC(I)=""
 For I=1:1:200 Set ^XYZ(I)=""
 For I=1:1:100 Kill ^ABC(I)

2. create ZJRNFILT

ZJRNFILT(jid,dir,glo,type,restmode,addr,time)    /*Filter*/
  Set restmode=1                                  /*Return 1 for restore*/
  If glo["^ABC",type="K" Set restmode=0           /*except if a kill on ^ABC*/
  Quit
  ;

3. restore

s RestOref=##class(Journal.Restore).%New()
s RestOref.FirstFile="20190717.007"
s RestOref.LastFile="20190717.007"
s RestOref.JournalLog="journal.log"
s RestOref.Filter="^ZJRNFILT"
s Status=RestOref.Run()

7
0 586
Question nok nok · Jul 17, 2019

Hi there

Would you please advise how to count how many keys are duplicated in global, for example, Athens was duplicate 3.

Set ^Data("Cambridge") = "1"
 Set ^Data("New York") = "2"
 Set ^Data("Boston") = "3"
 Set ^Data("London") = "4"
 Set ^Data("Athens") = "5"
 Set ^Data("Athens") = "6"
 Set ^Data("Athens") = "7"

Thanks

9
0 509
Question Jeffrey Drumm · Jul 18, 2019

I need to copy a bunch of globals from some crufty old databases to spanking clean brand new ones. GBLOCKCOPY has this cool feature that lets you create a batch of global names to copy and save the list in a batch. You can then execute the batch and go take a nap.

I like naps.

I need to do this for a number of old-new database pairs, but it's the same global names every time. Is there a way to export the batch configuration created the first time and import it to another environment/namespace? These databases will be spread across multiple hosts.

Thanks!

2
0 408