#Caché

30 Followers · 4.5K Posts

  

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

Documentation.

Question Danillo Aquino · Oct 15, 2018

I would like to know how to choose the "Development" installation type in silent mode.

When performing a normal installation:

Please review the installation options:
------------------------------------------------------------------
Instance name: CACHE
Destination directory: /cache
Cache version to install: 2015.2.1.705.0.17420
Installation type: Development

When I perform a silent install:

3
0 593
Question Bill Asby · May 20, 2016

Hi,

I ran the Cache ODBC Driver installer as Administrator on my Windows 7 PC this morning. It completed successfully with o indication of any issues. When I check installed programs and features via Win 7 Control Panel, I see it listed as Intersystems ODBC Driver 1.00.000.

However, when I try to configure the driver via Control Panel - Administrative Tools - Data Sources (ODBC), I cannot find it. The only driver listed under the Drivers Tab is SQL Server.

I am not sure how to proceed.

I appreciate any suggestions.

Thanks,

Bill

5
0 1712
Question Anne Kantola · Oct 15, 2018

In our language we have scandic letters like ä (a with two dots on it).

In Angular we use login like this:

let headers = new Headers();

password = Base64.fromBase64(password);

headers.append('Authorization', 'Basic ' + Base64.encode(username + ':' + password));

let options = new RequestOptions({ headers: headers, withCredentials: true });

return this._http.get(_param.baseUrl + this._loginUrl, options)

