Article Hiroshi Sato · Aug 28 1m read

InterSystems FAQ rubric

There is data, such as execution log data, that you do not want to return to its previous state even if a rollback occurs during a transaction. The above requirement can be met by placing that data in the IRISTEMP database, which will not be rolled back.

Temporary Globals and the IRISTEMP Database

By mapping the table entities you do not want to roll back to this database, you can retain the information after the rollback.

0
0 0
Article Hiroshi Sato · Mar 27 1m read

InterSystems FAQ rubric

You can use the WriteToConsoleLog method of the %SYS.System class to write any message to the console log.

The following is an example:

%SYS>write##class(%SYS.System).WriteToConsoleLog("xxxxx log message",0,0)
1

For details on the parameters that can be specified in the WriteToConsoleLog method, please refer to the following document:

Class Reference (%SYS.System) 【IRIS】

Class Reference (%SYS.System)

0
0 0
Article Hiroshi Sato · Nov 21, 2024 1m read

InterSystems FAQ rubric

Mirroring only synchronizes database files.

To synchronize other files required for your application (CSP files, images, documents, etc.) between the two servers that make up the mirror set follow one of the approaches:

  1. Place those files on a shared disk by introducing a NAS or similar device
  2. Or use file sync software to synchronize files between two servers.
0
0 0
Article Hiroshi Sato · Jun 27, 2024 1m read

InterSystems FAQ rubric

You can use the List query of the %SYS.Audit to output audit logs programmatically.

The sample code is as follows:

Set statement=##class(%SQL.Statement).%New()  
 Set status=statement.%PrepareClassQuery("%SYS.Audit","List")
 Set rs=statement.%Execute()  
 Set tab = $char(9)
 While rs.%Next() {    
   Write rs.%Get("TimeStamp")_tab_rs.%Get("Event")_tab_rs.%Get("Username"),!      
 }
0
0 0
Article Hiroshi Sato · Jun 6, 2024 1m read

InterSystems FAQ rubric

If you want to run an OS executable file, command, or a program created within an InterSystems product when the InterSystems product starts, write the processing in the SYSTEM^%ZSTART routine. (The %ZSTART routine is created in the %SYS namespace).

Before you write any code in SYSTEM^%ZSTART, make sure that it works properly under all conditions.

If the ^%ZSTART routine is written incorrectly, or if it is written correctly but the command does not return a response or an error occurs during processing, InterSystems products may not be able to start.

0
0 2
Article Hiroshi Sato · May 30, 2024 1m read

InterSystems FAQ rubric

To disable the timeout, set the query timeout to disabled in the DSN settings:

Windows Control Panel > Administrative Tools > Data Sources (ODBC) > System DSN configuration

If you check Disable query timeout, the timeout will be disabled.

If you want to change it on the application side, you can set it at the ODBC API level.

Set the SQL_ATTR_QUERY_TIMEOUT attribute when calling the ODBC SQLSetStmtAttr function before connecting to the data source.

0
0 262
Article Hiroshi Sato · Apr 25, 2024 1m read

InterSystems FAQ rubric

For naming conventions, please check the respective document pages below.

About table name (class name): Identifier rules and guidelines - classes

About column names (property names): Identifier rules and guidelines - class members

As stated here, only alphanumeric characters and characters with Unicode code points larger than ASCII 128 can be used in column names (property names).

0
0 232
Article Hiroshi Sato · Apr 11, 2024 2m read

InterSystems FAQ rubric

If the journal file is too large to be searched or filtered using the Management Portal, you can refer to it using the following two methods.

① How to use the ^JRNDUMP utility
② How to reference it in a program

================================================== ========== 

① Using the ^JRNDUMP utility. For example, if you want to select all records in the journal file that include the global reference ^ABC, do the following:

*Please execute all commands below in the %SYS namespace.

DO SELECT^JRNDUMP("C:\MyCache\mgr\journal\YYYYMMDD.001","","","^ABC",1)

