#Caché

30 Followers · 4.5K Posts

  

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

Documentation.

Article Danny Wijnschenk · Nov 7, 2017 5m read

This is a series of programming challenges for beginners and experienced Caché programmers.

For an introduction : goto to article https://community.intersystems.com/post/advent-code-2016-day1-no-time-t…

Today's challenge on http://adventofcode.com/2016/day/7 is about checking for valid IPv7 addresses with TLS support. (No, it has nothing to do with real ip addresses which are at most ipV6 or real TLS, but just a way to keep you busy coding & hacking!)

The imaginary ipV7 addresses support TLS if they contain an ABBA sequence outside square brackets and no ABBA sequence inside brackets.

2
0 513
Edit
Question Pravin Barton · Nov 7, 2017

Hello,

I have some code that reads an %XML.DataSet object that gets returned from a web service. I'd like to unit test this code by importing an XML data set from a test file. How can I do this?

I created the test file by calling WriteXML on the data set, and copying the output into the file:

do result.WriteXML(,,,,,1)

I tried to import the file using the XML reader, but the resulting data set doesn't have any rows:

USER>set reader = ##class(%XML.Reader).%New()
 
USER>w reader.OpenFile(filename)
1
USER>do reader.Correlate("SQLResult","%XML.DataSet")
 
USER>w reader.Next(.dataset,.status)
1
USER>w dataset
3@
0
0 0
Question Teresa Toler · Nov 7, 2017

I am a newbie to Cache and we are using dBeaver product to query against Cache tables. I have the following query which does a GROUP BY to aggregate the columns:

SELECT PtNumber,cpt4_OVR,CollDateODBC, COUNT(*)
FROM site.MGBILL_View 
  WHERE cpt4_OVR IN ('36415', '36416')
     --AND ChargeFlags = '0'
       AND CollDateODBC > DATEADD(DAY,-45,CURRENT_DATE)
  GROUP BY PtNumber,cpt4_OVR, CollDateODBC
  HAVING count(*) > 2

-This returns a count of 3 for each patient (aggregated)

