#Caché

0 Followers · 4.5K Posts

  

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

Documentation.

Question Alexey Maslov · Jun 10

Having been inspired with Shared code execution speed question/discussion, I dare to ask another one which is annoying me and my colleagues for several weeks.

We have a routine called Lib that comprises 200 $$-functions of 1500 code lines total. It was noticed that after calling _any_ function of another rather big routine (1900 functions, 32000 lines) the next call of $$someFunction^Lib(x) is getting 10-20% slower than previous call of the same function. This effect doesn't depend on: 

0
0 0
Discussion Harshitha · May 30

Hey everyone,

I'm diving deeper into Caché ObjectScript and would love to open a discussion around the most useful tips, tricks, and best practices you’ve learned or discovered while working with it.

Whether you're an experienced developer or just getting started, ObjectScript has its own set of quirks and powerful features—some well-documented, others hidden gems. I’m looking to compile a helpful set of ideas from the community.

Some areas I’m especially interested in:

0
0 0
Article Harry Tong · Jun 6 2m read

If you're migrating from Oracle to InterSystems IRIS—like many of my customers—you may run into Oracle-specific SQL patterns that need translation.

Take this example:

SELECT (TO_DATE('2023-05-12','YYYY-MM-DD') - LEVEL + 1) AS gap_date
FROM dual
CONNECT BY LEVEL <= (TO_DATE('2023-05-12','YYYY-MM-DD') - TO_DATE('2023-05-02','YYYY-MM-DD') + 1);

In Oracle:

0
0 0
Question Anna Golitsyna · Jun 6

Let's suppose two different routines use one and the same chunk of code. From the object-oriented POV, a good decision is to have this chunk of code in a separate class and have both routines call it. However, whenever you call code outside of the routine as opposed to calling code in the same routine, some execution speed is lost. For reports churning through millions of transactions this lost speed might be noticeable. Any advice how to optimize specifically speed?P.S. Whenever someone is talking about the best choice for whatever, I am always tempted to ask: "What are we optimizing?".

0
0 0
Question Andrew McCrevan · Jun 5

How would you go about creating an SQL Stored Procedure that would result in the same output as "IN LIKE"?
For example...
CustomersTable

RecordId CustomerName
123 Mark Stevens
456 Betty Johnson
789 John Stevens
321 Brian Smith
654 John Markson
987 Tom Obrian
select *
from CustomersTable
where inLike('%Mark%', '%John%')

Would return:

123 Mark Stevens
456 Betty Johnson
789 John Stevens
654 John Markson
0
0 0
Question Satya Prasad Kalam · May 30

We're planning to use Production Validator for validating our system upgrade (2016.2.3 to 2024.2) , and we are trying to understand what kind of benchmarking or performance metrics others have observed during similar efforts.

Specifically, we are looking for a case study or real-world example that includes details like:

  • How many messages were validated?
  • How long did it take to create the temporary database from the source system?
  • How long did it take to run the comparison on the destination system?
0
0 0
Question Anil Mathew · May 18

I have a rest API Class used for getting data from Cache 2018 version.
I have single route '/callfuntions'
I send the following parameters to the API :-  className, methodName, params
I use $CLASSMETHODto execute and send the result back to the client.

If I make more that 10 to 12 requests in quick succession, then it stops sending data.

if I wait for over 10 seconds it allows me to send more requests to the API.  How do I resolve this?

0
0 0
Discussion Aleksandar Kovacevic · Apr 26, 2020
So far, I found there are some interesting ways to search in global structure:

through Query %Library.Global.Find
through Query %Library.Global.Get

%Library.Global.Find

ObjectScript

