#Caché

1 Follower · 4.5K Posts

  

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

Documentation.

Question Paul Dayan · Nov 9, 2018

Can anyone tell me how to discover in ObjectScript the operating system and operating system version that Caché is actually running in? (Not the operating system the build was compiled for.)

11
1 1251
Question Justin Wilson · Nov 9, 2018

I need to dynamically create a class based on a parameter passed into a class method.  Basically the method takes in a string that contains the name of the class I need to create a new instance of. 

I need something along these lines. 

ClassMethod someMethod(className As %String)
{
	set classObject = ##class(className).%New()

...
}

Trying to do this right results in a class not found error because it seems to be treating the variable as a literal string.

3
1 1195
Question Dmitry Maslennikov · Sep 17, 2016

Working on implementation FHIR to my project, I found interesting project HAPI-FHIR, which could help me to quickly launch my FHIR api server with InterSystems Caché as a storage, because this projects uses Hibernate to connect to database, as an example they use DerbyDB. I tried to change settings to use InterSystems Caché, but unfortunately it does not work and throw some errors inside HIbernate. As I found in Caché documentation, I have not some many options, I just have to set Cache dialect, and set database url.  This projects uses Hibernate 5.1

13
0 1811
Question Mark Anthony Manalo · Jun 4, 2018

Hi Everyone,

I am trying to built a SSIS package thru BIDS Visual Studio 2013. My Datasource is a InterSystems Cache Database, I wanted to Import Tables records from the Datasource to MS SQL Server 2014.

As a Sanity check. I only created one Package to import one Table to MSSQL Server to try out. The connection to the InterSystems Cache Database was successful. The DSN for the InterSystems Cache Database is created in the System for 32 and 64 Bit.

6
0 2167
Question Robert Gasper · Nov 6, 2018

Has anyone worked out a way to use LDAP to define the default namespace on multiple servers?  I know that documentation says that intersystems-Namespace-xxx only supports one namespace, but how is this useful?   Any workaround to say have  intersystems-Namespace-server1-namespaceA  and intersystems-Namespace-server2-namespaceB?  Is it best practice to use the same "namespace" on every server?

Thanks!

1
0 334
Question Frank SERVAIS · Nov 1, 2018

I downloaded and installed the trial version of Caché.
it is installed in c:\intersystems\Trycache
I changed the system environment settings so that
GLOBALS_PATH = c:\intersystems\Trycache
and PATH includes c:\intersystems\Trycache\bin
Caché works, and I can login, use the globals, etc...

1
0 381
Question Kevin Dunn · Nov 1, 2018

I'm trying to  interpret a ObjectScript pattern and I am stumped on the first part. I understand everything else but not sure what 1.A means. I know A stands for Alpha characters just not sure what the 1. means

3
0 599
Question Scott Hawkins · Oct 30, 2018

Hello,

I have been trying to pull data through a linked server in SSMS from an InterSystems Cache Database for a while, this is to enable us to join the data to other source systems in our Data Warehouse.

I have set up an ODBC connection and a linked server to the database and can execute queries through OPENQUERY in Management studio, but the data is huge (> 100million rows). So when I execute a SQL query with a WHERE clause the query just spins.

2
0 976
Question Coty Embry · Oct 29, 2018

I'm trying to execute a nodejs process to perform some work on a string from Cache/Mumps over to nodejs, then return the result from nodejs as a string back to the code in Cache and I was looking at the `$ZF` logic - it will let me output the results to a file (i.e. temp.txt) but I dont see a way to just get the output set back to an M variable like (and I know this is not the correct syntax, but just for example)

S myOutput=$ZF(-100, "echo something") ;; wrong syntax but just for example

W myOutput ;; want to write out "something" but of course this doenst work

4
0 1124
Question Keshav Iyer · Oct 30, 2018

What is the difference between %ID and ID in a database table? Both seem to reference the same column labelled ID.

For context, I am trying to create a viewer class for an existing persistent class.

Let us call the persistent class A, with SqlTableName = OldA.

The viewer class will be B with SqlTableName = A and ViewQuery = {select %ID, <other fields> from <some other class with the same fields as A>}

In A, there exists a class query: select %ID from A. However, A fails to compile, giving an error: "Field '%ID' not found in applicable tables". If the %ID is replaced with ID, the class compiles. 

1
0 1427
Question Satish P · Oct 29, 2018
Hi,
I was understanding the cluster configuration supported by the Cache. Have couple of queries around that:
1. In Cache version 2018.2, there is a shrading concept which splits the data of a Master Data server into multiple small data server which store shraded data.
How do we protect (backup and restore) such environment, should we also backup/restore the multiple small data servers along with  Master data server. Any documentation around this will really help.
2. In case of Cache DB Horizontal scaling, we keep adding multiple Application and data servers - to ensure load balancing -
3
0 427
Question Satish P · Oct 25, 2018

Hi,

We are trying to write an external backup application to backup Cache Database. After going through the Cache DB documentation, we have found that in Backup.General class there are methods for creating snapshot (Freeze/Thaw) which is required during backup. Are there REST APIs for the same?


Also we have the option of selecting individual DB instances in the management portal.  What are the methods/APIs of getting the DB list, so that user can select individual DB instances in an external backup application ? Do we have the methods/APIs to freeze/thaw the individual DB instances ?

Thanks!

5
0 749
Article Gevorg Arutiunian · Aug 22, 2018 1m read

(Originally posted on Intersystems CODE by @Eduard Lebedyuk, 10/12/15) The following code snippet outputs all filenames in the file path "dir" in the Cache/IRIS terminal. The class method "test" runs the code:


