Article Megumi Kakechi · Oct 2 2m read

InterSystems FAQ rubric

The ^%GCMP utility can be used to compare the contents of two globals.

For example, to compare ^test and ^test in the USER and SAMPLES namespaces, it would look like this:
*In the example below, 700 identical globals are created in the two namespaces, and the contents of one of them is changed to make it the detection target.

0
0 0
Article Megumi Kakechi · Sep 25 2m read

InterSystems FAQ rubric

One way to optimize query performance is to use query parallelism on a per-query or system-wide basis (a standard feature).

This is a technique for dividing the execution of a particular query among processors on a multi-processor system. The query optimizer will execute parallel processing only if there is a possibility of benefiting from parallel processing. Parallel processing is only applicable to SELECT statements.

0
0 0
Article Megumi Kakechi · Nov 14, 2024 1m read

InterSystems FAQ rubric

By default, the order of columns in a table is determined automatically by the system. To change the order, explicitly set the order for each property using the property keyword SqlColumnNumber when defining the class.

Example:

Property Name As %String [SqlColumnNumber = 2];

Please see the documentation below.

SqlColumnNumber

If you want to change the SQL table name, specify SqlTableName. If you want to change the column name (field name), specify SqlFieldName.

Both apply only to persistent classes.

0
0 0
Article Megumi Kakechi · Nov 7, 2024 1m read

InterSystems FAQ rubric

It can be obtained with a List query of the %SYS.Namespace class.

1. Create a routine like this:

getnsp
   set statement=##class(%SQL.Statement).%New()
   set status=statement.%PrepareClassQuery("%SYS.Namespace","List")
   set resultset=statement.%Execute()
   while resultset.%Next() {
       write resultset.%Get("Nsp"),!
   }
   quit

2. Run it in your terminal

USER>do ^getnsp
%SYS
DOCBOOK
SAMPLES
USER

The method of executing class queries introduced in this article can be applied in a variety of cases.

0
0 0
Article Megumi Kakechi · Aug 15, 2024 3m read

InterSystems FAQ rubric

Temporary globals stored in the IRISTEMP/CACHETEMP databases are used when a process does not need to store data indefinitely, but requires the powerful performance of globals. The IRISTEMP/CACHETEMP databases are not journaled, so using temporary globals does not create journal files.

The system uses the IRISTEMP/CACHETEMP databases for temporary storage and are available to users for the same.

For more information about temporary globals and the IRISTEMP database, see the following document:
Temporary Globals and the IRISTEMP Database

The globals used as temporary are:

0
0 0
Article Megumi Kakechi · Jul 18, 2024 1m read

InterSystems FAQ rubric

This can be done with TRY-CATCH:

#dim ex As%Exception.AbstractExceptionTRY {
    //Code that causes an error
  }
  CATCH ex {
     do ex.Log()
  }

If you use ^%ETN, call it from the BACK entry (BACK^%ETN).

Please also take a look at the related article: How to get application errors (^ERRORS) using a command

0
0 0
Article Megumi Kakechi · May 23, 2024 2m read

InterSystems FAQ rubric

The TIMESTAMP type corresponds to the %Library.TimeStamp data type (=%TimeStamp) in InterSystems products, and the format is YYYY-MM-DD HH:MM:SS.nnnnnnnnn.

If you want to change the precision after the decimal point, set it using the following method.

1) Set system-wide

Management Portal: [System Administration] > [Configuration] > [SQL and Object Settings] > [General SQL Settings] 
Default time precision for GETDATE(), CURRENT_TIME, CURRENT_TIMESTAMP. You can specify the number of digits in the range 0 to 9.

0
0 278
Article Megumi Kakechi · Apr 18, 2024 1m read

InterSystems FAQ rubric

When you run a routine in the terminal and an error occurs in the program, if you have not set the error trap properly, the program will enter debug mode as shown below.

USER>do^error1
 write A
^
a+2^error1 *A
USER 2d0>

From this state, enter the Quit command to return to the state before the routine was started.

USER 2d0>Quit

If a transaction is being processed within the routine where the error occurred, a prompt similar to the one below will appear.

USER>do^error1
 write A
^
a+3^error1 *A
TL1:USER 2d0>q
TL1:USER>
0
0 199
Article Megumi Kakechi · Jan 11, 2024 2m read

InterSystems FAQ rubric

This error occurs when an instance of the class is already open at compile time.

There are two ways to deal with this issue:

  1. Terminate the process or application that has the instance open
  2. Compile options in the studio build menu: Check the compile flag “Compile classes in use” and compile.  

If you want to determine which process is using the class, try the sample routine below.

1
0 189
Article Megumi Kakechi · Jan 4, 2024 1m read

InterSystems FAQ rubric

If a relationship is set and there is a large number of n in a 1:n ratio, a large amount of memory may be consumed due to sequential processing of the relationship.

