Vitaliy Serdtsev · Apr 5, 2022 go to post

Most of the above is true for WinMerge, with one exception - WinMerge is free. WinMerge has plugins for comparing images, PDF, Word, Visio, Excel, PowerPoint, etc.

Vitaliy Serdtsev · Mar 17, 2022 go to post

You can use Caché SQL Gateway (Link Table via JDBC or ODBC)
This, your data migration query will be of the form:

insert into mssql.table(field1,..,fieldNselect field1,..,fieldN from cache.table

Or use third-party utilities to migrate data from/to any DBMS via JDBC/ODBC, for example SQL Data Lens (aka Caché Monitor): Local query cloud (there is a video)

Also there the Bulk Export

@Andreas Schneider - the author of this tools

Vitaliy Serdtsev · Mar 7, 2022 go to post

size = 31

ClassMethod Validate(As %StringAs %Boolean
{
 q $MATCH(s,"[1-3].*[A-CRS]")
}
Vitaliy Serdtsev · Mar 7, 2022 go to post

size = 30

ClassMethod Validate(As %StringAs %Boolean
{
 "ABCRS"[$e(s,*)*123[$e(s)
}
Vitaliy Serdtsev · Mar 4, 2022 go to post

It is worth mentioning that the "DATEDIFF" function does not always calculation as expected, eg:

>w $system.SQL.DATEDIFF("yy",$zdh("31.12.2022"), $zdh("01.01.2023"))
1
>w $system.SQL.DATEDIFF("mm",$zdh("31.12.2022"), $zdh("01.01.2023"))
1

This is stated in the documentation for SQL DATEDIFF

Vitaliy Serdtsev · Mar 4, 2022 go to post

You might find it interesting to download the Community Edition <..> and see if the bugs you reported are still present there or not. What do you think about that approach?

<..> we still create an SU version of Caché <..> because some of our large partners/APs rely on it for people to learn on <..>

I have already written that, as well as your large partners/APs who prefer to stay on Caché, IRIS does not interest me in this case. Why would I check something that I won't be using in the foreseeable future, even if there are fixes there?

And yes, for the sake of hobby, I have been using IRIS CE for a long time.

Vitaliy Serdtsev · Mar 4, 2022 go to post

Hi Jeffrey.

By far the vast majority of users that want Caché are existing customers - so you can get this easily through the WRC.
I have indicated why I already can't get Caché now, even the SU version:
<..>, until the technical support ended. <..> in future versions of Caché, which I can no longer check.

Vitaliy Serdtsev · Mar 3, 2022 go to post

you could download the Community Edition of InterSystems IRIS and just install Studio from that if you wish
That's exactly what I'm doing now. But agree, downloading hundreds of megabytes for the sake of Studio and drivers is inefficient.

Also, is there a reason you want the SingleUser version of Caché rather than the InterSystems IRIS Community Edition
IRIS does not interest me in this case. Over the years I have "tormented" WRC about the bugs I found in Caché (in some way I acted as a free beta tester), until the technical support ended. Some fixes at that time were included only in future versions of Caché , which I can no longer check. I would be interested to check out these fixes on the free version.

Maybe there are other reasons why there is still a single-user version of Caché, especially only for those who already have a full-featured version, but for me they are not obvious.

Vitaliy Serdtsev · Mar 3, 2022 go to post

Do I understand correctly that Caché Evaluation and IRIS Studio (full kit) are only available through WRC, which is not available to everyone, but only for supported customers? It seemed to me that these products are designed for everyone. By the way, the same goes for ODBC, JDBC and CSPGateway.

Vitaliy Serdtsev · Feb 9, 2022 go to post

I decided to check the size of the code using an officially allowed method.

ClassMethod length(
  class = {$classname()},
  method "Solve"As %Integer CodeMode = expression ]
{
##class(%Dictionary.MethodDefinition).IDKEYOpen(classmethod).Implementation.Size
}
So,

size = 46 (43)

ClassMethod Solve(As %StringAs %Integer
{
 f  s c=$p(o,",",$i(i)) q:'$lf($lfs(o),-c) c
}
size = 48 (45)
ClassMethod Solve(As %StringAs %Integer
{
 f  s c=$p(o,",",$i(i)) ret:'$lf($lfs(o),-cc
}

Vitaliy Serdtsev · Feb 9, 2022 go to post

In my opinion, the best thing is the built-in documentation, where there are Articles, Guides and Tutorials (see "Document Type" at left)

E.g.: Caché Tutorial Topics Map

Many examples for different technologies/languages can be found in folder install-dir\dev

In a standard Windows installation of Caché, install-dir is C:\InterSystems\Cache.

Vitaliy Serdtsev · Feb 9, 2022 go to post

Are you trying to localize a product created by InterSystems? If so, it is better to contact the WRC.

Vitaliy Serdtsev · Feb 3, 2022 go to post

So, the author is not lucky and in its version this feature is not available. It seems you have the wrong addressee, I have 2021.2 :)

Vitaliy Serdtsev · Feb 3, 2022 go to post

I won't be able to check for version 2020.1 since I have 2021.2.

Try to make a DROP COLUMN and then ADD COLUMN (of course according to the documentation for your version)

Vitaliy Serdtsev · Feb 3, 2022 go to post

After calling

alter table fixxer.decars alter column color rename color2

it became

Property color As %Library.String(MAXLEN 500) [ SqlColumnNumber = 5, SqlFieldName COLOR2 ];

It looks like something was fixed in 2021.2.

Vitaliy Serdtsev · Feb 3, 2022 go to post

Good trick!

size = 47

ClassMethod Solve2(As %StringAs %Integer
{
c=$p(o,",",$i(i)) g:$lf($lfs(o),-cc
}

Vitaliy Serdtsev · Feb 3, 2022 go to post

I have 190 on 1 line.

UPD: Program can be reduced to 189, but at the same time efficiency will decrease. Therefore, I will stop on the value 190. Let us know when the contest ends and it will be possible to open the sources.

Vitaliy Serdtsev · Feb 3, 2022 go to post

It is a pity that the author left the previous task (Code Golf - Encoder) without attention, and the community ignored her (or did not notice;)

Vitaliy Serdtsev · Feb 3, 2022 go to post

size = 49

ClassMethod Solve(As %StringAs %Integer
{
 i=1:1 c=$p(o,",",iret:'$lf($lfs(o),-cc
}

Vitaliy Serdtsev · Feb 3, 2022 go to post

Given (IRIS 2021.2):

Class fixxer.decars Extends %Persistent DdlAllowedSqlRowIdName UniqueIdentifier ]
{

Index iUnq On (brand, MaxSpeed, color) [ IdKeyPrimaryKeyUnique ];
Property brand [ SqlColumnNumber = 2 ];
Property MaxSpeed;
Property color;

}
USER>d $system.SQL.Shell()
SQL Command Line Shell
----------------------------------------------------
 
The command prefix is currently set to: <>.
Enter , 'q' to quit, '?' for help.
[SQL]USER>>select * from fixxer.decars
1.      select * from fixxer.decars
 
UniqueIdentifier        brand   MaxSpeed        color
 
0 Rows(s) Affected
statement prepare time(s)/globals/cmds/disk: 0.0020s/5/140/0ms
          execute time(s)/globals/cmds/disk: 0.0004s/1/719/0ms
                          cached query class: %sqlcq.TEST.cls4
---------------------------------------------------------------------------
[SQL]USER>>alter table fixxer.decars alter column color rename color2
2.      alter table fixxer.decars alter column color rename color2
 
0 Rows Affected
statement prepare time(s)/globals/cmds/disk: 0.0153s/2 113/13 157/0ms
          execute time(s)/globals/cmds/disk: 0.1492s/52 206/467 790/0ms
                          cached query class: %sqlcq.TEST.cls5
---------------------------------------------------------------------------
[SQL]USER>>select * from fixxer.decars
3.      select * from fixxer.decars
 
UniqueIdentifier        brand   MaxSpeed        COLOR2
 
0 Rows(s) Affected
statement prepare time(s)/globals/cmds/disk: 0.0741s/38 529/179 560/0ms
          execute time(s)/globals/cmds/disk: 0.0003s/1/719/0ms
                          cached query class: %sqlcq.TEST.cls4
---------------------------------------------------------------------------
[SQL]USER>>

Now:

Class fixxer.decars Extends %Persistent DdlAllowedSqlRowIdName UniqueIdentifier ]
{

Index iUnq On (brand, MaxSpeed, color) [ IdKeyPrimaryKeyUnique ];
Property brand [ SqlColumnNumber = 2 ];
Property MaxSpeed;
Property color [ SqlFieldName COLOR2 ];

}

PS: by the way Studio highlights the error in the following code

&sql(alter table fixxer.decars alter column color rename color2)

But the compilation goes without errors.

Vitaliy Serdtsev · Feb 1, 2022 go to post

See

$$TableName^%occLGUtil(pClass) (taken from sources %DeepSee.Report.Model.Report)
##class(%DeepSee.Utils).%GetSQLTableName(pClass)
##class(%ZEN.DataModelUtils).GetSQLTableName(pClass)
##class(%DeepSee.Generator).%GetSQLTableName(pClass) (my choice)

It is worth remembering that the table name can be a reserved word, so you need to put it in quotation marks.

For example, the method %DeepSee.Generator:%GetSQLTableName does not always work correctly for Caché:

Class count.sum.select Extends %Persistent SqlTableName "current_date.max" ]
{

ClassMethod TableName(which 0) [ CodeMode = objectgenerator ]
{
  set sch=%compiledclass.SqlSchemaNametab=%compiledclass.SqlTableName
  do %code.WriteLine($c(9)_"quit $p("""_sch_"."_tab_","_sch_","_tab_""","","",which+1)")
  quit $$$OK
}

/// d ##class(count.sum.select).Test()
ClassMethod Test()
{
  i=0:1:2 ..TableName(i),!

  pClass=$classname()
  !,##class(%DeepSee.Generator).%GetSQLTableName(pClass),!

  w $$TableName^%occLGUtil(pClass),!
  ##class(%DeepSee.Utils).%GetSQLTableName(pClass),!
  ##class(%ZEN.DataModelUtils).GetSQLTableName(pClass),!
}

}

USER>##class(count.sum.select).Test()
count_sum.current_date.max
count_sum
current_date.max
 
count_sum."current_date" ERROR!
count_sum.current_date.max
count_sum.current_date.max
count_sum.current_date.max

In IRIS 2021.2, an error occurs yet at the compilation stage of the class.