.map((res: Response) => {

It works, but not with these letters.

In other cases we convert data on server side like

set:tValue'="" tValue=$ZCONVERT(tValue,"I","UTF8")
 

3
0 422
Question Sabarinathan M · Mar 13, 2018

Hi All,

I need some help with sending PDF files to printer using cache instead of using third party tools(Adobe, foxit reader, etc..).
Sometime i getting access issue with the exe files.

Can able to send text data to printer using below code.

Set Dev="|PRN|PrinterName"
OPEN Dev:(/DATATYPE="TEXT"):80
USE Dev Write "Test printing",!
CLOSE Dev


Any suggestions on sending PDF to printer?

3
0 1004
Question Vivek Ranjan · Sep 28, 2018

Method1(){

Set OID1=##class(Table).%OpenId(100)

// do Kill OID

}

&SQL(Update Table Set  Column=88)

Method2(){

Set OID2=##class(Table).%OpenId(100)

// Or do %Reload()

Set OID.Column=99

Do OID.%Save()

}

// Column 1 still holds value as 1

For getting the updated value I should do Kill OID in Method1

4
0 704
Article Alexey Maslov · Nov 23, 2017 12m read

It's well-known that namespace global mapping helps us to write code independent on database storage details (Caché instance name, directory path). But sometimes we can face problems accessing an unsubscripted global which has subscript level mapping (SLM) defined. Most of such cases are evident and associated with administrative tasks that should be done on database level, but some of them can confuse even an experienced developer. Just to start:

  • We can't export such a global using Caché Block format (a.k.a. GOF).
  • We can't kill such a global.

Maybe you can continue this list.

8
0 1494
Question Udo Guengerich · Sep 26, 2018

Upgrade of custom application

Dear community,

we are a company located in central Germany working with Intersystems Caché since 2003 (Jesus, that's actually a long time in IT).

As we struggle to keep pace with outside development we still operate on Caché 2013.1 surprise

We are, of course, aware that we need to upgrade Caché and therefor plan an upgrade to 2017.2.

Now my question to you bold ObjectScript warriors:

4
0 488
Question Ravi Nagpal · Oct 10, 2018

Hi, 

Can we create a new class in the studio using any command rather then using the Menu Item Option from Menu Bar in Studio . 

Requirement : Create/Draft a new class and able to extends the other classes using  a command in Cache Class .

In other words , I want to Dig in the Menu Item class from which Menu bar is created in studio and option are provided  Like New..., Open..., etc 

Thanks, 

Ravi 

1
0 305
Question Laura Cavanaugh · Oct 3, 2018

I'm running this code in our application, and in the terminal:

>set query="SELECT * FROM PMG_Data_Private.RemitInstance  WHERE  (VoucherNumber %INLIST ? SIZE ((10)))"

>set tRS = ##class(%ResultSet).%New("%DynamicQuery:SQL")

>set ok=tRS.Prepare(query)

>d $system.Status.DisplayError(ok)
 
ERROR #5540: SQLCODE: -76 Message: Cardinality mismatch between the SELECT-list and INTO-list
SQLTEXT: SELECT * FROM PMG_Data_Private.RemitInstance  WHERE  (VoucherNumber %INLIST ? SIZE ((10)))

5
0 1796
Question sansa stark · Oct 9, 2018

Hi all,By using LDAP cache method ##Class(%SYS.LDAP).GetValuesLen(LD,CurrentEntry,Attribute) we get the list of attributes but in "ObjectSid" attribute have the SID in binary format(objectSid^U¤:c@ãºþÕLCP]). how to convert to the readable format from the binary format in cache side. Please help us to proceed further

3
0 472
Article Gevorg Arutiunian · Oct 8, 2018 2m read

This code snippet provides a ZEN page that downloads a stream from its database directly:


/// We assume that you have stored your data within this schema:
/// MyApp.Model.Storage: Filename,FileSize,Content,ContentType
Class zen.downloadStream Extends (%ZEN.Component.page,%CSP.StreamServer)
{
/// Wrapper to get the id of the download, we assume that the id is passed to this zen page
/// as a URI parameter, i.e.: MyApp.Downloads.cls?OID=1234
ClassMethod GetId()
{
    Quit $Get(%request.Data("OID",1))
}
 
/// Set the appropriate header for the file.
ClassMethod OnPreHTTP() As %Boolean
{
    Set tId = ..GetId()
 
    If ##Class(MyApp.Model.Storage).%ExistsId(tId) {
        Set tStream = ##Class(MyApp.Model.Storage).%OpenId(tId)
        // You could "guess" the content type by its file extension
        // or you can store it (before) in the database separately (like in this example).
        // Set Extension = $Piece(tStream.Filename,".",$Length(tStream.Filename,"."))
        // Set ContentType = ..FileClassify(Extension)
 
        Set %response.ContentType = tStream.ContentType
        Do %response.SetHeader("content-disposition","attachment; filename="_tStream.Filename)
        Do %response.SetHeader("Content-Length",tStream.FileSize)
    }
    Else {
        Set %response.Status="404 File Not Found"
        Quit 0
    }
    Quit $$$OK
}
 
ClassMethod OnPage() As %Status
{
    Set Download = ##Class(MyApp.Model.Storage).%OpenId(..GetId())
    Do Download.Content.OutputToDevice()
    Quit $$$OK
}

}

Link to code on GitHub

1
2 671
Question Tuan Minh Do · Oct 4, 2018

Hello,

I am a beginner with Object Script and I hope anyone can help me solving my questions.

1. Is there a way to time a loop in Object Script? 

2. My code leads to the following error, even though it executes the method.

Is there a way to ignore this specific error, so that I can repeat my code in a time loop over and over again without stopping? 

3
1 1067
Question Jagadeesha Krishnamurthy · Oct 3, 2018

Hi 

Anyone worked on "ccontrol  list " command execution through Cache Object Scripting.

I executed through  bat file passing this ../bin ccontrol  list  . Icould not get the results through COS  but executed in command prompt 

it pops up with notepad and list down Cache instances.

Need help here to address the same stuff through cache object scripting.

3
0 885
Question Justin Wilderom · Oct 5, 2018

Can anyone tell me where to find good resources to learn Caché besides InterSystems.  I am  looking foe material (ie books, white paper, exercises, ect).  There does not seem to be a lot of information on Caché.

Thank you for all of your help

Justin

2
0 355
Question John Murray · Oct 2, 2018

Using our cool new debugging extension for Visual Studio Code I'm trying to debug a CreateProjection method of a class, but when I compile it the work apparently gets done in one of the worker jobs, so my breakpoint never triggers.

Is there a compiler flag or qualifier to force the compilation to be done in-process rather than getting handed off to a worker job?

4
0 548
Question Stephen Wilson · Oct 4, 2018

You have a global ^CODE("TNO","BIO",291,"AKI") that may or may not exist. On the data side of the global ref it can have  a boolean value of 0 (false) or 1 (true) and this global is wrapped up in a Caché class accessible from myobject.AKI property. At the object level, how do you check whether the property is defined ie. is there a $DATA equivalent for Cache Object properties? Also, how would you kill /null the property as opposed to making the value  0 (false) or an empty string?

10
0 3899
Question Confused Developer · May 4, 2017

Hi All,

I need urgent help,

I want to export the values from Global to CSV file.

Values are in global are :

^Global1(1)="1,2,3,4"
^Global1(2)="5,6,7,8"
.
.
.
^Global1(n)="n,n,n,n"

I want output in CSV File as:
1,2,3,4
5,6,7,8
.
.
.
n,n,n,n

I made a class:

ClassMethod ExportNewSchemaGlobals(pFile)
{
    Set ary("^Global1")=""
    Set pFile = "C:/Test.csv"
      
    Set ary = ##class(%Library.Global).Export(,.ary,pFile)
}

5
0 2233
Question Tuan Minh Do · Oct 3, 2018

Hello,

I have a question about creating properties with curl.

I already did create properties in Java with the following command.

<DO db.%CreateProperty("TotalSteps","%Integer","$.TotalSteps")>

It created the property TotalSteps with the type %Integer and the data path $.TotalSteps (since the header of my data source is also TotalSteps).

Now I would like to create the same property in curl with the following command

2
0 549
Question Rosti Zacharias · Oct 4, 2018

Hi,

It has been pointed out to me that one of my applications fails to display all of the contents when displayed on an iPhone or a tablet of smaller res that a desktop screen.

Desktop..

iPhone..

The code does not change between the two views of the same page. 

To maintain easy alignment and control, I have used standard <tr> and <td> <table> codes, expecting same behaviour in any browser on any platform. My guess is using <div> controls for display will make a difference, but I'd be interested if anyone has any experience of this kind and if there is a simple fix.

1
0 388
Question Julie Marulappa · Sep 27, 2018

I have an http adapter that calls out to a web service and is looking for a "Completed" response. I want the adapter to wait a certain number of seconds before calling out again to get a response. I have tried setting the retry interval on the business operation but that does not do it. See my code below.

While pResponse.StringValue = "Processing" {
set tSC=..Adapter.PostURL(tURL,.tHTTPResponse,,tId)
do tHTTPResponse.Data.Rewind()
set pResponse.StringValue = tHTTPResponse.Data.Read(3000000,.tSC)
$$$TRACE("Second Response: "_pResponse.StringValue)
}

5
0 600