Question
· Jul 17, 2018
Cache Dynamic SQL Pagination

Would like to know if there is an alternative or better way to paginate through a dataset using dynamic SQL than what I am using below. The problem is that as the potential pool of data gets larger, this code slows down to the point of not being useable. In analyzing each line of code below, it appears the slow down is related to the initial rset.%Next() iteration. Is there anything available which does not require a subquery/%VID such as a simple LIMIT/OFFSET?

My code is similar to :

s sql=##class(%SQL.Statement).%New()

1 25
3 2.7K
Question
· Sep 8, 2016
Cache for Raspberry Pi?

Some may think it's a strange / daft idea, but just today the Raspberry Pi folks have announced that they've now sold more than 10 million of them..and counting. That's a huge potential marketplace, and a great platform for getting people to hear about Cache and try it out. Given its focus on the education sector, another great way of getting heard about.

5 18
0 2.7K
Question
· Apr 11, 2017
Authentication with REST

We are building a bunch of rest based services using Ens 2016.2 to serve our browser based application (Angular 4).

Two questions:

1. The initial authentication seems only work if credentials are placed in the url parameters. Trying to use the Authorization header instead, the client code immediately complains about Access-Control-Allow-Origin. How can I resolve this?

2. After initial authentication, what is the proper way to send subsequent rest calls without having to include credential every time?

2 7
0 2.6K

Hi All -

I was wondering if the below query could be enhanced to automatically look back 24 hours from the current datetime the query is run. As is now I, of course, have to update the date range in the WHERE clause manually.

The query is just getting all MessageBodyClassNames, counting them and then doing an AVG on TimeCreated and TimeProcessed. Nothing too complex.

SELECT MessageBodyClassName, count(ID) as Count_Of_Messages, avg(datediff(ss, TimeCreated, TimeProcessed)) as avg_processing_time_in_seconds

FROM %PARALLEL Ens.MessageHeader

0 1
1 2.6K
Question
· Aug 16, 2017
PROTECT error

I try to run below two statements

Set tRS = ##class(%ResultSet).%New("%Dictionary.ClassDefinition:SubclassOf")
​set tSC = tRS.Execute("%Persistent")

and I always get <PROTECT>check+5^%Dictionary.ClassDefinitionQuery.1

The login user is _SYSTEM and should have all the permissions.

I cannot run queries in the $SYSTEM.SQL.Shell(). I would get <PROTECT>%GenerateMetadata+16^%SQL.StatementMetadata.1

However, when I run the query through SMP, everything is fine.

Any idea where could I start to investigate ?

Thanks.

1 5
0 2.5K
404 Not Found

{
"error": {
 "errors": [
  {
   "domain": "global",
   "reason": "notFound",
   "message": "Not Found"
  }
 ],
 "code": 404,
 "message": "Not Found"
 }
}

I want to do something like the above sample from a Google Storage JSON API. I have a call to Write obj.%ToJSON() followed by return ..ReportHttpStatusCode(..#HTTP404NOTFOUND) however the HTTP Status code is always 200. If I remove the Write obj.%ToJSON() statement it returns a 404 status with no body. How do I return both?

0 1
0 2.5K
Question
· Oct 30, 2016
ISCAgent debug

Good day!
Is there an opportunity to debug the ISCAgent behaviour (in Linux)? ISCAgent uses /etc/iscagent/iscagent.conf as configuration file, but in docs I've found a description only for two parameters (port number and interface - http://docs.intersystems.com/latest/csp/docbook/DocBook.UI.Page.cls?KEY=...). Other parameters I can see by running /usr/local/etc/cachesys/ISCAgentCtrl status:

1 8
0 2.4K

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.

0 6
0 2.4K

Hi,

I'm doing a query in SQL and I need to sort my data by some non-repeated field.

Unfortunately, my data is grouped in a way that I cannot guarantee that any column will not have repeated data, so one solution would be to take the row number.

Also, the Cache is not accepting Row_Number () in my querry and I would like to know if there is another solution to return line numbers or some way to add this function to the Cache.

Best regards.

12 7
0 2.4K

Hi all, This is a bit embarrassing, and not that critical. I have a local instance of Caché 2016 on my computer, for playing around with. I was attempting to set up two-factor authentication on this instance, and I thought I simply disabled all users except for my own user and enabled two-factor for this user. The next time I tried to login to the Management portal, I received a Server Availability Error:

http://localhost:57772/csp/sys/UtilHome.csp

0 9
0 2.4K