go to post Vitaliy Serdtsev · Aug 23, 2023 Out of curiosity, how would you override that write statement in %CSP.Lookup? Isn't that generated code which one wouldn't want to touch? The source code of the %CSP.PageLookup class is available in %SYS namespace
go to post Vitaliy Serdtsev · Aug 22, 2023 I also noticed three things from your screenshots: instead of the standard program %SYS.Task.RunLegacyTask you are using a non-standard CTools.Task.Legacy. Is this how it should be? you have disabled "Reschedule task after system restart?". Is this how it should be? your task is scheduled for 4:00:00 under Task2, but judging by the history, it was launched at 11:52 and 11:56 under Administrator. Something doesn't add up here.
go to post Vitaliy Serdtsev · Aug 22, 2023 Now it's clearer, you're cleaning up own audit records. As @Yaron Munz pointed out, it's most likely that the Task2 user does not have some rights. For simplicity, you can login to Caché Terminal under this user in the ACB namespace and call your code: ACB:Task2>Do ^CleanAuditLogTables(14)
go to post Vitaliy Serdtsev · Aug 22, 2023 The problem can be solved in two ways: use OPTIONS="popup,sortbox" make a correction to the %CSP.PageLookup Write " <a href=""javascript:searchSort("_..QuoteJS(value)_");"" title=""Sort Results by "_alias_""">" | V Write " <a href=""javascript:searchSort("_i_");"" title=""Sort Results by "_alias_""">" In both case, the query will take the form "ORDER BY <the ordinal number of the field>", instead of "ORDER BY <field name>"
go to post Vitaliy Serdtsev · Aug 22, 2023 I am confused by the name of your task "Clean Audit Log Tables" and the fact that for some reason it is in the ACB namespace. This is your own task? By default, Caché already has a system task PurgeAudit in the %SYS namespace, where you can also specify the number of days (Purge Audit Log)
go to post Vitaliy Serdtsev · Aug 22, 2023 Try calling the method ##сlass(%SYS.Audit).Delete() manually and see what result it will return.
go to post Vitaliy Serdtsev · Aug 21, 2023 Hi Ashok. Can you tell in more detail what exactly is the problem of not-keeping the trailing zeros: calculations give an incorrect result, an error is generated or something else? USER>set json = { "decimal": (12.000)} zw json json={"decimal":12} ; <DYNAMIC OBJECT> USER>set n=12.000 zw n n=12
go to post Vitaliy Serdtsev · Aug 21, 2023 You can enable SQL Gateway Logging. Also make sure that the necessary JDK/JRE version is installed and configured correctly. For simplicity, I would check the connection outside of IRIS, for example through DbVisualizer/DBeaver/SQuirreL/etc.
go to post Vitaliy Serdtsev · Aug 14, 2023 In this case, it will be easier to temporarily dump the data into globals. Then you can access this data at any time, including through %ScrollableResultSet. Here is a small example: ClassMethod tt() [ Language = tsql, ReturnResultsets, SqlName = mycls, SqlProc ] { drop table if exists mytemp1,mytemp2 select name,dob,spouse into mytemp1 from Sample.Person where name like 'A%' select name,age,home_city,home_state into mytemp2 from Sample.Person where home_state = 'MA' } ClassMethod Test() { d ##class(%SQL.Statement).%ExecDirect(,"call dc.mycls()") d ##class(%SQL.Statement).%ExecDirect(,"select * from mytemp1").%Display() d ##class(%SQL.Statement).%ExecDirect(,"select * from mytemp2").%Display() ; and even so d ##class(%SQL.Statement).%ExecDirect(,"select * from mytemp1 cross join mytemp2").%Display() }
go to post Vitaliy Serdtsev · Aug 11, 2023 You are right, this is a mistake in the documentation. Here is part of my code for IRIS 2023.2: var connection = new OdbcConnection( "DRIVER={InterSystems IRIS ODBC35};SERVER=localhost;PORT=1972;DATABASE=USER;UID=_system;PWD=SYS;Unicode SQLTypes=1;Query Timeout=1");Connection and display of the query result were successful.
go to post Vitaliy Serdtsev · Aug 11, 2023 One of the possible options: ClassMethod odbcTest() As %Integer [ ReturnResultsets, SqlName = PersonSets2, SqlProc ] { #dim %sqlcontext As %ProcedureContext if '$isobject($Get(%sqlcontext)) { set %sqlcontext = ##class(%ProcedureContext).%New() } s tReturn = 0 s conn=##class(%SQLGatewayConnection).%New() s sc=conn.Connect("TEST Samples","_system","SYS") //datasource if $$$ISOK(sc) { d conn.AllocateStatement(.h1) d conn.Prepare(h1,"select name,dob,spouse from sample.person where name %STARTSWITH 'A'") d conn.Execute(h1) d %sqlcontext.AddResultSet(conn.getResultSet(h1)) d conn.AllocateStatement(.h2) d conn.Prepare(h2,"select name,age,home_city,home_state from sample.person where home_state = 'MA'") d conn.Execute(h2) d %sqlcontext.AddResultSet(conn.getResultSet(h2)) s tReturn = 1 }else{ s sqlcode=$system.Status.StatusToSQLCODE(sc,.msg) s %sqlcontext.%SQLCODE = sqlcode, %sqlcontext.%Message = msg } q tReturn }Output: SAMPLES>d ##class(%SQL.Statement).%ExecDirect(,"call Sample.PersonSets2()").%Display() ...Surely there is a way to make it even easier.
go to post Vitaliy Serdtsev · Aug 11, 2023 Maybe you should take a look at the class %ScrollableResultSet?
go to post Vitaliy Serdtsev · Aug 11, 2023 I didn't find in the documentation the line {InterSystems IRIS ODBC35}: ODBC Connection Strings Test Program Try Driver=InterSystems ODBC Driver;...or DRIVER={InterSystems ODBC35};...
go to post Vitaliy Serdtsev · Aug 11, 2023 Try googling "ssl_error_syscall errno 10053". Perhaps some of the suggestions will help you.
go to post Vitaliy Serdtsev · Aug 11, 2023 It's clearer now, this is the tricks of Excel, which convert the string 01022000 to the number 1022000. In your case, try changing the cell type from General to Text. PS: when generating Excel reports, I use the Date cell type (short format DD.MM.YYYY), and from Caché/IRIS I return the %Date type. The components that I use already know how to translate the internal representation of the date 01.02.2000 from the Caché/IRIS format (58105) to Excel (36557) and vice versa.
go to post Vitaliy Serdtsev · Aug 10, 2023 Can I see how you call TO_CHAR? I have a leading zero displayed without problems: SELECT %internal(to_date('01022000','DDMMYYYY')) -- 01022000 -> 58105 ,TO_CHAR(58105,'DDMMYYYY') -- 58105 -> 01022000TO_CHAR: Convert Dates to Formatted Date Strings
go to post Vitaliy Serdtsev · Aug 10, 2023 Try this: Set objcontato=##class(Contatos.Amiguinho).%New() Do objcontato.MoradiaSetObjectId(3) Do objcontato.TrabalhoSetObjectId(2) Set ret=objcontato.%Save()See Fastest Way to Connect Objects
go to post Vitaliy Serdtsev · Aug 4, 2023 size = 52 ClassMethod IsValid(s As %String) As %Boolean { 1 s c=$a(s,$i(i))+1 g:1-$i(z,c=42-(c=41))&c 1 q 'z }
go to post Vitaliy Serdtsev · Aug 3, 2023 You can make it even easier: ClassMethod IsValid(s As %String) As %Boolean [ Language = python ] { import regex;return regex.match("^((?>[^()]|\((?1)\))*)$",s) is not None }Unfortunately, RegExp ICU does not support recursive patterns, otherwise it would be possible to write q $match(s,"^((?>[^()]|\((?1)\))*)$")
go to post Vitaliy Serdtsev · Aug 3, 2023 No. This code will not work in IRIS 2023.1 because changes have been made for security reasons: Improvements to how IRIS classes are generated and called