#Caché

30 Followers · 4.5K Posts

  

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

Documentation.

Question Jared Severson · Jan 10, 2023

Hello!

I'm new to the system I'm working on, and I have a part of a statement that needs to grab the previous month.

....and MONTH(TX3.date_of_service)= MONTH(dateadd(mm,-1,GETDATE()))

However, when it hits January, I'm left with month 0.

Does anyone know a workaround to grab December of the previous year, while still functioning normally for the rest of the current year.

Thank you! 

4
0 236
Question Anna Golitsyna · Dec 14, 2022

I am familiar with $TEXT which can get you any line in the current routine provided you know the offset. For example, $T(+1) will get you the first line of the current routine at the run time. In the same vein, how do I reference the current line number/offset at the run time? Something like $T(+$CURRENTLINENUMBER) where $CURRENTLINENUMBER is not yet known to me function. The sample below would write 3 as the line number.

RTNNAME
 S A=1
W $CURRENTLINENUMBER

13
1 718
Question Larry Cardinal · Jan 1, 2023

Hi,

I have a test version of Cache installed on my laptop, but I cannot get logged into the database.  I think my ID may be locked due to too many password failure attempts.  I have not changed the Admin password or SuperUser password.  Does anyone know what the default password would be for the Admin and/or SuperUser Id's?  Or if someone knows how I can get in and unlock/reset my password, it would be much appreciated??

Thanks,

Larry Cardinal

Happy New Year to all

6
0 410
Question Dominic Chui · Jan 3, 2023

I have a registered object class that extends %XML.Adaptor and I want to convert an object of it into canonical XML. 

From reading the documentation and some trial and error, it seems like I would need to use %XML.Writer to write the object to XML first using the RootObject() method, then read it with %XML.Reader, and then use the Canonicalize() method of %XML.Writer to write it out again.

Is there a better approach?

2
1 614
Question Norman W. Freeman · Aug 19, 2021

I have a CSP page that throw a "414 error - Request-URI Too Long" when I put lot of text (eg : 10000 characters) into a field of a submitted form. The form is submitted using POST method.

Based on some experiments I made, it seems the max size of a URL is around 8200 characters.

What is the official limit, and is there a way to increase it ? I searched in the documentation but couldn't find anything.

5
0 4385
Question Scott Roth · Dec 16, 2022

Was wondering if anyone had a simple way of calling  ##class(Ens.Director).EnableConfigItem() within a Business Process or adding code to a Custom Service to start or stop the object?

The use case is that I have a Process that uploads a file into a external SQL table. When it is finished I want it to kick off another Service that does the processing of the data that it just uploaded. Once it is finished the response is sent back to the service and when the service receives the response from the process, I want to stop that service from running.

so...

8
0 440
Question Ming Zhou · Feb 11, 2022

Similar to: "set obj = ##class(myClass).%OpenId(id)", which give the an instance of the object with given ID, is there a way to implement a function/classmethod to return the same by providing both class name and ID as a parameter, such as: getObjectInstanceByNameId(className As %String, id As %Integer), using ObjectScript code?

7
0 1159
Question William Glover · Nov 30, 2022

When recieivng a response and calling SendDeferredResponse I get the warning below and no response is sent.

No Return Queue - Unable to send deferred Response to Request 12537165

When the initial request comes in I am calling DeferResponse but the message never goes into a state of Deferred.

How do I resolve this warning and get the response working?

2
0 386
Article Eduard Lebedyuk · Feb 19, 2016 12m read

Suppose you have developed your own app with InterSystems technologies stack and now want to perform multiple deployments on the customers' side. During the development process you've composed a detailed installation guide for your application, because you need to not only import classes, but also fine-tune the environment according to your needs.
To address this specific task, InterSystems has created a special tool called %Installer. Read on to find out how to use it.

9
4 4665
Question Guilherme Mendes · Dec 13, 2022

Hi!

I'm running a unit test via terminal, and sometimes someone from another team/squad add a few BREAKs and my tests stop until I skip one by one.

Is there a way to ignore BREAKs?

7
0 474
Question Jochen Roese · Dec 13, 2022

Hi,

in our system we usually display an information if someone locks data that another user tries to edit. Like: "Data locked by <user>/<program>"

We have a global that is set at userlogin with following information:

^BA020(0,3,$job) = "<user>;<program>"

We show that information by getting the jobnr/owner from the locktable ^$LOCK("<ref>","OWNER") and looking at ^BA020.

1
1 233
Question Tiago Pereira · Dec 2, 2022

Hi, 

