go to post Robert Cemper · Jul 8, 2018 If you limit the result set and increase the number, does it show any rows or other impact? SELECT TOP 50 REPLACE(CallbackComment ,'''','?') FROM SQ.CBPhoneResult_View WHERE PhoneDateODBC = '2018-04-09'
go to post Robert Cemper · Jul 8, 2018 So you also have no chance to add indices, check for implicit joins and other useful stuff.And of course no terminal access.
go to post Robert Cemper · Jul 8, 2018 OK. You found 801 entries with ~200 k global access.and the query works as expectedSo SELECT COUNT(*) FROM SQ.CBPhoneResult_View WHERE PhoneDateODBC = '2018-04-10' for Tuesday Apr.10 it should return 801 What is the count for Monday 2018-04-09 ? I 'd expect more SELECT COUNT(*) FROM SQ.CBPhoneResult_View WHERE PhoneDateODBC = '2018-04-09'
go to post Robert Cemper · Jul 8, 2018 As you see the query plan is significantly shorter.Your original refers to 3 other tables.To find out why and how to improve would require all table/class & view definitionsSQ.CBPhoneResult_ViewSQ.CBPH_PhoneSQ. CBPH_Result your 2nd query ends here SQ. CB_Test access to CallbackComment starts hereSQ. CB_OrderSQ. CB_ContactWithout the related class definition it is hard to say how these tables link to each otherBut you really should run it from the terminal prompt to see your result at least once:Do you have developer access to your Caché at all? Can you see the class definitions in Studio ?
go to post Robert Cemper · Jul 8, 2018 You may also reformulate your SELECT to read directly from the tables usedstarting with the one holding PhoneDateODBC and forget all the other burden.
go to post Robert Cemper · Jul 8, 2018 OK,now your timeout is clear.with a Relative Cost of ~2 millions, your query requires some support to speed up.You just see the first 6 empty results.First reason: you run over ALL records in ...PhoneMasterwith an inner loop in ...Testmaster on IndexCall,OrdeCode, TestCode,...Result_IndexSo your timeout is not surprising.I'd suggest creating an Index on PhoneDateODBC to speed up your query. >> lower Relative Costwith 2 million I'm quite sure that you even timeout over ODBC.So I'm back to my earlier suggestion:Let your query run from terminal prompt,have a coffee or two and maybe it is completed then.This is not your fault.Blame the designer of that ugly VIEW
go to post Robert Cemper · Jul 8, 2018 OK.You use a Caché version before 2015.1 that doesn't know $TRANSLATEIt's then SELECT REPLACE(CallbackComment ,'''','?') FROM SQ.CBPhoneResult_View WHERE PhoneDateODBC = '2018-04-09' I expect you will run into a timeout again.So please click to "Show Query Plan" and let us see what's going on. Additionally, on left border click to Views;select SQ.CBPhoneResult_View and get an Image similar to this important part: VIEW TEXT
go to post Robert Cemper · Jul 8, 2018 OK. now the picture gets clear. the key problem looks as if a single ' is interpreted as a String delimiter.so instead of naked CallbackComment You may try $TRANSLATE(CallbackComment ,'''','?')(it's really 4single quotes, no typo)So you replace the single quote by a non-conflicting character BEFORE the string is passed to ODBC This would prove that the single quote is the cause of trouble.
go to post Robert Cemper · Jul 8, 2018 what product/component are you interested in?IRISENSEMBLEHEALTHSHARECACHÉTRAKiKNOWDEEPSEE.....and others is as wide as the whole software industryplease be more specific
go to post Robert Cemper · Jul 7, 2018 in addition, it would be worth to see what your SQ.CBPhoneResult_View does.By the ending VIEW I assume it is a View and not a Table:So the complexity of the executed query is hidden and could be the real performance problem.
go to post Robert Cemper · Jul 7, 2018 referring to CSP.... you let me assume you are working from Mgmt Portalnext you say: I am using the Intersystem ODBC driverThis is a contradiction as CSP doesn't use ODBC driverSo what are you really assuming to do ??Anyhow in both cases a SQL String delimiter (') entered in a %String property aka VARCHAR is always presented as it was entered.I verified it over an external ODBC viewer + Intersystem ODBC driver as well as over JDBC: no issue.For ODBC on Windows just use 64bit Version on 64bit platforms.in addition, you may verify your query also from the terminal prompt without any eventual timeout:USER>do $system.SQL.Shell()SQL Command Line Shell---------------------------------------------------- The command prefix is currently set to: <<nothing>>.Enter q to quit, ? for help.USER>> << entering multiline statement mode >> 1>>SELECT 2>>CallbackComment 3>>FROM SQ.CBPhoneResult_View Where PhoneDateODBC = '2018-04-09' 4>>go
go to post Robert Cemper · Jul 7, 2018 if you define a method mymethod() as somethingYou are expected to terminate ist either by QUIT anyvalue or RETURN ayvaluein your example you announce a %Status. so Quit $$$OK would be fine like thisClassMethod getFile() as %Status{ set filename = "/home/test.json" set newArray={}.%FromJSON(filename) write "New entity:"_newArray.%ToJSON() quit $$$OK }if you ommit as %Status you can allso forget the ending QUIT
go to post Robert Cemper · Jul 6, 2018 You are wrong: getFile+8 is set i2 = resultSet.rowSet.%GetIterator()so either resultSet. or resultSet.rowSet is not what you expect it to be.first you do set sc = stream.LinkToFile(filename) but you don't check the success codeAnd with "path/to/file.json" the file name looks more than suspicious to be correct.next you do set obj=... but this obj isn't used at all.next set jsonObj = [].%FromJSON(filename)and there is the fundamental mistake as your variable filename is set filename = "path/to/file.json"which is anything else than the expected JSON array you may have lost some important lines during cut/paste from your example Deserializing from JSON to a dynamic object may have important information for you
go to post Robert Cemper · Jul 5, 2018 It means in row 8 of method getFile you try to use some object reference that doesn't exist yet or is not initialized yet.posting some of your code could enable more precise diagnostic
go to post Robert Cemper · Jul 2, 2018 Hi Scott,It's indeed surprising.But digging into docs tells me>>>> it's not an ERROR code but a RESULT code and 0 = Success. (like SQL)more LDAP Result Codes Err2String is defintely a misleading naming.
go to post Robert Cemper · Jun 30, 2018 It could be sufficient to set ID=""at the beginning of your code to avoid the <UNDEFINED> later down.
go to post Robert Cemper · Jun 29, 2018 I try a simple explanation and you should try to find some docs on HTTP:So I leave out several steps in between to illustrate the basic actions.your browser sends a request GET /index.html HTTP/1.1 Host: www.example.com and if it is successful the server replies HTTP/1.1 200 OK Date: Mon, 23 May 2005 22:38:34 GMT Content-Type: text/html; charset=UTF-8 Content-Length: 138 Last-Modified: Wed, 08 Jan 2003 23:11:55 GMT Server: Apache/1.3.3.7 (Unix) (Red-Hat/Linux) ETag: "3f80f-1b6-3e1cb03b" Accept-Ranges: bytes Connection: close <html> <head> <title>An Example Page</title> </head> <body> Hello World, this is a very simple HTML document. </body> </html> The highlighted part between HTTP and your first <html> is prepared or modified if not default in OnPreHTTP().It has to be ready BEFORE sending the reply. The delimiter between HTTP part and the content transmitted is just an empty line.The closing is 2 empty lines. For the items you can influence see class %CSP.Response
go to post Robert Cemper · Jun 29, 2018 Analysing your code I found @ line 24 i $$$ISWINDOWS,$$$UseSecureConnection{ending @ line 42 that contains s LD=##Class(%SYS.LDAP).Init($$$LDAPServer)but i didn't see an ELSE if the first IF fails.Then LD is undefined. I'm a little bit surprised how it could go up to line 104
go to post Robert Cemper · Jun 29, 2018 you do .ReadLineIntoStream() doc says: https://docs.intersystems.com/latest/csp/documatic/%25CSP.Documatic.clsThis reads from the stream until it find the LineTerminator and returns this as a stream. If the stream does not contain the line terminator this can potentially be the entire stream. and your error message: Premature end of data 12 Line 1 Offset 1 indicates that you have hit some character interpreted as line terminator after 12 characters. (rather short for JSON)My guess: your JSON input is a multiline input with enough line terminators insideAs a consequence your JSON input is incomplete.Suggested workaroundget length of your stream method SizeGet()read full stream ignoring line terminators using method Read(ByRef len As %Integer, ByRef sc As %Status) as %CacheStringeventually, it might be necessary to remove the line terminators before %FromJSON