#Caché

1 Follower · 4.5K Posts

  

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

Documentation.

Question Lyle McDaniel · Aug 30, 2018

Hello,

    When working with class queries you have to define the ROWSPEC at the beginning (See below).

Instead of using Year1 or Year2 as the column name, how can I use the passed in fiscal year (xFiscalYear)

so Instead of using "Year1" as the column name I can call it something like:  "Jul"_xFiscalYear

Query GLReportYearToYearTrend(xFiscalYear As %String) As %Query(CONTAINID = 0, ROWSPEC = "GLCode:%String,Description:%String,Year1:%String,Year2:%String,JulChange:%String") [ SqlProc ]
{
}

10
0 641
Question Dmitry Maslennikov · Aug 31, 2018

I faced with the issue when WebSocket connection just fails without any errors if I send data with size 384 bytes and more (In binary mode the same). As I know by standard WebSockets frame does not have such limitation. Is there any way how to decrease it? This limitation too small, it is too difficult to fit this size and needs to send data much more often than I expected. Tested with Caché 2016.2, 2017.2 and IRIS 2018.1.

2
0 820
Question Sylvie Greverend · Sep 6, 2018

I am trying to initialize a list of %string property to an empty list, and after add eleements.
d ##class(Test.Test).Test("hello") ; works perfectly
d ##class(Test.Test).Test("") ; does not work, the list stays empty

How can I do that. Thank you so much

1
0 628
Question sween · Sep 6, 2018

Hello,

Looking for some help on how I actually set the properties to enable tracing for %Net.SSH.Session ?

The doc is here:

https://docs.intersystems.com/latest/csp/documatic/%25CSP.Documatic.cls…

The values look bitwise in their defaultness and I cant seem to figure out how to enable it in my object (or if I am going about this wrong altogether).  I am troubleshooting an elusive ssh error: unable to exchange encryption keys in a catch at the moment.

Would appreciate a clue if anybody has experience with it... thank you.

-Ron

3
0 504
Article Gevorg Arutiunian · Sep 6, 2018 1m read

This code snippet allows for a file on the web to be saved into the file system. Specify the server and GET request, as well as the directory the file should be saved to. The class method "test" runs the code:


Class objectscript.saveFileHTTP Extends %RegisteredObject
{
	classmethod test() {
		Set httprequest = ##class(%Net.HttpRequest).%New()
		Set httprequest.Server = "docs.intersystems.com"
		Do httprequest.Get("documentation/cache/20172/pdfs/GJSON.pdf")
    Do $System.OBJ.Dump(httprequest.HttpResponse)
	 
	Set stream=##class(%FileBinaryStream).%New()
	Set stream.Filename="c:\test.pdf"

	Write stream.CopyFrom(httprequest.HttpResponse.Data)
	Write stream.%Save()
}

}

Here's a link to the code on GitHub

0
1 1046
Question Emanuel Lazar · Sep 5, 2018

SQL gateway.

There is a basic problem with sql gateway,

while building the proxy methods, with:

##class(%Net.Remote.Gateway).%ExpressImport(class, port, host, 0, classObj)
it causes error messages as something in the class is not correct,

while this class passed OK all Visual Studio of C#

and same class working OK under the %Activate Assembly link

I think there is also problem  with overload methods (same methods names).

Regards,

Emanuel

4
0 371
Article Gevorg Arutiunian · Sep 4, 2018 11m read

I already talked about GraphQL and the ways of using it in this article. Now I am going to tell you about the tasks I was facing and the results that I managed to achieve in the process of implementing GraphQL for InterSystems platforms.

What this article is about

  • Generation of an AST for a GraphQL request and its validation
  • Generation of documentation
  • Generation of a response in the JSON format
2
2 1217
Question Suman Samanta · Aug 24, 2018

Hello Everyone,

We are planning to build angular UI and Cache REST as backend. Can we deploy angular in Cache Private web server.

What would be the best way to do it. Did any one configure apache  with  csp gateway . if so can anyone guide me to a good document or some  steps here which might help. 

I  have looked into this - https://docs.intersystems.com/latest/csp/docbook/DocBook.UI.Page.cls?KE…

Somehow i am not able to join the dots .

6
0 679
Question Emanuel Lazar · Aug 28, 2018

Activate Wizard by-pass

Cache-2016-1.2

1. how to bypass the Activate wizard ?, and run directly the Activate on: .NET x64 COM Assembly (.dll,.tlb)

with object script , something like :

D Activate^%CacheActivate("MyAssembly.tlb")

the MyAssembly.tlb , is ofcourse , a visible Element  in activate Wizard table list

2. activate Wizard table list, sometimes throws an error #6101 ?

regards,

Emanuel

4
0 334
Question Anne Kantola · Aug 31, 2018

Hi,

we have Angular solution and Cache server. We need to have separate users and sessions on same browser (laptop, table etc) for every user and for one user with many connections.

Thought this was resolved, but unfortunately not.

-----------------------------------------------------------------------------------------------------------------------

I got the code away from here, because it was some how ok.

The session on server mixed, but no any more, thanks our folk and local engineer's tools :)