I have two versions of Cache running on two separated servers. In one server, the version is 2018.1, and have the web application 'api/atelier', and the other server the version is 2016.1.

The question is, can I export the web application 'api/atelier' from 2018.1 and import/install it on 2016.1 version?

Thanks!

6
0 545
Article Tani Frankel · Dec 8, 2022 1m read

When creating a PRA (Privileged Routine Application; which by the way is not relevant just for Routines but also for Classes/Methods), it is important to make sure you include a new $ROLES, before calling AddRoles(). For example:

new$ROLESset status=$System.Security.AddRoles("MyPrivilegedRoutineApplication")

This way you ensure that indeed the added (elevated) roles "evaporate" for the User running this code, once the User is out of the scope of that routine/method.

[Thank you @Andreas Dieckow for validating this]

3
0 337
Question 聆严 周 · Oct 11, 2022

According to the IRIS documentation, once a user id is identified, at lease one license will remain (forever if I understand it correcly). The documentation says "even if the number of processes under the user ID drops back under the maximum, InterSystems IRIS continues to allocate one license unit per process for that user ID. Only when all connections by the user ID are closed and there are no more processes under the user ID does license allocation reset to one unit for that user ID."

4
0 505
Question Steve Strunk · Nov 1, 2022

I have a module that sends EMAIL from a Cache INT routine (listed below).

In order to make sure the columns align in the body of the message that the recipient receives I want to force the setting of the FONT and SIZE in the body.

Does anyone know what I need to insert in this code in order to control font and size?

Alternatively is there a way to send mail from within Cache that will keep column data aligned?

Thanks.

________________________________________________________

s server=##class(%Net.SMTP).%New()

s server.smtpserver=server_name

s server.post=nn

s msg=##class(%Net.MailMessage)).%New()

2
0 390
Question Sheetal Kairawala · Nov 4, 2022

Hello Developers.

I have a question regarding X12 834 file for Payers.

We have a client thats sending X12 834 file with single ST SE block and has thousands of members in one single block and X12 process is throwing STORE error when processing this file.

Has anyone ran into this issue and has a way of splitting 834 file into single <ST> <SE> block?

Thank you in advance

Sheetal

2
0 326
Question Luiz Henrique Carvalho Martarelli · Dec 5, 2022

Hi!

I'm trying to install a ZPM package in my 2018 cache to use swagger-ui in my api-rest, but when I execute command line:
Do $System.OBJ.Load("/mypath/zpm.xml","ck")

I receive this error message:

ERRO #6301: Erro no Parser XML SAX: Linha: 2 Deslocamento: 39 Este arquivo não parece ter sido exportado pelo Caché, não é possível importá-lo.
ELEMENTO DE ORIGEM: %ZEN.Component.html (htmlContent)

I'm trying to install the version: zpm-0.5.1

Can anyone help me?

3
0 274
Question Oleksandr Demchenko · Nov 18, 2022

Hi, how do I create a trigger that will only set the value of the "Status" field for new objects, not for all available?

Class CarDealer.Order Extends (%Persistent, %Populate)
{

 Property Title As %String

 Property Status As %String(VALUELIST = ",InProgress,Done,Canceled");

Trigger setStatus [ Event = INSERT, Foreach = row/object, Time = AFTER ]
{
 &sql(update CarDealer.Order set Status = 'InProgress')
}

2
0 574
Question Yone Moreno · Dec 1, 2022

Hello, first of all thanks for your time and help.

We do send from a REST POST request using SoapUI software, an "Authorization Bearer".

POST http://[IP]:[Port]/aplicaciones/scs/informescctest/Servicios.SOAP.InformesCConcertadosv01r00.cls HTTP/1.1
Accept-Encoding: gzip,deflate
Content-Type: application/xml
Authorization: Bearer eyJ0e[...]
SOAPAction: http://SCS.Servicios/InformesCConcertadosv01r00/ResultadosER7
Content-Length: 1871
Host: AAA
Connection: Keep-Alive
User-Agent: Apache-HttpClient/4.1.1 (java 1.5)

Our mission is to get it inside a SOAP Service.

The Service's ADAPTER is:

1
0 391
Question Andy Stobirski · Nov 30, 2022

Hi

I have two tables: one a local table using cache and the other is via an SQL gateway connection to an MSSQL Server via a 64bit ODBC driver (ODBC Driver 17 for SQL Server).

When I try to join them on a date field I don't get any matches, and I know that there are matches, e.g. running both views separately returns resuls for 30/11/2022.

The following statement returns rows for the first table r, but nothing for the table l

5
0 485