#Caché

30 Followers · 4.5K Posts

  

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

Documentation.

Question Amir Samary · May 7, 2019

Hi!

I was trying to create a query that can be exposed as a stored procedure (function actually) that would return a resultset with a random number of columns. 

Unfortunately, it seems that unless I specify the ROWSPEC annotation on the Query method, I won't get any columns exposed. I was hoping to implement QueryNameGetInfo method and specify the names and number of columns I would be returning dynamically. But it seems that GetInfo information is simply ignored.

Here is my code:

5
0 763
Question Jeremy Forsyth · May 10, 2019

Cache version: Cache for Windows (x86-64) 2017.2.1 (Build 801_3U)

Good Afternoon,
I have a co-worker who is trying to run the below query via ODBC. The issue is that the query appears to be running extremely slow (nearly 2 hours).

SELECT A.RecNo, T.SDSInstID, T.TranEffectDate, COUNT(T.InternalTXID) as NoofTransactions
FROM SDS_DATA._Transaction T
INNER JOIN SDS_DATA.DataFeed A
on A.BankAccountBSB = T.BankAccountBSB
and A.BankAccountNo = T.BankAccountNo
WHERE T.TranEffectDate >= DATEADD(yy,-1,CURRENT_DATE)
GROUP BY A.RecNo, T.SDSInstID, T.TranEffectDate

 Below is the generated query plan
 

3
0 1070
Question Jack Trachtman · May 8, 2019

Unix:  I'm trying to switch to using the $ZF(-100 function in place of $ZF(-1.   I have it working for a simple, single, cmd, but can't figure out how to pass a piped sequence.  Maybe this just isn't allowed?

For example:

S sc=$ZF(-1,"ps -Af | grep username")

works, but I can't figure out how to format this for the $ZF(-100 function.

???

Thanks

4
0 651
Question Kurt Hofman · May 7, 2019

Hello,

We're having troubles with working over Telnet on Caché Unicode with WRQ Reflection.

We can't input extended characters (é,à,Ø,...), DELETE-key doesn't work, ...

Has anyone a solution for working with WRQ Reflection or a decent alternative ?

We tried Putty and Caché-terminal but these are not sufficent.

Regards,

Kurt Hofman.

4
0 691
Question Daniel Kutac · Apr 30, 2019

Hello,

I have a very simple web service that I'd like to secure via SAML Authorization with X.509 Certificates. I am, however struggling with documentation and my lack of cryptographic skills. (I do this just for educational purposes now, but need to use it in the future)

Does anyone have an example that shows how to construct a SOAP Client with adding all necessary security headers manually or point me to a decent learning resource?

Thank you very much!

1
2 1421
Question William Proctor · May 2, 2019

Thanks for all replies in advance.  We have a security vulnerability that we have to get rid of.  We use Putty software to connect to cache as a terminal allowing several users to do maintenance work in cache.  this uses telnet Plain text.  I know that we can configure telnet to be encrypted using the super server service and I'm looking for software that can work like Putty as a terminal using encryption compatible with cache telnet encryption.   If I have cache installed on my PC and setup a connection to the server using Kerberos with encryption and use the terminal option to connect to the

5
0 952
Question Treephet Phannaphop · May 3, 2019

Hi There

I created function to manage string as requirement  extract the first two letter of each word after space for example:

Text = "Review symptoms to report with patient"

After passed function it will be return "Resytorewipa"

ChangeFormat(desc)

   set desc = "Review symptoms to report with patient"
   q:$g(desc)=""
   SET delim=" "
   SET countdown=$LENGTH(desc,delim)
   set =1
   for
    {
        q:i>countdown
         set abbrv = $e($PIECE(desc,delim,i),1,2)   // But if I put w abbrv  I can get "Resytorewipa"
         set = i+1     
    }
   w abbrv

6
0 601
Question Julie Marulappa · Apr 18, 2019

I am still new to cache objectscript and am trying to figure out how I would go about removing the escape characters from my JSON below. When I call the $toJSON method it's adding the "\" character in the file path.

{"FileStatus":"P","Path":"\/somepath\/test\/test123\/filename.txt","InterchangeOID":"100458"}

My Code:

set tJSONFile = {"FileStatus":pRequest.FileStatus,"Path":pRequest.Path,"InterchangeOID":pRequest.InterchangeOID}

set tJSONFile = tJSONFile.$toJSON()

Thanks.

11
0 10899
Question Ryan Hulslander · Apr 22, 2019

I have a process that takes data from a CSV file (actually a record mapper object) and creates a nicely formatted JSON string I would love to send this along to a RESTful business operation.  However no matter what I try, I continually get <INVALID OREF> errors when trying to populate the object that extends Ens.Request to give it the JSON string.

I can add strings, other objects, you name it - but stuffing a JSON formatted variable/object into another object I want to send someplace is proving to be an impossibility.

8
1 1030
Question lamont thomas · Apr 29, 2019

I need to read the sourceClass attribute of the transform node in the Xdata block of a dtl.

given:

