go to post Robert Cemper · Nov 19, 2017 A Total different idea.if Transaction.Account is defined as Account object (could also be calculated) [ Property Account as Account ; ]then you may use implicit join for your query. it looks like this:select Account.Name, Account.State, Transaction.Amt, Transaction.Date, Transaction.Servicefrom Transaction left join Account on Account.Id = Transaction.Account where Transaction.Account in ( Select Account.Id from Account where Transaction.Account ->Type is not null and Transaction.Account->Id>123456789 and Transaction.Account->Id <=323456789 ) and Transaction.Date >= ?and Transaction.Date <= ?
go to post Robert Cemper · Nov 19, 2017 OK, that looks better now go to Mgmt Portal /SQL and verify for both tables that you see values in column Selectivity (marked)IF THERE IS NO SELECTIVITY ANY QUERY PLAN IS JUST GUESSWORK.if this is empty Query Generator just can guess and do a lot of unnecessary extra work.so got Tune Table click itand this you get there information that the Query Generator allows to make useful optimizations (marked)Next enter your specific query and click to "Show Plan"that marked information tells you what is happening and Relative Cost qualifies the expected performance. This query plan tells you what is really happening.
go to post Robert Cemper · Nov 19, 2017 At first sight I'd say the Query Generator is right as your Sub Select Just adds some more WHERE conditions.Your range on Transction.Date with related index might be much more limiting than your range on Account.Id.A index on Account.Type might also speed up your query. where Account.Id in ( Select Account.Name from Account?? Is Account.Name the same as Account.Id ??? IN ( ) expects EXACT VALUES !Suggestion if no done yet: Run tune Table for both tablesNext: publish the generated Query plan.
go to post Robert Cemper · Nov 17, 2017 much faster and straight forward string conversion then $ZD* stuff doing unnecessary conversions .
go to post Robert Cemper · Nov 17, 2017 24 hrs is fine. but which time zone? UTC,EST, ...?Rollig it along the globe will extend it to be 48 hrs.
go to post Robert Cemper · Nov 16, 2017 I assume you know where you get your email address from.The rest is straight COS and your code my look like thisset myEmail=....... ;wherever you get it from your PID-13-4set msg=..CreateTextMessage(myEmail) ClassMethod CreateTextMessage(toMail) As %Net.MailMessage{ Set msg = ##class(%Net.MailMessage).%New() Set msg.From = "test@test.com" Do msg.To.Insert(toMail) Do msg.Cc.Insert("yyy@yyy.com") Do msg.Bcc.Insert("zzz@zzz.com") Set msg.Subject="subject line here" Set msg.IsBinary=0 Set msg.IsHTML=0 Do msg.TextData.Write("This is the message.") Quit msg}
go to post Robert Cemper · Nov 15, 2017 A dirty hack:- make a new class extending %SerialObject with VALIDIFNULL set.- export your serial classes (to XML)- replace %SerialObject by your MySerialObject- reload the changed classes.Not so nice but I had the same issue with some 100 Serial Objects.The more sophisticated way would be do it programatically over %Dictionary.DefinedProperty ..... Very interesting and very time consuming
go to post Robert Cemper · Nov 15, 2017 You have to set $ZTRAP again at the begin:Or start with do infile^myroutine ....at the 1. run it is set i line 3you my also pass the filename as parameter
go to post Robert Cemper · Nov 15, 2017 Kevin,there a bunch of excellent examples in standard classes e.g%Regex.Matcherhttp://docs.intersystems.com/latest/csp/documatic/%25CSP.Documatic.cls?P...%Net.HttpRequesthttp://docs.intersystems.com/latest/csp/documatic/%25CSP.Documatic.cls?P...%Net.SMTPhttp://docs.intersystems.com/latest/csp/documatic/%25CSP.Documatic.cls?P...And they are also in source on your system.So it's easy to see how special Tags are used.
go to post Robert Cemper · Nov 15, 2017 Welcome back!infile ; simple file read set filename="C\mydir\myfile.txt" set $ZTRAP="end" open filename:("R"):0 else Write "file error" for line=1:1 use filename read text use 0 write text,! end close filename set $ZTRAP="" use 0 write "Done", quitit's not so sophisticated and I used the end-of-file error to exitThis is also available in class %Library.File with lot more comfort http://docs.intersystems.com/latest/csp/documatic/%25CSP.Documatic.cls?P...HTH
go to post Robert Cemper · Nov 15, 2017 Taskmanager is a part of Caché System Management and you should read the Docs.JOB is a COS command also used in Taskmanager but not only. Any routine may use it.So your Request / Question is just not clear
go to post Robert Cemper · Nov 15, 2017 If you don't want / need the content as object and just want to convert XML2JSONwhy wasting time and energy to re-invent the wheel an not just using any of the many downloadable toolsand call them over $ZF(-2) and consume the result ?Google gave my some thousand hits of tested solutions e.g. https://github.com/sinelaw/xml-to-jsonI mean it's doable with Caché but file_in => file_out is not more than a nice exercise for training.
go to post Robert Cemper · Nov 15, 2017 SQL Code and it's style and methodology was there long before Objects in actual style where introduced. (feeling mid 90ties)It was mainly kept for backward compatibility.In Caché 5 (2002) they were a real parallel universe Object - SQL.Later Computed + SQLcomputed Properties were for long time the only place for common code.
go to post Robert Cemper · Nov 14, 2017 Thanks, totally correct!It's mentioned in line 5 of the doc I pointed to.
go to post Robert Cemper · Nov 14, 2017 Make it a serial class with 2 numeric properties and a calculated for the difference
go to post Robert Cemper · Nov 14, 2017 But 2015 and before has class %ZEN.Auxiliary.jsonProviderhttp://docs.intersystems.com/cache201513/csp/documatic/%25CSP.Documatic....
go to post Robert Cemper · Nov 14, 2017 just a REMINDER: this is next week Tue - Thuhttp://dach.intersystems.de/Symposium2017/AnmeldungI'll be there (unplugged) see you !