Caché

In the first article I started discussing RESTForms - REST API for your persistent classes. We talked about basic features, now, I'd like to discuss advanced features - mainly queries capabilites:

  • Basic queries
  • Query arguments
  • Custom queries

Queries

Queries allow getting slices of data, based on arbitrary criteria. There are two query types in RESTForms:

  • Basic queries work for all RESTForms classes once defined and they differ only by the field list
  • Custom queries work only for the classes in which they are specified and available, but the developer has full access to query text
Last comment 5 September 2017
+ 3   0 5
711

views

+ 3

rating

In my previous posting about the new support in QEWD for JSON Web Token (JWT) support, I mentioned that it was a key step in enabling Micro-Service support in QEWD.  In this post I'll give some background to how they work and the thinking behind them.

If you haven't heard about Micro-Services and/or want to learn more, there's lots of information available if you do a Google Search.  Here's a good starting point:

https://smartbear.com/learn/api-design/what-are-microservices/

Last comment 5 September 2017
+ 3   0 3
371

views

+ 3

rating

Hi, folks!

What could be the best backup/restore strategy for a small (less than 100MB) but very valuable database which is placed on AWS/DO virtual host?

1. Use AWS/DO backup/restore features?

2. External backup (as the most recommended)?

3. InterSystems backup?

4. Globals export to a zipped file?

5. cache.dat copy?

Last answer 4 September 2017
0   0 1
0

comments

376

views

0

rating

Hi all,

In recent discussions, answers, comments IO redirection (with the famous code) was quite often seen
as the ultimate solution. It is definitely strong stuff and you can not only log your output but also do
key-grabbing in input.

But I think for simple logging it's quite a significant overhead.
If you just need to get some text or dump your variables or objects then SPOOL should be sufficient for your needs.

Last comment 3 September 2017
+ 11   0 3
496

views

+ 11

rating

I am beginner to ensemble and went through the introduction of ensemble in that they have mentioned three process of operations which is business service,business process, business operations is there  anyway to understand these process can anyone help me on this.

Thanks in advance. 

Last answer 2 September 2017 Last comment 2 September 2017
+ 1   0 0
166

views

+ 1

rating

SOLVED

tl;dr how can you tell if a number is really a string

The original question has been updated/improved.

Equality comparisons on floating point numbers will produce different results...

"1.1"=1.1  //is true!

"0.1"=0.1  //is not true :(

This second comparison can be fixed with...

+"0.1"=+0.1 // is true!

Last answer 31 August 2017 Last comment 1 September 2017
0   0 2
619

views

0

rating

I am trying to capture the write of a method to test the response in an unit test. I know everything works because one of my colleagues ran the code and did not froze on his machine.

I don't what is the cause of the freeze. I know that at line Use $io::("^"_$ZNAME) it stopes because i have put some write functions after every line in WriteCapture method and i only saw the first write function in terminal

I also used debug and in this case it didn't froze

Last answer 31 August 2017 Last comment 1 September 2017
0   0 2
253

views

0

rating

Greetings,

Is it possible to save Cache code into a file and then run it via command line?  

IE:  csession [ini] -U [ini] /path/cacheCodeFile.?

What I need to do is run a Cache script from the Linux command line.  The script will navigate data to produce a file and then it will exit back to the command line.

Thanks in advance for everyone's time.

Last answer 1 September 2017 Last comment 31 August 2017
0   0 2
1704

views

0

rating

I need to check if one class is a subclass of another (either direct or indirect).

For example:

Class Package.ClassA Extends %Library.Persistent
{
}

Class Package.ClassB Extends Package.ClassA 
{
}

Class Package.ClassC Extends Package.ClassB
{
}

In this example Package.ClassC is a subclass of 3 classes: %Library.Persistent, Package.ClassA, Package.ClassB.

So any of these checks should return 1:

Last answer 31 August 2017 Last comment 31 August 2017
0   0 1
246

views

0

rating

Hello, I've completed this tutorial: https://community.intersystems.com/post/deepsee-period-date-vs-same-peri...
I've used the "year" level instead of a pivot variable.
I want to calculate something like the following variation: 100 * ([DateOfSale].[PTD] - [DateOfSale].[LYPTD]) / [DateOfSale].[LYPTD]
I create a new calculated member, under the same dimmension with the above expression.

Last comment 31 August 2017
0   0 2
0

answers

197

views

0

rating

I need to get a list of all classes that are subclasses of two unrelated classes.

For example I want to get a list of all classes that are both:

  • Persistent (extends %Library.Persistent)
  • XML-Enabled (extends %XML.Adaptor)