0
0 376
Article Hiroshi Sato · Apr 4, 2024 1m read

InterSystems FAQ rubric

The Web/CSP Gateway management page is typically configured so that it cannot be accessed from client machines.

To access from any client, do the following:

  1. Launch a browser from a system with access to the Web/CSP Gateway management page and access the Management Portal.
  2. Under Management Portal > System Administration > Configuration > click CSP Gateway Management.
  3. Click Default Parameters that appear in the left pane of the page that appears.
  4. Enter *.*.*.* in the system management machine and press the Save Settings button.
0
0 262
Article Hiroshi Sato · Mar 21, 2024 2m read

InterSystems FAQ rubric

Properties defined in list collections (Property XXX As list of %String;) can be manipulated using SQL functions: $LISTBUILD(), $LISTFROMSTRING().

For each SQL function, please refer to the document page below.

InterSystems SQL Reference - $LISTBUILD() [IRIS]
IRIS SQL Reference - $LISTFROMSTRING() [IRIS]
Caché SQL Reference - $LISTBUILD()
Caché SQL Reference - $LISTFROMSTRING()

/// Class definition exampleClass ISJ.ListOfData Extends%Persistent
{
    Property listdata As list Of %String;
}

An example of SQL statement execution is as follows. 

0
0 259
Article Hiroshi Sato · Mar 14, 2024 1m read

InterSystems FAQ rubric

Record maps are used to efficiently map files containing delimited records or fixed-width records to message classes used by the interoperability function, and to map files from interoperability function message classes to text files.

Record map mapping definitions can be created using the Management Portal, and we also provide a CSV record wizard that allows you to define while reading a CSV file.

To use a record map in production, just add a record map business service or business operation and specify the record map definition class you created.

3
0 429
Article Hiroshi Sato · Mar 7, 2024 1m read

InterSystems FAQ rubric

You can use the %IndexBuilder class to perform index rebuilding using multiple processes.

Here is an example for the purpose of defining the standard index HomeStateIdx for the Home_State (state information of contact address) column of Sample.Person.

The steps are as follows:

1. Hide the index name to be added/rebuilt from the query optimizer.

>write$system.SQL.SetMapSelectability("Sample.Person","HomeStateIdx",0)
1

2. Add %IndexBuilder to the rightmost superclass of the class definition that defines the new index.

0
0 264
Article Hiroshi Sato · Feb 29, 2024 1m read

InterSystems FAQ rubric

Global mappings can be registered using the system class Config.MapGlobals.

The method to globally map ^Sample.PersonD in a database SAMPLES other than the default database from the namespace USER is as follows (example executed in a terminal).

USER>zn"%SYS"%SYS>set ns="USER"%SYS>set glo="Sample.PersonD"%SYS>set vals("Database")="SAMPLES"%SYS>set st=##class (Config.MapGlobals).Create(ns,glo,.vals)

The third argument of the Create() method of the Config.MapGlobals class is passed by reference, so specify it by appending a period (.) to the variable name.

0
0 284
Article Hiroshi Sato · Feb 15, 2024 2m read

InterSystems FAQ rubric

The $ZF(-100) command is used in the following format.

$ZF(-100, flags, command name, command arguments)

The "/shell" flag is required when running OS commands.
For example, use mkdir like this:

 // mkdir C:\temp\newdir
 Write$ZF(-100, "/shell", "mkdir", "C:\temp\newdir")


If a command has multiple arguments, enclose them in double quotes and separate them with commas, as in the example below.

0
0 299
Article Hiroshi Sato · Feb 8, 2024 1m read

InterSystems FAQ rubric

On Linux, use the following steps to delete an instance of InterSystems IRIS (hereinafter referred to as IRIS).

(1) Stop the IRIS instance you want to uninstall using iris stop 

# iris stop <instance name>

(2) Delete the instance information using the following command 

# iris delete <instance name>

