#Caché

30 Followers · 4.5K Posts

  

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

Documentation.

Article Alexander Koblov · Oct 12, 2016 1m read

Interesting anecdote I want to share. Not 100% Caché related, but I hope it would be useful.

When CSP Gateway is configured on IIS, opening CSP Gateway Configuration page is prohibited by default -- as IIS blocks URLs with '/bin' in it.

In our documentation we advise to add <remove segment="bin" /> to applicationHost.config file. That is correct.

Recently I had problem when manual editing file Windows\System32\inetsrv\config\applicationHost.config has absolutely no effect on IIS.

Turned out (http://serverfault.com/a/599865) IIS was 64-bit and notepad++ that I used for editing was 32-bit.

0
0 1070
Question Lisa Stieg · Oct 11, 2016

Very new to this side of cache.... 
So, currently in the habit of keeping all users forever, up to over 5000... ? is what if we decided to start deleting old users who have been gone from the company, how would it affect any account level information? notes, payments etc....  Is there any documentation anywhere that would answer this or describe this process or maybe best practices??
Sorry if this seems stupid but i am working on a proof theory for work.

7
0 479
Article Alexey Maslov · Oct 12, 2016 3m read

The goal of this writing was to illustrate how to restore backup before the patch would be applied. The alert notes that: 

The risk can be avoided by applying journals from the beginning of the journal file that was switched to at the start of the backup, rather than accepting the default of starting from the journal marker position.

Having non-patched Caché 2015.1.4, I ran sample database backup and restore just to get where I should answer "No". Collecting journal info from the backup log: 

0
0 438
Article Marcel den Ouden · Mar 29, 2016 2m read

As some customers recently received new license keys, I received some questions why their new license does not seem to work, other than the expiration date being reached. So far I was able to solve all of them with this short list of things to look at.

1. Is the date on your laptop set properly?

2. For Europe (and possibly other regions): the expiration date in the cache.key file is in US format, MM/DD/YYY, while most people there are used to DD/MM/YYY. This is obvious if you have an expiration date like 11/30/2016, but not with dates like 3/12/2016 (expires in March, not December).

5
0 1975
Edit
Question Peter Kopp · Oct 11, 2016

Good morning, I am using a <Image/> tag, in a <Tab/> tag, of a <TabGroup/> to render a tif image. I would like the tif file to be rendered full size. However, I have not been able to achieve this using the height="100%"  and width="100%" parameters available. All I get is an envelope with scroll bars, with perhaps a quarter of the image visible at any one time. Thank you in advance for any and all feedback.

2
0 18
Article Dmitry Maslennikov · Oct 11, 2016 5m read

This text is a continuation of my article where I explained the structure a Caché database. In this article, I described the types of blocks, connections between them and their relation to globals. The article was purely theoretical. I made a project that helps visualize the block tree - and this article will explain how it works in great detail.

3
1 2252
Question Thomas Chericka · Oct 7, 2016

Hi,

Thanks a million for taking the time to read this.

I'm calling the functions $ZF(-`1, <path to EXE>) and $ZF(-2, <path to EXE>) from Cache code. The exact code I'm using in Cache Studio is given below.

/// Test the functionality of ZF(-1) and $ZF(-2), 
Class %SourceControl.UnitTest Extends %Persistent
{
Parameter PATH As %String = "E:\VCS\CommandExecutor\bin\Debug\WindowsApplication.exe";
ClassMethod Test()
{
Do $ZF(-2, ##Class(%SourceControl.UnitTest).#PATH)
}

Now when I run the command in the Cache Terminal, as given below,

>do $ZF(-2, "E:\VCS\CommandExecutor\bin\Debug\WindowsApplication.exe")

6
0 936
Question Ray Hitchins · Oct 10, 2016

We have a very old green screen application which is currently producing PCL "documents". I want to update this to produce PDFs - are there any shortcuts / tips? I'm aware Zen Reports can allegedly do it, but I want to avoid that route if I can.

1
0 428
Question Sébastien Demoustiez · Oct 10, 2016

Hello,

First sorry for my english :)

I'm looking for a solution to reset the cursor of a query in a csp page.

In my code I do:

<csp:query name="users" classname="UserId" queryname="Find">
 <csp:while condition="users.Next()">
         ...
 </csp:while>

And 100 lines after I have to do exactly the same ...

Is it a way to do the while without do the query again ?

Something like users.Reset() ??

Thanks a lot for your help

Sébastien

2
0 732
Question Scott Beeson · Oct 6, 2016

I experience this constantly with Cache SQL.  Especially when querying the ATNA log.

SELECT TOP 400000 * FROM HS_IHE_ATNA_Repository.Aggregation ORDER BY ID DESC

That took 12 seconds.  I then upped the number to 500,000 and it took 185 seconds.

Shouldn't the execution time scale proportionately?

If I run the 500,00 query again it takes 2.4 seconds.

4
0 521
Article John Hotalen · Oct 4, 2016 1m read

How to parse a URL in Caché:

Let's pretend you are working on a project where you may be retrieving a URL for some purpose and you have the need to be easily able to parse apart that URL to get the various components that make up the URL.

Here's how to do that:

Note:  This example assumes you have a variable named sURL that contains some url (i.e. http://www.intersys.com/main.csp?QUERY=abc#anchor) and you will be creating an array of the URL component pieces, where the array will be named aComponents.

In your class/routine, add the following code:

Do ##class(%Net.URLParser).Parse(sURL,.aComponents)

8
0 2004
Question david clifte · Oct 5, 2016

I have to connect to an external database and I'd like to use the JDBC SQL Gateway.

I followed this tutorial [1] to create a JDBC SQL Gateway and after configured it works as expected, but I don't know

how use this connection into source code. Maybe these other tutorial is related [2] and [3].

[1] http://docs.intersystems.com/latest/csp/docbook/DocBook.UI.Page.cls?KEY…

[2] https://community.intersystems.com/product-documentation/intersystems-p…

5
0 1106
Question Chris Stewart · Oct 7, 2016

Hi


I have been working on changing a web application from using %FileBinaryStream to storing and serving the file content from a %Stream.GlobalBinary property, stored in a new database.  I have managed to migrate the data across, and have also been able to redirect the stream so that it is being served through the web link.  However, the previous method set attributes on the File stream to have the stream be rendered as the original file type through MIME, using this code

do stream.SetAttribute("ContentDisposition","inline; filename="_filecvt)

2
0 1128
Question 吉光 芳史 · Sep 21, 2016

Hi, There

How to use open text file. I have a one file. the file is original file from excels file. After later convert to CSV file.

some cells has include cr+lf  control code. If i open and use from cache. reding time,Cache was wrong line feed point.

how do i edit my source code?

==============================================

s infile="c:\csvfile.csv"

o infile:"r"

1 u infile r line i $zeof<0 c infile q

   f i=1:1:10 s wd(i)=$p(line,",",i)

g 1

==============================================

4
0 1088
Edit
Question Thomas Chericka · Oct 7, 2016

Hi,

Thanks a million for taking the time to read this.

I'm calling the functions $ZF(-`1, <path to EXE>) and $ZF(-2, <path to EXE>) from Cache code. The exact code I'm using in Cache Studio is given below.

/// Test the functionality of ZF(-1) and $ZF(-2), 
Class %SourceControl.UnitTest Extends %Persistent
{
Parameter PATH As %String = "E:\VCS\CommandExecutor\bin\Debug\WindowsApplication.exe";
ClassMethod Test()
{
Do $ZF(-2, ##Class(%SourceControl.UnitTest).#PATH)
}

Now when I run the command in the Cache Terminal, as given below,

>do $ZF(-2, "E:\VCS\CommandExecutor\bin\Debug\WindowsApplication.exe")

0
0 2
Article Ben Spead · Aug 25, 2016 4m read

Background

Caché 2016.1 introduced some very powerful JSON features.  Unfortunately, the syntax used in the 2016.1 release is going to be changed in the 2016.2 release to bring it closer to Caché ObjectScript syntax.  This will mean that code that works in 2016.1 may not be forwards compatible.   See this announcement and this article for more details about the changes.

11
0 2143
Article Sylvain Guilbaud · Oct 4, 2016 6m read

This sample class will add parameter DSINTERVAL to each class containing the parameter DSTIME

To execute it from a Terminal :


SAMPLES>d ##class(adm.param).add(,,1)
[SAMPLES] parameter DSINTERVAL=5 added to class DeepSee.Study.CityRainfall (via adm.param)
[SAMPLES] parameter DSINTERVAL=5 added to class HoleFoods.Transaction (via adm.param)
[SAMPLES] parameter DSINTERVAL=5 added to class News.DeepSee.NewsArticle (via adm.param)
DSINTERVAL parameter was added to 3 classes
6
1 1139
Question William Proctor · Sep 30, 2016

Good Morning and thanks in advance for all replies.  I have created a PowerShell script for backing up CACHE and all related files to be run on a nightly basis.  My script works as long as the Unknownuser has %all access which is not acceptable in our production environment.  I have tried every format I can thank of to get the script to use a specific id with no luck.  How can I get this command to run under a specific id? 

..\bin\cache -s. -U%SYS "##Class(Backup.General).ExternalFreeze() <d:\backup\login.scr" 

The file just has

userid`r`n
​password`r`n

5
0 757
Article Mike Kadow · Sep 15, 2016 2m read

NewBie's Corner Session 27 Traversing A Global with $Order Part 1

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

Traversing A Global

Perhaps the most difficult concept in Caché/MUMPS is its Global Structure. This session and several that follow it deals with the Global Structure. However, just presenting the material will not guarantee your understanding of it. You must experiment with the data and concepts that are presented.

In this session, we are going to create a small Global of three levels deep, and then show the code to Traverse the Global.

20
0 911
Article Mike Kadow · Sep 23, 2016 5m read

NewBie's Corner Session 28 Various Methods to Traverse a Global

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

Judging from the number of responses to Session 27 Traversing A Global, developers are passionate about their methods. I am not here to judge the merit of the various methods.

Over the next few pages I will demonstrate a number of methods to Traverse a Global. If you don't already have a favorite they may help you pick one.

I will repeat the method from Session 27 just to have all methods in one post.

13
0 718
Question Rustam Ibragimov · Aug 5, 2016

Hello, guys.

I need to copy the text from one stream to another filestream and save it. I am using  

do fileStream.CopyFromAndSave(rtn.Code)

However, if "rtn" stream contains Russian characters I get something like "???". Is there any way to convert stream to Unicode?  Something like $zc(str, "O", "UTF8") for streams.

3
0 474
Question James Fitzpatrick · Sep 28, 2016

Hi all,

This is a real long shot, but does anyone have experience integrating MS wsHttpBinding with a Cache application?

Link 

I ask because my project had some initial design discussions for new web service communication and this specification was mentioned. 

Thanks.

1
0 367
Question Rustam Ibragimov · Sep 9, 2016

Hello, guys. 

I found one interesting moment in Cache Object Script. It doesn't have(or at least I didn't find) trimming function. By trimming I mean if a string has some whitespaces/tabs/carriage returns from very beginning or/and from very right, this function removes them. 

  I have found several workaround ways. 

1. Using Cache Basic

ClassMethod TrimCacheBasic(str As %String) As %String [ Language = basic ]{Return Trim(str)}

2. Using SQL

6
0 2121
Question Scott Beeson · Jun 21, 2016

I'm following the tutorial here.  When I try to call the default Test() method I get the following error:

An error occurred with the CSP application and has been logged to system error log (^ERRORS)

I found this document which says I need to make the "Web Application" accessible by running a couple commands.  I'm not even sure I created a Web Application.  Regardless, I tried a few variants but still get the same error.

Here is the URL for the Service Catalog: /csp/healthshare/mhclib/Custom.MHC.Scott.ServiceTest.cls

I tried different things including these two:

5
0 3304