To get subclasses of one class I can use this query:

set rs = ##class(%Dictionary.ClassDefinitionQuery).SubclassOfFunc("%Library.Persistent")

But what about two classes?

Last answer 31 August 2017 Last comment 31 August 2017
+ 1   0 2
266

views

+ 1

rating

Hi!

I am not system admin. But it used to be very simple to install CSP Gateway on an apache system on Linux with Apache installed. I used to run the CSP Gateway installation program and after it was done, all I had to do was fine tune some configurations on CSP Gateway portal on http://<ip>/csp/bin/Systems/Module.cxw and I was up and running.

Last answer 30 August 2017 Last comment 21 December 2016
0   0 4
644

views

0

rating

Good afternoon - 

I'm in the process of learning to make COS calls to REST-based web services and while I am having success, I'm struggling on how to parse out the results (I admit I'm very green at this):

Here's the code retrieving the JSON response:

Last answer 30 August 2017 Last comment 30 August 2017
0   0 1
670

views

0

rating

I'm working on an existing Zen Report that uses queryClass/queryName to retrieve data using a class that has a Stored Procedure method. Which works fine.
I have created second class with a Stored Procedure method, I modified the zen report to use this class and now I'm having the following error.

 

Error: SQLCODE: -99 Message: User UnknownUser is not privileged for the operation
ErrorNo: 5540

 

Regards,

Rui

Last answer 25 August 2017 Last comment 30 August 2017
+ 1   0 1
217

views

+ 1

rating

Hello everybody.

What I have is a criteria how to select "my" strings. What I need is to replace all of them with macro calls (using the same strings as arguments) in all classes of current namespace.

I was ready to write straightforward code, but at the last moment decided to ask the community: maybe I've overlooked a smarter option?

Any comments and advices would be great appreciated.

Last answer 28 August 2017 Last comment 29 August 2017
+ 1   0 3
287

views

+ 1

rating

Trying to use AES encryption for a url.  I have a plain text string, a 16-byte key and a initialization vector.  I am trying to match a C# implementation that uses RijndaelManaged class with a  BlockSize = 128, Mode = CipherMode.CBC, Padding = PaddingMode.PKCS7.  The output of the $SYSTEM.Encryption.AESCBCEncrypt(text,key,IV), doesn't match what is coming out of C#.  All inputs into the $SYSTEM.Encryption.AESCBCEncrypt(text,key,IV) are converted to UTF8 as in the documentation.

Last answer 28 August 2017 Last comment 14 August 2017
0   0 3
621

views

0

rating

Hi folks, I'm trying to pad my patient MRN to 10 characters before I do a SQL lookup in my BPL. I've tried various approaches, and have not been successful.

When I add a "code" statement with the following code, I get an error as below.

 

set context.NewID = "0000000000"
set $EXTRACT(context.NewID,10-len(context.PatientID)) = context.PatientID

 

Last answer 28 August 2017 Last comment 28 August 2017
0   0 2
461

views

0

rating

Is there a way to omit or skip rollback of some data changes during a transaction rollback? Maybe some sort of "autonomous transaction"?

The issue is with error logging in transaction. For example we may have in nested calls the following structure:
TS
<some code>
<error happens>
TRO 1
<error log to database>

but if this code is in another transaction, and that rolls back we lose error data.

Last answer 28 August 2017 Last comment 25 August 2017
0   0 1
365

views

0

rating

Hi, folks!

I'm sending emails with %Net.MailMessage.

How can I add a new line for the email body?

The code is:

dim msg as %Net.MailMessage = ##class(%Net.MailMessage).%New()
set msg.Charset="UTF-8"
do msg.TextData.Write("Dear  "_Username)
do msg.TextData.Write("Line1")
do msg.TextData.Write("Line2")
And I'm getting in email:
Dear UserLine1Line2

How can I get:

Dear User

Line1

Line2
Last answer 28 August 2017 Last comment 28 August 2017
0   0 3
447

views

0

rating

We are running Caché v2010.2 on OpenVMS and are receiving the message, 'Unable to start the database read test' in our CCONSOLE.LOG.

I was wondering if anyone could offer some insight on this as I was not able to find the error mentioned in the documentation.

Last answer 5 July 2017 Last comment 28 August 2017
0   0 1
138

views

0

rating

Recently there was an internal email thread on which SMTP server to use in demos. I thought I'd share the comments from that thread:

Last comment 26 August 2017
+ 1   0 3
361

views

+ 1

rating