(3) Delete the IRIS installation directory using the rm -r command 

# rm -r <install directory>

In addition to the installation directory, IRIS also uses (a) and (b) below.

0
0 529
Article Hiroshi Sato · Jan 18, 2024 1m read

InterSystems FAQ rubric

If you need to migrate your server for some reason, you can reduce the setup work by copying configuration information from the pre-migration environment to the post-migration environment.

The following setting information can be migrated.

  • iris.cpf
  • SQL gateway settings
  • web gateway settings *Note 1
  • user-created routines etc. stored in the IRISSYS database *Note 2
  • security settings
  • task settings
1
2 261
Article Hiroshi Sato · Jul 6, 2023 1m read

InterSystems FAQ rubric

The InterSystems ObjectScript language does not allow you to define methods of the same name with different arguments. It is generally classified as a programming language called a dynamic language.

In ObjectScript, you can freely control which arguments are used when executing a method, so unlike languages ​​such as Java, which are not dynamic programming languages, there is no need to strictly distinguish methods by the number of arguments at the compilation stage.

0
1 312
Article Hiroshi Sato · Jun 22, 2023 1m read

InterSystems FAQ rubric

Countermeasures against SQL injection have been published on various websites, but we believe that it is possible to prevent SQL injection in applications using InterSystems SQL as well as other RDBMS by implementing these countermeasures appropriately. In addition, InterSystems Data Platform (hereinafter referred to as IRIS) incorporates several measures that make SQL injection more difficult than general RDBMS.

0
0 571
Article Hiroshi Sato · May 25, 2023 2m read

This is an article on the InterSystems FAQ site.

 1. Export API

a. Use $system.OBJ.Export() to specify individual routines to export. For example:

do $system.OBJ.Export("TEST1.mac,TEST2.mac","c:\temp\routines.xml",,.errors)

The format to specify is routine name.extension, and the extension is mac, bas, int, inc, obj.

Errors during export are stored in errors.

See the class reference %SYSTEM.OBJ for details on $system.OBJ.Export().

b. Use $system.OBJ.Export() even when exporting with wildcards. For example:

do $system.OBJ.Export("*.mac",c:\temp\allmacroutines.xml")
2
2 697
Article Hiroshi Sato · May 18, 2023 2m read

InterSystems FAQ rubric

Using the Config.Configuration class and SYS.Database class methods, you can create and register a namespace database from the terminal.

Below is a series of execution examples that create database file /CacheDB/AAA/cache.dat and register database AAA and namespace AAA in the configuration file (cache.cpf).
* Execute in the %SYS namespace. *

* Make sure that this script runs as the user  that is used for all IRIS processes to ensure that the directory has appropriate ownership and permissions *

3
0 428
Article Hiroshi Sato · Apr 27, 2023 2m read

InterSystems FAQ rubric

Migrating data to another system takes two steps.

1. Migrating class definitions

To migrate the class definition to another system, export it to a file in XML format or UDL format (extension .cls).

The export procedure in Studio is as follows.

Tools > Export

> Select multiple classes you want to migrate with the [Add] button

> Check [Export to local file]

> Confirm that the file type is XML, enter a file name, and click [OK].

After this, import the exported XML and UDL files in the studio on another system. The import procedure in Studio is as follows.

Tools > Import from Local

4
0 352
Article Hiroshi Sato · Mar 23, 2023 1m read

InterSystems FAQ rubric

You can programmatically retrieve routine dates and sizes using the RoutineList query of the %Library.Routine (or just %Routine) class.

The RoutineList query has an argument, and the routine name to be searched can be specified by prefix match or middle match. (For wildcards, specify * or ?)

In the example below, *.MAC is specified as an argument.

SET tStatement =  ##class(%SQL.Statement).%New()
 DO tStatement.%PrepareClassQuery("%Routine" , "RoutineList") 
 SET rs = tStatement.%Execute("*.MAC",,0) 
 DO rs.%Display() 
2
0 605