Class EXC.DTL.Lamont Extends Ens.DataTransformDTL [ DependsOn = (Sam.msg.lamont, Sam.lamontNext) ]
{
Parameter IGNOREMISSINGSOURCE = 1;
Parameter REPORTERRORS = 1;
Parameter TREATEMPTYREPEATINGFIELDASNULL = 0;

XData DTL [ XMLNamespace = "http://www.intersystems.com/dtl]
{
<transform sourceClass='Sam.msg.lamont'  targetClass='Sam.RM.lamontNext' create='new' language='objectscript' >
<annotation>Sample transformationannotation>
<code>

I need to return the value 'Sam.msg.lamont'  for the DTL.

1
0 431
Question Arthur Pereira · Apr 29, 2019

Hello everyone, I'm new to COS development. I'm trying to generate a simple XML file based on a query and save into my server. I'm looking for stuff to get it done, if anyone has a tutorial or a step-by-step post on how to do it. My difficulty is just in generating the XML file.

1
0 883
Question David Kilburn · Apr 18, 2019

I have problem with Cache installed on a colleague's Windows 10 laptop.  On the laptop, Cache was automatically configured to use IIS and this has worked fine with csp applications configured in the Management Portal.

Now this seems to have stopped working, and I can't work out why.  In IIS, the web application seems to be in the correct place.

I have manually mapped the various file extensions to CSPms, as per the documentation, but any attempt to navigate to a csp page produces an 500 error, which tells me precisely nothing about why this is happening.

For example,

1
0 250
Question Siva A · Apr 22, 2019

Dear team,

I am trying to experiment the Docker container in our development environment. I have successfully build an image and running the container. When I access the CSP portal home page ( http://<host-ip>:57772/csp/sys/%25CSP.Portal.Home.zen?$NAMESPACE=%25SYS), I am getting the following error:

Caché Server Pages Version 2017.1.1.111.0.17521
 
Server Availability Error
Server is currently unavailable

I logged in to the running container (docker exec -it <container-id> sh), issued the command, 'ccontrol list' where the state says 'warn'.

8
0 663
Question Giray Ozel · Apr 19, 2019
Class ICT.Experiments.A Extends %Persistent
{
Property Name As %String;
Property Collection As list Of ICT.Experiments.B;
Property Collection2 As array Of ICT.Experiments.C;
}

Class ICT.Experiments.B Extends %Persistent
{
Property Name As %String;
}

Class ICT.Experiments.C Extends %Persistent
{
Property Name As %String;
}

I have the classes above and I can select columns from the array collection by using two joins as follows:

9
1 2101
Question Jimmy Christian · Apr 23, 2019

Hello all,

I am still learning CACHE and have below question.

In one of my ZEN method i am creating a table using

&sql(CREATE TABLE xxxxx(TNAMESPACE CHAR(100),TINTERFACE CHAR(100)))

Does any one knows how to concatenate a $USERNAME or any  content of a variable to the name of table ?

&sql(CREATE TABLE xxxxx_$USERNAME(TNAMESPACE CHAR(100),TINTERFACE CHAR(100))) is not WORKING.

Thanks,

Jimmy Christian.

2
0 308
Question Giray Ozel · Mar 25, 2019

I have two classes:

Class Example.Parent Extends %Persistent{Property Name As %String;Property Description As %String;

Property Children as list of Example.Child;

}
Class Example.Child Extends %Persistent{Property Name As %String;Property Description As %String;

}

 

A parent can have many children. I want to query for parents and add children for each parent to my result.

Here is the code that I query with:

7
0 1209
Article Sanjib Pandey · Apr 23, 2019 4m read

Method : to download the FTP file from intersystem cache : If you have any question please drop a message :

ClassMethod FTPDownload(myFTP = "", myUserName = "", myPassword = "", sFileLocation = "", dLocation = "", noOfdownloadFile = 1, sourceFileDel = 0)
{
 /*---------------------------------------------------------------------------------------------------------------------------
 download the file according to the requirements  : FTP

Method : Resuable 

by : Sanjib Raj Pandey on 30/03/2018

0
0 751
Question Roberto Cahanap · Apr 18, 2019

What is the process in importing a role from one server to another server?

Let's say Server A is our main server that we maintain all of our resources / roles / users. We would like to get these over to Server B, Server C, Server D, etc.

It looks like when we import, there are tables and resources left in the destination servers that are not in the source server. It looks like whatever was in the destination server that was not part of the source server was not deleted from the import.

What is the proper way of exporting/importing a role so that this does not happen?

2
0 198
Article Evgeny Shvarov · Apr 14, 2019 3m read

Hi guys!

Portrait of  Madame X, Gustave Caillebotte.

One of the features I like in InterSystems ObjectScript is how you can process array transformations in a specific method or a function.

Usually when we say "process an array" we assume a very straightforward algorithm which loops through an array and does something with its entries upon a certain rule.

The trick is how you transfer an array to work with into a function. 

One of the nice approaches on how to pass the information about an array is using $Name and Indirection operator. 

Below you can find a very simple example which illustrates the thing.

2
1 674
Article Stuart Byrne · Apr 3, 2019 5m read

Continuing on from my last post, I am posting my succesful output for the Day 2 Part 1 below.

A full explanation of Day 2 part 1 can be found at: https://adventofcode.com/2018/day/2 and the input can be found

at: https://adventofcode.com/2018/day/2/input

A brief description of this exercise is that you receive a sequence of strings.

You have to count the if any duplicate or triplicate chars exist in the string.  Multiples will exist, but if you find multiple ldupicates / triplicates you will count them once.

3
0 263