set statement=##class(%SQL.Statement).%New()
set status=statement.%PrepareClassQuery("%Library.Global","Find")
set resultset=statement.%Execute("USER","^Persons","Email") // <Namespace>,<Global>,<Keyword>
while resultset.%Next() {
write !, resultset.%Get("Name"),", "
write resultset.%Get("Value"),", "
write resultset.%Get("Name Format"),", "
write resultset.%Get("Value

5
1 1226
Question Flávio Lúcio Naves Júnior · Nov 7, 2023

Hello everyone,

I am attempting to implement continuous integration using Docker with Caché 2018.1, and I am in the process of creating an image for our client. I have already installed Caché 2018.1 on the RedHat server, but I am working on a script to create the database and namespace. For the database, I used the following code:

do ##class(SYS.Database).CreateDatabase("/usr/cachepoc/cache2018/mgr/poc/")

However, I have encountered some issues with this code. For instance, I am unable to view this local database in the portal's list:

3
0 443
Question Paul Coviello · Nov 6, 2023

We have a machine that serves 4 instances of Cache on VMS systems, one of them is password protected and works fine as they all do. we decided we wanted something beefier and copied it to a server, well all but the one you have to login to works so 3 of the 4 do.  and the odd part is I can no longer get to the management page from anywhere on any machine, http://localhost/csp/bin/Systems/Module.cxw  I get a 404.8 error, I have tried adjusting security and same thing. and a server availability error.

4
0 335
Article Padmaja Konduru · May 6 3m read

It helps to remove special characters, such as non-utf-8 characters either control characters or unicode characters from text that is not printable or can't be parsed by downstream systems.

There is also $C(32) in this condition; sometimes NBSP appears in the text and it will not be recognized by TIE, but downstream it displays as "?".

In order to avoid the NBSP issue, the if condition is replaced with a space in order to prevent the error.

Unicode characters only Remove:

0
0 0
Question MARK PONGONIS · Jul 17, 2018

Would like to know if there is an alternative or better way to paginate through a dataset using dynamic SQL than what I am using below. The problem is that as the potential pool of data gets larger, this code slows down to the point of not being useable. In analyzing each line of code below, it appears the slow down is related to the initial rset.%Next() iteration. Is there anything available which does not require a subquery/%VID such as a simple LIMIT/OFFSET?

My code is similar to :

s sql=##class(%SQL.Statement).%New()

31
3 3604
Question Ganesh Jagtap · May 1

Hi all,

I'm reviewing an older Cache routine and came across this line of code: from file ^ZDBKCRON

S $ZT="^%ETSDK"

Error trap

/home/oper/script/cache_db_backup -t        # Daily CacheDB Backup

 produced the following output:

 <NOROUTINE> *%ETSDK
<ERRTRAP>

-----------

From what I understand, this is setting up an error trap, but I'm not entirely clear on how it works, especially in modern InterSystems IRIS environments.

Could someone please help explain:

0
0 0
Question Kim Jiyong · May 2

Hello, we are currently using the Cache Database released in January 2018.

There are no specific classes or SQL mappings in the namespaces where data is stored.

Only a few routines(.mac) and stored data are in the global area.

In this case, when accessing the Cache DB through Java, is it essential to write SQL mappings or wrapper classes? The reason I ask is that our team doesn't have advanced developers who specialize in Cache.

Alternatively, is it possible to directly call pre-existing routines from Java?

I apologize for the translation;

0
0 0
Article John Murray · Jun 12, 2017 1m read

I recently helped a site investigate a problem that appeared after they upgraded their Windows instance of Caché from 2015.1 to 2017.1. A terminal session launched from the server's desktop cube was unable to run OS-level commands using the $ZF(-1) function. For instance, using the no-op command "REM" as follows:

write $zf(-1,"rem")

was returning -1, indicating that the Windows command could not be issued.

7
1 1803
Question Richard Prouvot · Apr 17

i have a line in my *.scr file like this:

send: s rlt=##class(%SYS.Namespace).ListAll(.rlt)<CR>
wait for:USER>
send: S A="" F  S A=$O(rlt(A)) q:A=""  I A["USER"!(A["CLIE")  F I=1:1:$L(L,",")  S G="^["""_A_"""]"_$P(L,",",I)  S B="" F  S B=$O(@G@(B)) Q:B=""  F J=1:1:$L(B)  S V=$A($E(B,J,J))  I (V<48!(V>57))&&(V<65!(V>90))&&(V<97!(V>122))  W A,?10,G,?30,B,!<CR>
wait for:USER>
 

it errors out with this <SYNTAX> error where the "<" or ">" are not accepted.

 I (V057))&&(VA90))&&(Va122))  W A,?10,G,?30,B,!

How do I escape these characters so that my script works??

Thanks

0
0 0
Question Nimisha Joseph · Apr 14

Hi everyone,

I'm working on a DTL that transforms an HL7 message (EnsLib.HL7.Message) to an XML document (EnsLib.EDI.XML.Document).

The target XML is based on a custom schema and has an element like:

<xs:element name="deceasedDateTime" type="xs:dateTime" nillable="true"/>

What I need is for the output to show:

<deceasedDateTime xsi:nil="true"/> when the source HL7 value is empty, for eg: 

<portalPatientUpdate xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
  <deceasedDateTime xsi:nil="true" />
</portalPatientUpdate>

My questions:

0
0 0
Question Steven Chesser · Apr 13

Using Cache 2017.2 sever as my target.

I have a x64 Ubuntu client setup going.  This is NOT server. Just client. 

I have the Linux Ubuntu x64 ODBC driver gzip file. 

ODBC-2018.1.5.659.0-lnxubuntux64.tar.gz is all I could find.  Someone posted it in another post.

I can connect to a test sever that does NOT use SSL.  That works pretty easily.

But I have A server with SSL enabled. With Windows Cache ODBC drivers I can use SSL just fine.

This is what my SSLDefs.ini file on the Windows machines look like and it works just fine.

0
0 0
Discussion Anna Golitsyna · Apr 10

I ask ChatGPT periodically to produce ObjectScript or plain MUMPS code for string manipulation, or for implementing known algorithms etc. Occasionally, it does make mistakes or uses non-existing class members but generally not that bad. Is there any tutorial on the subject of using AI for coding, ideally specifically for ObjectScript/MUMPS? Any AI productivity advice, or tricks you are using, or another AI flavor?

Thanks in advance,
Anna

0
0 0
Question Julian Matthews · Apr 11

Hey everyone.

I'm currently looking at a process where we're utilising the Class Ens.StreamContainer, and was looking to do some deletions outside of any purge routines.

Having been burned before, I wanted to make sure that deleting the container also deletes the contents within.

From looking in the class, the  %OnDelete ClassMethod appears to be removing an index from a search table and nothing more.

Am I looking in the right place, or is there a extended class for Ens.StreamContainer that does in fact delete the %Stream.Object
contained within the Ens.StreamContainer?

0
0 0
Question Jerry Petrole · Apr 9

Hello, 

One of our clients has a 'Notes' class with over 3 million records.   We have a report that pulls data from this table that was taking about an hour to run.   Our test environment (which has a copy of the production database) runs the same report query in 1 second.    

We attempted to purge and rebuild indices which made an improvement (down to 15 minutes) but still not great.

0
0 0