Class eduardlebedyuk.filenamesInDir Extends %RegisteredObject
{
	classmethod test() {
		// replace dir with file path you want
		set dir = "D:\directory" 
		set dir = ##class(%File).NormalizeDirectory(dir)
		set file=$ZSEARCH(dir_"*")
		while file'="" {
			write !,file
			set file=$ZSEARCH("")
		}
	}
}
3
2 2030
Article Alberto Fuentes · Feb 19, 2016 1m read

Attached code contains a very basic $system.WorkMgr example.

It uses several jobs (workers) to update different chunks of rows of a table.

Steps:

  • Creates a table with 100 records.
  • Split table  in chunks 
  • Initialize WorkMgr and queue chunks to workers.
    • Every worker simply sets its process number in the Job field of the processed row. 

In this case, I have tested the example in a 8-core laptop:

1
0 924
Question Rosti Zacharias · Oct 24, 2018

Hi,

I would like to know if anyone has had some experience in building systems for multiple end-users. 

To keep things simple, in a hypothetical example, say an Event Booking System, where a Venue could sign up to use such a system and define it's Venue, costs, calendars, etc.. and then invite their customers to book the Venue on different days/times. 

If I wish to offer such a system to many Venues, there are a number of options available.

6
0 2296
Question Seppo Kruth · Oct 25, 2018

I'm trying to set up a  webserver (Apache 2.4 on Windows 10) for a CSP application on a Cache which is not running on the same Computer. 

My Problem is that in the csp-pages there is a declaration:

<link rel="stylesheet" type="text/css" href="/jbsscan/stylesheets/style.css"></link>
<script language="JavaScript" type="text/javascript" src="/jbsscan/javascript/javascriptScanner.js"></script>
 

5
0 638
Article Gevorg Arutiunian · Oct 26, 2018 1m read

This code snippet contains the class method "test" which sends an HTML email. Change the literal strings in the method to customize the email's from address, to address, subject, and body:


Class objectscript.sendEmail Extends %RegisteredObject
{
	classmethod test() {
		set m=##class(%Net.MailMessage).%New()
		set m.From="user@company.com"
		 
		set m.IsHTML=1
		 
		do m.To.Insert("user@company.com")
		set m.Subject="Sent by IRIS mail"
		set m.Charset="iso-8859-1"
		do m.TextData.Write("<HTML><HEAD><TITLE></TITLE>"_$char(13,10))
		do m.TextData.Write("<META http-equiv=Content-Type content=""text/html; charset=iso-8859-2""></HEAD>"_$char(13,10))
		do m.TextData.Write("<BODY><FONT face=Arial size=2>Test <B>Test</B></FONT></BODY></HTML>")
		set s=##class(%Net.SMTP).%New()
		set s.smtpserver="mail.company.com"
		set status=s.Send(m)
	}
}

Here's a link to the code on GitHub

0
1 1248
Article Vasiliy Bondar · Oct 14, 2018 4m read

From the first glance, the task of configuring LDAP authentication in Caché is not hard at all – the manual describes this process in just 6 paragraphs. On the other hand, if the LDAP server uses Microsoft Active Directory, there a few non-evident things that need to be configured on the LDAP server side. Those who don’t do anything like that on a regular basis may get lost in Caché settings. In this article, we will describe the step-by-step process of setting up LDAP authentication and cover the diagnostic methods that can be used if something doesn’t work as expected.

3
2 2335
Job Simcha Gershon · Oct 20, 2018

Hi every body

I hope it's the right place & I'm not offending any body.

I'm a veteran Mumps/Cache/Ensemble programmer .  I think my only draw back is my age, although my brain is still young & bubbly.

I'm looking a long time for work without success.

I gathered a lot of knowledge & experience during those long years , developed many projects & i'm ready to do any work only to feel useful.

I'll add my resume, I hope & wish that this post will bring some change as I'm desperate to get some work.

Thank you very much Simcha my email is shiluvg@gmail.com

Covering letter

Good day

0
0 473
Question Scott Beeson · Jan 21, 2016

I want to do some logic based on what environment code is running in. I can't find a built-in function to retrieve this so I'd like to write a custom function. Does anyone know of a command that would get the current environment?

9
0 766
Question Scott Beeson · Jan 21, 2016

Here is the function I'm writing:

/// Returns the participant code based on MSH-4
ClassMethod getParticipant(iSendingFacility As %String) As %String [ Final ]
{
   set = $PIECE(iSendingFacility,"^",1)
   set = $PIECE(iSendingFacility,"^",2)
   set sc1 = Lookup("ParticipantCodeMap",a)
   if sc1 = "" {
      set sc1 = Lookup("ParticipantCodeMap",b)
   }
   q sc1
}

For some reason when I try to run it I get the following error:

 set sc1 = Lookup("ParticipantCodeMap",a)
 ^
<UNDEFINED> 

I tried adding the the default parameter in case it's not finding it but it didn't help.  What am I missing?

5
0 308
Question Guillaume Lepretre · Oct 18, 2018

Hello everyone,

I want to fill data into my select component with sql request and parameter.

I tried to follow this example https://docs.intersystems.com/latest/csp/docbook/DocBook.UI.Page.cls?KE… 

I need to call a method because my parameter can be different. I tried something like this but it doesn't work... 

ClientMethod changeParams() [ Language = javascript ]{var query zenPage.getComponentById('categorieBeneficiaire');query.setProperty('parameter', 1, 'OS');query.setProperty('parameter', 2, 'NSAL');
}

or like this : 

2
1 329