But I need to display the actual 6 rows. I would typically do this by replacing the GROUP BY with an OVER(PARTITION BY

2
0 1185
Question Richard Housham · Apr 24, 2017

Hi I've created a word macro in order to convert doc to txt via the command line, this works fine via the command line by myself or another user but when I try as an the intersystems user which runs under  LocalSystem it doesn't work. 

So can I change the user, or set the $ZF to run as a different user?

Or do I have to try another way to convert doc to txt - it's looking like libreOffice?

I just wanted to stick with word because I could be guaranteed on the result being accurate.

Thanks

Regards

Richard

11
0 1439
Article Sean Connelly · Aug 21, 2017 3m read

If you want to dynamically serve images as a property of JSON then there is no perfect encoding solution. One method used frequently is to Base64 encode the image. Whilst there are some negatives to doing this, such as data inflation, there are some positives to working with Base64 images inside the browser.

Let's say you have an image placeholder on a web page...

<div id="image-container"><div>


And you fetch a JSON message from the Caché server containing the image as one of its properties...

var msg = JSON.parse(client.responseText);


Without needing to decode the image data you can create an img

4
1 1926
Question Alex Goncharov · Nov 6, 2017

Hello, evrybody, I'm writing one project using CSP("OnPreHTTP"), and also REST angular. At the beginning I wrote purely on csp, then I decided to use angular for the flexibility of the client part. Now I can not design logging, I created a table App.Log with properties

/// Type of eventProperty EventType As %String(MAXLEN = 10, VALUELIST = ",NONE,FATAL,ERROR,WARN,INFO,STAT,DEBUG,RAW") [ InitialExpression = "INFO" ];/// Name of class, where event happenedProperty ClassName As %String(MAXLEN = 256);/// Name of method, where event happenedProperty MethodName As %String(MAXLEN = 128
3
0 689
Question Victor Tamotsu · Nov 5, 2017

I work in a small development company that uses Caché as a database. In some support cases I have doubts about whether the client's infrastructure environment is not affecting Caché's response time. Reading a bit about comparing installations in different environments, both in production as testing and homologation environments , I understood that the TPC-E is a benchmarking method accepted in the market.
I'm reading the specifications of the TPC-E and I wonder if anyone has implemented or seen something similar in Caché. Does it make sense to think about using this type of test to understand a

4
0 450
Question Laura Cavanaugh · Nov 3, 2017

Hello; We are managing several Ensemble instances on several servers.  One server has 4 instances, and two other servers have one instance each (those are production servers).  We encrypt all instances using the Caché encryption in the management portal.

Currently we are using two different encryption keys: 1 key on the server with 4 instances, which is used for all 4 instances, and a second key on single-instance server. ( I'm installing the newest production server now.)

What I'd like to know is what are the best practices for managing encryption keys for separate servers. 

The options are to

1
0 772
Question CJ H · Nov 5, 2017

I get two methods below: I would run both methods concurrently.

However, the "testRead" would always read the uncommitted results from "testInsert".

Anyway to avoid that? Thanks.

ClassMethod testInsert()
{
  &sql(START TRANSACTION ISOLATION LEVEL READ COMMITTED, READ WRITE)
  &sql(insert into Test.Table(AttrA,AttrB,AttrC,AttrD) values(1,2,3,4))
  hang 15
  &sql(ROLLBACK)
}

ClassMethod testRead()
{
  &sql(START TRANSACTION ISOLATION LEVEL READ COMMITTED)
  &sql(select count(*) into :ans from Test.Table)
  &sql(COMMIT)
  w !,ans
}
5
0 775
Question Gerry Connolly · Oct 31, 2017

Is it possible to make the cache terminal available over a mirrored vip address for a healthshare mirrored environment? So that connecting to a terminal for a mirrored environment will always connect to the Live Node?

I'm looking to write a Powershell script to run against the system and need to connect to the Live Node in a mirrored setup. Is this possible or am I going to have to log onto each node to establish which is Live.  Or does this even matter?

4
0 569
Article Danny Wijnschenk · Nov 3, 2017 4m read

This is a series of programming challenges for beginners and experienced Caché programmers.

For an introduction : goto to article https://community.intersystems.com/post/advent-code-2016-day1-no-time-t… or look at the http://adventofcode.com/ website.

In today's challenge, you have to find out how many 'valid' triangles you find on the walls of the Easter Bunny HQ.
(you can find the input on the adventofcode website : http://adventofcode.com/2016/day/3/input)

A sample of the input looks like this :

  810  679   10
  783  255  616
  545  626  626
   84  910  149
  607  425  901
3
0 707
Article Danny Wijnschenk · Nov 2, 2017 4m read

Advent of Code is a series of programming challenges for beginners and experienced Caché programmers.

For an introduction : look  at article https://community.intersystems.com/post/advent-code-2016-day1-no-time-t…

In this challenge, you need to find a password using instructions to move on a keypad.
Instructions can be U(p), D(own), L(eft) and R(ight).

You start at button 5 on a keypad like

1 2 3
4 5 6
7 8 9

each line of instructions lead to one digit of the password.
Full description can be found at http://adventofcode.com/2016/day/2

For example : ULL leads to '1' (a move outside the k




0
0 427
Question Soufiane Amroun · Oct 30, 2017

Hi Team

i want to implement  an Oauth 2.0 framework in my application , i define my  connexion IHM, i want to check if the login and password are right when a user connect

do you've any idea ?

thank's

2
0 605
Article Brendan Bannon · Nov 29, 2016 7m read

The Art of Mapping Globals to Classes (3 of 3)

If you are looking to breathe new life into an old MUMPS application follow these steps to map your globals to classes and expose all that beautiful data to Objects and SQL.

If the above does not sound familiar to you please start at the beginning with the following:

The Art of Mapping Globals 1

The Art of Mapping Globals 2

This example is going to show you how to map a classic parent-child structure.

Same disclaimer:  If you can’t make heads or tails of your globals after reviewing these articles please contact the WRC and



9
0 2032
Question Jason Ip · Sep 20, 2016

So just this morning we started to get this error from all of our SQL-client based tools that connect to our Caché SQL via ODBC: 

[%msg: <Error instantiating cached query class in Prepare(): <METHOD DOES NOT EXIST>Prepare+41^%SYS.SQLSRV *%New,%sqlcq>] (State:S1000, Native Code: 190)]

No queries work... any help? stumped over here.

doing a SQL query via Class %SQL.Statement

##class(%SQL.Statement

in Caché command line works... so that's why I think it's an ODBC issue..

I can't seem to find a SQLSRV class in the %SYS documatic

6
0 1301
Question Nadirbek Nurlybekov · Nov 1, 2017

Greetings to all! Faced with such a problem, I ask for help, someone with great practical skills I think has already implemented this.The task was not to delete any objects from the database, but somehow mark this data deleted by client, because of this, I added Property Deleted As% Boolean [InitialExpression = 0];in the class.And in the redefined method %OnDelete:

ClassMethod %OnDelete(oid As %ObjectIdentity) As %Status [ Private, ServerOnly = 1 ]
{
        s person = ..%Open(oid)
        s person.Deleted = 1
        d person.%Save()
        Quit $$$ERROR(2112, "DeleteOperationNotAll
3
0 892
Article Danny Wijnschenk · Nov 1, 2017 8m read

Advent of Code is a series of 25 small programming challenges, it's an ideal way for beginners to start learning a computer language, and for advanced people to sharpen their programming skills.

There are small and bigger puzzles, which you can solve typically in half an hour to a few hours. (Looking at the leaderboard, the top aces can do them in less than 10 minutes.)

Advent of Code is created by Eric Wastl, you can find all info on https://adventofcode.com/.

To help you get trained for this year's challenges which start at December 1st, we* will try to solve and comment the puzzles from

0
1 1442
Question Pravin Barton · Oct 30, 2017

I want to limit the length of the value of a textarea in Zen. In HTML the textarea element has a 'maxlength' attribute, but the Zen component doesn't have an equivalent property. Is there any way to add a maximum length in Zen short of creating my own custom component?

3
0 820
Question Sergio Martinez · Oct 16, 2017

Hi,

I know you're doing a big effort to build a new IDE in Eclipse ecosystem but Visual Studio Code is a new an even better and faster tool for coding... did you have any plans to release any COS extension for it in the near future? There you can already find extensions for all current more common progrmaming languages and it would be great to have COS as one of them.

Thanks

5
0 1546
Question Eduard Lebedyuk · Oct 30, 2017

I'm extracting text from HTML (more on how - here), and after I extract text it has two problems:

  • Lot's of $c(10) control characters
  • Multiple whitespaces

Here's an example of the text extracted from HTML page:

set text = " "_$c(10)_" "_$c(10)_" "_$c(10)_" "_$c(10)_" "_$c(10)_" "_$c(10)_" "_$c(10)_" "_$c(10)_" "_$c(10)_" "_$c(10)_" "_$c(10)_" "_$c(10)_" "_$c(10)_" "_$c(10)_" "_$c(10)_" "_$c(10)_" "_$c(10)_" "_$c(10)_" "_$c(10)_" "_$c(10)_" "_$c(10)_" "_$c(10)_" "_$c(10)_" "_$c(10)_" "_$c(10)_" "_$c(10)_" "_$c(10)_" "_$c(10)_" "_$c(10)_" "_$c(10)_" Word1"_$c(10)_" "_$c(10)_" "_$c(10)_" "_$c(
2
0 2024
Question Alexey Maslov · Oct 17, 2017

This small function is of great need sometimes. My solution is straightforward:

dupquote(str) ; duplicate quotes in str    quit $replace(str,$char(34),$char(34,34))

I'm just curious whether other solutions exist. Is there some "standard" and/or quicker approach which I've just overlooked?

6
0 1243
Edit
Article Danny Wijnschenk · Oct 29, 2017 1m read

Advent of Code is a series of 25 small programming challenges, created by Eric Wastl, see https://adventofcode.com/.

There are small and bigger puzzles, which you can solve typically in half an hour to a few hours. (Looking at the leaderboard, the top aces can do them in less than 10 minutes.) 

It's an ideal way for beginners to start learning a computer language, and for advanced people to sharpen their programming skills.

To help you get trained for this year's challenges which start at December 1st, I will try to solve and comment the puzzles from 2016.

Each day, you get two puzzles, where the

0
0 0
Question Eduard Lebedyuk · Oct 26, 2017

I have a classname and a property name. I want to know, when I get object value directly from a global, which property corresponds to which position in the $lb structure.

Here's what I got so far:

Class Utils.Storage {

/// write ##class(Utils.Storage).GetPosition()
ClassMethod GetPosition(class As %Dictionary.CacheClassname = "Sample.Address", property As %Dictionary.CacheIdentifier = "Zip") As %Integer
{
    set strategy = $$$comClassKeyGet(class, $$$cCLASSstoragestrategy)    
    set strategyId  = class _ "||" _ strategy
    &sql(SELECT Name INTO :position
         FROM %Diction
6
0 698