go to post Vitaliy Serdtsev · Apr 11, 2022 You should always check the SQLCODE after the embedded query.If you do this, you will see that the SQLCODE returns the value 100 for your case. In this case, you should ignore host variables. Host Variables
go to post Vitaliy Serdtsev · Apr 8, 2022 How to highlight ObjectScript in a Post How to highlight Caché ObjectScript, work with htm, add image in the post and other questions Posting here your real code AS IS is a bad idea. Most likely there is a method(s) in your code where the last line of your tablepane is highlighted.
go to post Vitaliy Serdtsev · Apr 7, 2022 One of the options: s rs=##class(%ScrollableResultSetdoc).%New() d rs.Prepare(sql) d rs.Execute() w rs.Count()
go to post Vitaliy Serdtsev · Apr 7, 2022 Is it OK to use this partially rebuilt index if I don't care about data that isn't indexed? Did you do this before? I didn't build indexes manually, except for tests. If the index is not built for all data, then the query will see only the data for which the index exists. Try simple example: Class dc.test Extends %Persistent { Index iF On F; Property F As %Integer; ClassMethod Fill(N = 10) { k ^dc.testD,^dc.testI s ^dc.testD=4 s ^dc.testD(1)=$lb("",22) s ^dc.testD(2)=$lb("",11) s ^dc.testD(3)=$lb("",44) s ^dc.testD(4)=$lb("",33) d $system.SQL.TuneTable($classname(),$$$YES) d $system.OBJ.Compile($classname(),"cu-d") k ^dc.testI d ##class(%SQL.Statement).%ExecDirect(,"select * from dc.test").%Display() s ^dc.testI("iF",1,22)="" w !! d ##class(%SQL.Statement).%ExecDirect(,"select * from dc.test").%Display() s ^dc.testI("iF",4,33)="" w !! d ##class(%SQL.Statement).%ExecDirect(,"select * from dc.test").%Display() } }
go to post Vitaliy Serdtsev · Apr 7, 2022 If we open the source code of the class for the Status field, we will see the following: Class Ens.DataType.MessageStatus Extends %Integer { Parameter DISPLAYLIST = ",Created,Queued,Delivered,Discarded,Suspended,Deferred,Aborted,Error,Completed"; Parameter VALUELIST = ",1,2,3,4,5,6,7,8,9"; }Therefore , the following conclusions can be drawn: For Embedded SQL the RuntimeMode is Logical For SQL Explorer (Portal) the RuntimeMode is Display Hence the leapfrog in the results.
go to post Vitaliy Serdtsev · Mar 31, 2022 Note: The preferred way to convert UTC time to local time is to use the $ZDATETIMEH(utc,-3) function. This function adjusts for local time variants.proof Also see ##class(%UTC).NowLocal()
go to post Vitaliy Serdtsev · Mar 17, 2022 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,..,fieldN) select field1,..,fieldN from cache.tableOr 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
go to post Vitaliy Serdtsev · Feb 9, 2022 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.
go to post Vitaliy Serdtsev · Feb 9, 2022 Are you trying to localize a product created by InterSystems? If so, it is better to contact the WRC.
go to post Vitaliy Serdtsev · Feb 9, 2022 za (Tai–Kadai Zhuang, Chuang) - a very rare language, it's probably better to do the translation yourself. See Translating JSON files: a complete guide to l10n and i18n
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 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 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 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 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 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)
go to post Vitaliy Serdtsev · Dec 7, 2021 Try the following: enable "Retain cached query source" as described above compile your class/project with addition flags "k /compileembedded=1" (see Validating Embedded SQL Code) open the code of the generated program from the Studio or System Portal like %sqlcq.[YOURNAMESPACE].xETs3uMe2Ehn2LY5inuZiK4xgwnS.1.int Note: at the same time, do not forget to specify checkbox for system items Profit!
go to post Vitaliy Serdtsev · Dec 3, 2021 See this. Note: For Caché, there will be a "\Intersystems\Cache\" instead of "\Intersystems\IRIS\". Also note that for the 32-bit version, the paths in the registry will be slightly different from those specified in the example.