I'm aware of two ways to get list of files in a dir:

set dir = "C:\temp\"
set rs = ##class(%File).FileSetFunc(dir, , , 1)
do rs.%Display()

and:

set dir = "C:\temp\"
set file=$ZSEARCH(dir_"*")
while file'="" {
   write !,file
   set file=$ZSEARCH("")
}

Yet they bot return only files and directories in a current directory, but not files in subdirectories.

I suppose I call one of these recursively, but maybe there's a better solution?

1 25
1 3.6K
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

I am working with a client to try and export a set of tasks defined in the Task Manager from one system to another. I am not seeing any API for this. I can query this information in SQL. So I tried to use the Data Export Wizard from the System Management portal in the SQL window. Export was fine. Importing failed with a "can't insert into read only field" error. Looking at the class definition does not help since the implementation details are not visible.

So how would one accomplish this? Export scheduled tasks from one system to another?

0 25
0 1.4K

I am experimenting with Relationships, both Parent to Child and One to Many.

I have done some SQL look-ups and have searched through the documentation, however not in a lot detail, but wonder if there are more and better ways to access both sides of Relationships through SQL?

Thank you in advance for any help provided.

1 25
0 1.9K

Hi, this post was initially written for Caché. In June 2023, I finally updated it for IRIS. If you are revisiting the post since then, the only real change is substituting Caché for IRIS! I also updated the links for IRIS documentation and fixed a few typos and grammatical errors. Enjoy :)

19 24
5 10.3K
Article
· Dec 4, 2015 3m read
Atelier Beta Cloud Infrastructure

A few people wrote to me asking about the infrastructure behind the Atelier Server implementation. Its neat and a worthwhile story to share so I am writing it up here as a post on the community. I want to go in to a little detail on why it was needed and then I will outline in detail how we went about implementing this.

10 24
0 1K

I have multiple projects that I utilize when debugging in Cache Studio. One of my projects suddenly lost the ability to step through commands with the yellow box and the cursor moving though code lines. The cursor just sits at the entry line while variables apparently do change. Interestingly enough, if I change the project and the debug target, the "yellow box" ability is still there. Apparently losing this functionality is by project/debug target/whatever. The goal is, of course to return it back but how?

0 24
0 532

On the back of my recent post on writing bug-less code I wanted to raise a few suggestions (to ISC) that would help prevent certain types of bugs at compile time. I've probably missed a few, but these are the main ones in my mind. Please contribute more suggestions.

Btw, these also serve as potential gotchas for new COS developers.

4 24
0 1K

GraphQL is a standard for declaring data structures and methods of data access that serves as a middleware layer between the client and the server. If you’ve never heard about GraphQL, here is a couple of useful online resources: here, here and here.

In this article, I will tell you how you can use GraphQL in your projects based on InterSystems technologies.

17 24
10 2.4K
Question
· Jul 18, 2017
how to release memory for process?

hi

I query large mount of rows from one table with JDBC, and will prompt <store> error. I found that it was out of process memory (default 16M, max 49M in version 2010.2) .

so my question is : how to release memory for large mount of rows query? or how to resolve this error?

0 24
0 772

Hi,

I have a program that displays the current running processes to the screen. I need to have a program execute that display program and capture the results to a file. The display program does pause at the bottom of each page waiting for an 'enter' to go to the next page.

Note( the display program will not successfully compile on the current system but it does work)

Also - very, very new to Mumps.

Thanks,

Bob

0 23
0 438

Hi,

I exported selected globals from a Cache 2017 database into a single 4 Gb gof file. Now I tried to import from this file via Management Portal on a different machine . Only about half of the globals was imported and my attempts to select additional globals led to nothing, no new globals have been imported. Well, obviously I am mildly curious what's going on and how can I see the corresponding error which did not appear in the Import window but I can also shrug it off and consider what should I do next.

0 23
0 836
This is the second part of my long post about package managers in operating systems and language distributions. Now, hopefully, we have managed to convince you that convenient package manager and rich 3rd party code repository is one key factor in establishing of a vibrant and fast growing ecosystem. (Another possible reason for ecosystem success is the consistent language design, but it will be topic for another day.)
6 23
1 1.3K

In this article I would like to present the RESTForms project - generic REST API backend for modern web applications.

The idea behind the project is simple -after I wrote several REST APIs I realized that generally, REST API consists of two parts:

  • Work with persistent classes
  • Custom business logic

And, while you'll have to write your own custom business logic, RESTForms provides all things related to working with persistent classes right out of the box.
Use cases

  • You already have a data model in Caché and you want to expose some (or all) of the information in a form of REST API
  • You are developing a new Caché application and you want to provide a REST API
12 23
3 5K

So, one day you're working away at WidgetsDirect, the leading supplier of widget and widget accessories, when your boss asks you to develop the new customer facing portal to allow the client base to access the next generation of Widgets..... and he wants you to use Angular 1.x to read into the department's Caché server.

There's only one problem: You've never used Angular, and don't know how to make it talk to Caché.

This guide is going to walk through the process of setting up a full Angular stack which communicates with a Caché backend using JSON over REST.

16 23
3 4.7K
Discussion
· Jul 31, 2019
CodeGolf: FizzBuzz

Let's have a round of CodeGolf!

As usual the goal is to write the shortest solution for a specified problem.

Today we have one of the classics: FizzBuzz.

Write a program that prints the numbers from 1 to 100.

But for multiples of three print “Fizz” instead of the number and for the multiples of five print “Buzz”.

For numbers which are multiples of both three and five print “FizzBuzz”

4 22
1 611

Just like the title says, I'm attempting to find a way to create a web application that instead of serving CSP files, it uses a dispatch class.
I searched for clues in the documentation, but the CSPApplication tag seems to be exclusively for CSP file-based applications.

I'm trying to avoid implementing a workaround such as using the Invoke tag to call the Security.Applications to generate the web application but I might be forced to do so, even though it's unpleasant if I had to say...

So, is there an official way to execute this task?

1 22
0 577

Mirroring 101

Caché mirroring is a reliable, inexpensive, and easy to implement high availability and disaster recovery solution for Caché and Ensemble-based applications. Mirroring provides automatic failover under a broad range of planned and unplanned outage scenarios, with application recovery time typically limited to seconds. Logical data replication eliminates storage as a single point of failure and a source of data corruption. Upgrades can be executed with little or no downtime.

9 22
2 7K

Hi!

Want to share with you code snippet of try catch block I usually use in methods which should return %Status.


{ 
 try {
  	$$$TOE(sc,StatusMethod())
 }
 catch e {
 	set sc=e.AsStatus()
 	do e.Log()
 }

Quit sc 
}

Here $$$TOE is a short form of $$$TROWONERROR macro.

Inside macro StatusMethod is any method you call which will return %Status value. This value will be placed into sc variable.

5 21
2 3K

The topic of for/while loop performance in Caché ObjectScript came up in discussion recently, and I'd like to share some thoughts/best practices with the rest of the community. While this is a basic topic in itself, it's easy to overlook the performance implications of otherwise-reasonable approaches.

24 21
3 9K

Hi all,

I need some advice about JSON conversions and the outputs. I am being sent a JSON response from an API call and I am struggling to produce an output that I can use from it.

I have used the %FromJSON() method call to take the JSON stream source (pData) and convert it to a Dynamic object (object) but I am a little unsure as to how I can read the dynamic object and use it to extract the values from this and set the values as a property in another class.

The current coding I have for the conversion:

0 21
0 582