1
0 588
Article Rustam Ibragimov · Sep 4, 2018 4m read

Have you ever thought why the code that you write in Caché Object Script is exported to an XML file?


The news is that it’s time to change. Starting from the release of Atelier, a new development environment, and Caché 2016.2, you will be able to export and import files in the format that you use in the studio, into the so-called UDL (Universal Definition Language) format. You can now write code that is not only fast but also looks beautiful in the exported form. However, we get another equally serious issue: if all new projects are in the UDL format, what will happen to backward compatibility?

1
0 1304
Question Eduard Lebedyuk · Aug 28, 2018

Let's say I have a list structure:

set list = $lb("stri,ng", $c(0), 2)

I want to replace all $c(0) elements with empty elements, so my list would look like:

set list = $lb("stri,ng", , 2)

What's the fastest way to do that?

13
0 679
Question Eduard Lebedyuk · Aug 29, 2018

I have a list

set list=$lb(1,$c(0),2)

How do I replace $c(0) with an empty element?

My list should look like this:

set list=$lb(1,,2)

I tried using $list but it either replaces the element with an empty string:

set $list(list,2)=""
zw list

Resulting in:

list=$lb(1,"",2)

Or removes the element altogether:

set $list(list,2,2)=""
zw list

Resulting in:

list=$lb(1,2)
2
0 435
Discussion Francis Galiegue · Apr 4, 2016

Hello community!

At the global summit in Phoenix, we (Lite Solutions) will be presenting a tool performing static code analysis on ObjectScript source files. You can see it in action at this URL:

https://demo.cachequality.com

Technically, the tool is a language plugin over SonarQube (http://sonarqube.org) and consists of three main parts:

  • parsing the language,
  • collecting metrics,
  • collecting issues.

The third point is where we kindly request for feedback.

6
1 2119
Question MARK PONGONIS · Aug 27, 2018

Is there a way to lock at the record level? I know that you can lock at the table level:

&sql(UNLOCK mytest IN EXCLUSIVE MODE)

but am unable to find a way to lock just at the record/row level. 

Would this also affect a SELECT statement done on the record?

1
0 438
Question Eduard Lebedyuk · Aug 27, 2018

I want to call java method and return $lb structure from it.

JDBC jar seems to contain relevant class -  com.intersys.jdbc.CacheListBuilder, but so far I only managed to return a string that looks like a list.

Here's my java code:

package isc.poi;

import com.intersys.jdbc.CacheListBuilder;
import java.sql.SQLException;

public class Test {

    public static String Test() throws SQLException
    {
        CacheListBuilder list = new CacheListBuilder("UTF8");
        list.set(123);
        list.set(456);
        list.set("\"abc\"");

        return list.toString();
    }
}
3
0 393
Question Mack Altman · May 26, 2016

Does anyone have any experience with getting, unfortunately, an older version of Cache to authenticate via SMTP to send email? I have verified that the settings are set up properly on the mailbox as I have successfully sent an email from a LAMP server, which comes from the same IP address.

If you have any thoughts, I would greatly appreciate it.

This is the error I receive

ERROR #6034: SMTP server connection failed during MAIL FROM command: <READ>zSend+105^%Net.SMTP.1.

when I run the following.

6
0 2700
Question Token Ibragimov · Aug 14, 2018

Hello,

while sending JSON request :

Set Object = ##class(%ZEN.proxyObject).%New()
Set Object.iin="123132132"
Set Object.firstName=name
Set Object.lastName=surname
Set Object.middleName=middlename
Set Object.birthDate=birthDate
Set Object.contractType="Z001"

set sc = ##class(%ZEN.Auxiliary.jsonProvider).%ObjectToJSON(Object)

Set sc = ##class(%ZEN.Auxiliary.jsonProvider).%WriteJSONStreamFromObject(httpRequest.EntityBody, Object)

Set sc = httpRequest.Post("", 2)

receive error bellow:

"Corrupt body: json: cannot unmarshal number into Go struct field CheckContractRequest.iin of type string". 

18
0 1646
Question Jack Huser · Aug 22, 2018

Hello Everyone,

I was wondering about the best way to initialize several variables, or several lists of variables.

Would it be better to write it like:

set (var1, var2, var3) = "value1"
set (var4, var5) = "value2"
set (var6,var7,var8) = "value3"

or

set var1="value1", var2="value1", var3="value1", var4="value2", var5="value2", var6="value3", var7="value3", var8="value3"

or

set var1 = "value1"
set var2 = "value1"
set var3 = "value1"
set var4 = "value2"
set var5 = "value2"
set var6 = "value3"
set var7 = "value3"
set var8 = "value3"

When comparing the speed of each methods:

6
0 588
Question Seth Jaffe · Aug 15, 2018

We are running old VB code on a Windows 2012 R2 server.

In the last month the following error has been happening.

      Failure to create CacheObjectConnection.
      Failure in GetClassInfo for CacheObjectConnection

      Factory not connected to server
     Send to Cache' failed

Neither the the code or Cache instance has not changed.

Cache 2017.1.1.111.0

The code:

7
0 1053