After referencing a many-sided object in a program and internally swizzling it, simply releasing the variable containing the OREF (deleting it, setting another value, etc.) will not free the many-sided object and the relationship object. This is the cause.

0
0 290
Article Megumi Kakechi · Dec 7, 2023 2m read

InterSystems FAQ rubric

To resolve the error <PROTECT>, remove the read-only attribute of the system-wide library database (IRISLIB for InterSystems IRIS, CACHELIB for Caché/Ensemble/HealthShare (Caché-based))

Once you have finished importing the routine, remember to change it back to read-only.
 

[Version 2013.1 and above]
[Management Portal] > [System Administration] > [Configuration] > [System Configuration] > [Local Database] Uncheck "Mount read-only" from the database name link.

3
0 464
Article Megumi Kakechi · Nov 23, 2023 1m read

InterSystems FAQ rubric

When executing OS commands, use $ZF(-100).

do$ZF(-100,"",program,args) // Execute the Windows command [synchronously].
do$ZF(-100,"/ASYNC",program,args) // Executes a Windows command [asynchronously].

When executing OS shell commands such as mkdir and copy, also specify /SHELL.

do$zf(-100,"/shell /async","mkdir","c:\temp\x")

Please refer to the following documents for details:

About $ZF(-100) [IRIS]
About $ZF(-100)

2
1 453
Article Megumi Kakechi · Sep 28, 2023 2m read

InterSystems FAQ rubric

In the sample below, an image file is encoded into a Base64 string in a class property, saved, decoded again with Base64, and restored to another file.

【Usage class】

Class User.test Extends %Persistent
{
Property pics As %GlobalBinaryStream;
}


【When importing】

2
1 611
Article Megumi Kakechi · Aug 10, 2023 2m read

InterSystems FAQ rubric

※Use this method if you want to compare databases that have been replicated using mirroring, shadowing, or some other mechanism.

You can use the DATACHECK utility to compare global variables. Please refer to the document below.
Overview of DataCheck [IRIS]

***

Routine comparisons use the system routine %RCMP or the Management Portal.

Below is how to use it in the Management Portal.

0
2 351
Article Megumi Kakechi · Aug 3, 2023 1m read

InterSystems FAQ rubric

You can set individual error pages for the following Web Gateway error messages/system responses:

  • server error
  • server busy
  • server unavailable
  • server timeout
  • connection closed

Settings are made on the Web Gateway Management screen ([Management Portal] > [System Administration] > [Configuration] > [Web Gateway Management] > [Configuration] > [Default Parameters]).

In the Error Page section of the Default Parameters menu, set the filename of the html page to display or the URL to redirect to when an error occurs.

  

0
1 334
Article Megumi Kakechi · Jun 15, 2023 1m read

InterSystems FAQ rubric

Query cache can be purged programmatically using the Purge* methods of the %SYSTEM.SQL class.

*For details of each method, please refer to the following documents.

%SYSTEM.SQL class【IRIS】

%SYSTEM.SQL class

① When deleting all query caches in the system

Do $SYSTEM.SQL.PurgeAllNamespaces()


② When deleting the query cache in the namespace

// delete all cached queries in namespace
Do $SYSTEM.SQL.Purge()
// when deleting the query cache specified by date
// the following deletes the cache not used in the last 30 days

Do $SYSTEM.SQL.Purge(30) 
0
0 348
Article Megumi Kakechi · May 4, 2023 2m read

InterSystems FAQ rubric

In Windows, set the processes with the following image names as monitoring targets.

[irisdb.exe]

contains important system processes.
* Please refer to the attachment for how to check important system processes that should be monitored.

[IRISservice.exe]

This is the process for handling IRIS instances via services.
When this process ends, it does not directly affect the IRIS instance itself, but stopping IRIS (stopping the service) is no longer possible.

[ctelnetd.exe]

0
1 348
Question Megumi Kakechi · Apr 18, 2022

How can I get the Python error object(exception return value) from the embedded python method?
I have an embedded Python method like as below;

ClassMethod test2() As XXX [ Language = python ]
{
   try:
    a=1/0
   
   except Exception as ex:
    print("Exception: %s" % str(ex))
    return ex
}

I'm not sure what kind of return type to set for this classmethod.   "As XXX" <--
I tried to set "ClassMethod test2() As %Exception.PythonException [ Language = python ]"
However, I got the following return value when I run the method in the IRIS terminal.

9
2 831
Question Megumi Kakechi · Jul 11, 2016

Hello,

One of our AP would like us to provide the file upload/download sample code by using ZEN Mojo.

I already provided them the attached "upload-sample".

I tried to create the "download-sample" in a similar way, but I couldn't do it yet.

Does anyone have a good idea/sample about this?

I'd like to download the server side file(e.g. c:\temp\nene.jpg) into client machine with a OpenFileDialog(image.png).

Thank you in advance.

6
0 936