go to post Vitaliy Serdtsev · Feb 9, 2022 Are you using Active Directory? See: The clocks on the client and server machines are skewed.
go to post Vitaliy Serdtsev · Feb 3, 2022 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 :)
go to post Vitaliy Serdtsev · Feb 3, 2022 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)
go to post Vitaliy Serdtsev · Feb 3, 2022 I also noticed that in IRIS 2020.1 documentation is nothing about 'ALTER COLUMN RENAME' syntax. Yes, check alter-column-action ::= 2020.1 2021.1
go to post Vitaliy Serdtsev · Feb 3, 2022 After calling alter table fixxer.decars alter column color rename color2it became Property color As %Library.String(MAXLEN = 500) [ SqlColumnNumber = 5, SqlFieldName = COLOR2 ];It looks like something was fixed in 2021.2.
go to post Vitaliy Serdtsev · Feb 3, 2022 Good trick! size = 47 ClassMethod Solve2(o As %String) As %Integer { a s c=$p(o,",",$i(i)) g:$lf($lfs(o),-c) a q c }
go to post Vitaliy Serdtsev · Feb 3, 2022 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.
go to post Vitaliy Serdtsev · Feb 3, 2022 Hope you are talking about Visual Studio Code, not Visual Studio.
go to post Vitaliy Serdtsev · Feb 3, 2022 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;)
go to post Vitaliy Serdtsev · Feb 3, 2022 size = 49 ClassMethod Solve(o As %String) As %Integer { f i=1:1 s c=$p(o,",",i) ret:'$lf($lfs(o),-c) c }
go to post Vitaliy Serdtsev · Feb 3, 2022 Given (IRIS 2021.2): Class fixxer.decars Extends %Persistent [ DdlAllowed, SqlRowIdName = UniqueIdentifier ] { Index iUnq On (brand, MaxSpeed, color) [ IdKey, PrimaryKey, Unique ]; 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 [ DdlAllowed, SqlRowIdName = UniqueIdentifier ] { Index iUnq On (brand, MaxSpeed, color) [ IdKey, PrimaryKey, Unique ]; 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.
go to post Vitaliy Serdtsev · Feb 3, 2022 Perhaps the method will be useful to you: $SYSTEM.Util.CleanDeadJobs()
go to post Vitaliy Serdtsev · Feb 1, 2022 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.SqlSchemaName, tab=%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() { f i=0:1:2 w ..TableName(i),! s pClass=$classname() w !,##class(%DeepSee.Generator).%GetSQLTableName(pClass),! w $$TableName^%occLGUtil(pClass),! w ##class(%DeepSee.Utils).%GetSQLTableName(pClass),! w ##class(%ZEN.DataModelUtils).GetSQLTableName(pClass),! } } USER>d ##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.maxIn IRIS 2021.2, an error occurs yet at the compilation stage of the class.
go to post Vitaliy Serdtsev · Jan 27, 2022 In Caché 2018.1, which the author indicated, there is no such function. In addition, instead of HH need to specify HH24, otherwise instead of 20220126155704 will get 20220126035704.
go to post Vitaliy Serdtsev · Jan 27, 2022 I would like to avoid string manipulation Delimiters in the format are required, so you will have to manipulate the strings anyway. $tr($system.SQL.TOCHAR($h,"YYYYMMDD HH24 MI SS")," ","") or $tr($system.SQL.TOCHAR($h,"YYYY^MM^DD^HH24^MI^SS"),"^","")
go to post Vitaliy Serdtsev · Dec 8, 2021 Ok, the index can be omitted. The table data is stored in different globals: *D - for data, *I - for indexes, *S - for streams. You can get the size of the data parts you want. Example [Size()]: select * from %SYS.GlobalQuery_Size('C:\InterSystems\Cache\mgr\samples','','*D,*S',0,0,1) order by "Allocated MB" desc
go to post Vitaliy Serdtsev · Dec 8, 2021 Will the size of the global (with data,index,stream) suit you? If yes, then see this.
go to post Vitaliy Serdtsev · Dec 8, 2021 See the sources of method %SYSTEM.SQL:Export() for a description of the parameters. Only instead of 0, use 1, for example: SAMPLES>w $$Export^%qarDDLExport("Sample","*","C:\Temp\Sample.sql","WNS",1,0,0,0,0)