go to post Kyle Baxter · Feb 22, 2019 This typically happens when you have some corruption of the Extent information for your namespace. You'll want to delete the nodes for digi.packet in ^oddEXT and ^rINDEXEXT (in the "G" and "U" nodes, I believe). You can try running ##class(%ExtentMgr.Util).DeleteExtentDefinition("digi.packet") but I'm not sure if that will get it all the way done.The easiest thing to do might be to export all your classes and import them into a fresh namespace (as you noted this works in many other places). If you want more step-by-step guidance or any root cause analysis, I recommend contacting InterSystems Support (support@intersystems.com)
go to post Kyle Baxter · Feb 14, 2019 Joe Gazillo! Good to hear from you!I think that code should work back to 2016.2. Basically after the change to our JSON objects. To work on 2016.1 you'd have to change %Push() to $push(). Earlier versions, you'd have to something with the %ZEN.Auxiliary.jsonProvider to get that to work.
go to post Kyle Baxter · Feb 14, 2019 Can you not edit answers that are "accepted"? Because my code is wrong and needs updating.
go to post Kyle Baxter · Feb 13, 2019 Class Def--------------Class User.JSONify Extends %Persistent{Property JSONData as list of %String; ClassMethod MakeJSONArray(list) as %DynamicArray [sqlname="MakeJSONArray", sqlproc]{ q:(('$listvalid(list))|| (list="")) "" set jsonarray=[] for i=1:1:$LL(list) { d jsonarray.%Push($ListGet(list,i)) } q jsonarray}}--------------Data Population---------------USER>s obj=##class(User.JSONify).%New() USER>s json="{""Name"":""Kyle""}" USER>w obj.JSONData.Insert(json)1USER>s json="{""Name"":""Evgeny""}" USER>w obj.JSONData.Insert(json) 1USER>w obj.%Save()1-----------------Query-----------------3. select JSONData,MakeJSONArray(JSONData) from JSONify JSONData Expression_2$lb("{""Name"":""Kyle""}","{""Name"":""Evgeny""}") 17@%Library.DynamicArray 1 Rows(s) Affectedstatement prepare time(s)/globals/lines/disk: 0.0507s/37476/174342/0ms execute time(s)/globals/lines/disk: 0.0003s/2/598/0ms-----------------Extra Proof-----------------USER>s sql="select JSONData,MakeJSONArray(JSONData) from JSONify" USER>s rs=##class(%SQL.Statement).%ExecDirect(,sql) USER>w rs.%Next()1USER>s json=rs.%GetData(2) USER>w json16@%Library.DynamicArrayUSER>w json.%Get(0){"Name":"Kyle"}USER>w json.%Get(1){"Name":"Evgeny"}Not 100% on this design, but getting it to work isn’t bad. You’ll need extra error checking crap in any REAL code, obviously (for instance, I do ZERO checking to see if what is in the list is valid JSON).Cheers,KyleEdit: Adding parens around list="" as is proper when writing ObjectScript code. Due to ObjectScript's left-to-right evaluation, it is important to always wrap your conditions in parens or risk getting some unexpected results!!!
go to post Kyle Baxter · Jan 11, 2019 AVG exists in 2015.1. If you want the median you might have to calculate that yourself within a function. Do you need an SQL-only solution?
go to post Kyle Baxter · Jan 3, 2019 Sorry, perhaps I need to give a little more background than exactly none :-)The way Atelier connects to Caché (eq. Ensemble, HealthShare, IRIS) is via a webserver. Atelier connects to the webserver and the webserver connects to Caché. What you need to do is set up the webserver to allow HTTPS connections. To do this, you could use the Private Apache that we ship with Caché (eq. ...), or you could install a full version of Apache or IIS to do this. Alternatively, you could set up a webserver local to your machine. Honestly, you might be better off opening a WRC case (wrc.intersystems.com or support@intersystems.com) and one of us would be happy to help you in all the gory details. There are lots of questions to be asked here such as what attack vectors are you protecting against and where your server, webserver, and Atelier are all installed..
go to post Kyle Baxter · Jan 2, 2019 Did you enable HTTPS on your webserver? If so, that typically means a new port (default: 443), which you would need to add to your connection. If not, do you know how to enable HTTPS on your webserver?
go to post Kyle Baxter · Dec 12, 2018 The answer to your question is 'almost never'. If you run TuneTable on your class/table then you will be required to do a purge so the optimizer can pick up the changes. Aside from that, the Caché engine should handle all purges automatically. If you change a class and compile it, that compilation should trigger a purge of the appropriate cached queries. If you are finding that it does not, then please contact the WRC so we can get this fixed.
go to post Kyle Baxter · Dec 12, 2018 If ever you are looking for generalized information, you can always look at learning.intersystems.com as well as the documentation (docs.intersystems.com). There's a lot of good videos there that you can use to help get going. If you have any specific questions there are plenty of us who would be happy to answer them.
go to post Kyle Baxter · Oct 10, 2018 Hey Laura!OK so if Frozen Query Plans was your problem (and it's a good hypothesis), then unfreezing them all gets you back to the old behavior (you'll need to recompile and purge cached queries). There were some problems with the 'old' dynamic SQL classes, but I think those were solved, so you shouldn't have any problems going forward. So let's talk about this a bit.What are Frozen Query Plans?If you've ever upgraded Caché and had a critical query degrade in performance, you'll agree this technology is pretty cool. What it does, is to lock down your query execution plan during upgrades (or it can be user [you're the user] initiated). Benefits: No bad surprises during upgradesDrawback: No benefits from core improvements to SQL engineIs it a problem to Unfreeze all plans?No! Of course not. You will absorb some risk, but if you usually don't have problems then you will continue to not usually have problems. If you unfreeze all plans you'll need to compile your application and/or purge cached queries. To do this you can execute the following in your application namespace:w $SYSTEM.SQL.FreezePlans(0,1,,.err)d $SYSETM.SQL.Purge()You can obviously look this up in the docs for more information. If you have embedded SQL queries those would need to be recompiled.Dynamic SQL ImplementationWe (InterSystems) recommend using %SQL.Statement in lieu of %ResultSet for dynamic SQL. When you ask if you should change, the answer is 'yes'. However, this only fixes your problem because when you use %SQL.Statement it ends up being a slightly different query according to our Frozen Query Plan implementation. It fixes your problem, but not the root of the problem. %SQL.Statement is also fine to use for 'older' code. Of course, if you don't want to change your code ("if it ain't broke"), that's understandable.SELECT * queriesRunning a SELECT * query is a bit of an edge case. It is frequently better to list out your fields so your are only showing your users the data they are interested in. Indeed, you can only run into this problem if it is a SELECT * query. In general, list out your fields. So that's that. If you have any further questions, feel free to let me know :-)
go to post Kyle Baxter · Oct 10, 2018 The Audit Log can actually give you that information already. If you audit Login and Logout events you can then use SQL to see what's going on in the system. Here's a query to get started (in the %SYS namespace): SELECT UTCTimeStamp,Username,Event FROM %SYS.Audit
go to post Kyle Baxter · Sep 12, 2018 I recommend you open an issue with the WRC. We'd be happy to help you out here.
go to post Kyle Baxter · Jun 8, 2018 While Gilberto's answer is right, I would file this under "not the purpose of SQL". While there are many things you can do with SQL, the purpose of SQL is not to administer Caché/IRIS users. You are much better off using the Management Portal or one of the accepted APIs.
go to post Kyle Baxter · May 25, 2018 Alas, I'm going to be out of the office for the next two weeks, so I won't be able to answer questions on this video. But I'll try to remember to come back to it when I'm back in the office on 2018-06-11. Hope you all enjoy this as much as I hate hearing the sound of my own voice!
go to post Kyle Baxter · Feb 14, 2018 I'd bet my breakfast that your first line of code connects to a remote database, and that is failing. Therefore, when you go to prepare your query, it is failing due to no connection. Check the status code from your Connect() call and let us know what that says.
go to post Kyle Baxter · Jan 26, 2018 For an ACTUAL solution to your question - go to the SMP and to System Administration->Configuration->(CSP/Web) Gateway Management. From there go to 'Default Parameters'. The timeout you want to change is the Server Response Timeout. If you are using the private apache you can also edit the CSP.ini file in <Install>/csp/bin/. Of course, if this is a Production Systems DO NOT DO THIS OR I WILL FIND YOU AND SAY VERY MEAN THINGS!
go to post Kyle Baxter · Jan 10, 2018 Your IIS configuration maps /csp to the CSP Gateway, but your application is /myapp - so when IIS looks at /myapp, it doesn't know what to do so it tries to serve files off of your filesystem which, of course, it can't!So your question now, no doubt, is why does it work through the private Apache server (57773)? Well because the private Apache server is set up to ALWAYS send ALL requests to the CSP Gateway, and the CSP Gateway knows how to handle it.There's another trick, too. When you create your /myapp virtual application, make sure you create a new module mapping for *. REST requests do not have extensions so you need to be sending all requests to the CSP Gateway regardless of extension (or things won't work)!If you are having any more trouble getting this set up, please feel free to contact the WRC and we'll be happy to help you get set up.
go to post Kyle Baxter · Nov 28, 2017 If you haven't already viewed Mike's excellent course on creating your first REST API, I recommend checking that out here:https://learning.intersystems.com/course/view.php?id=681That will give you a good foundation for this course. Hope to see many of you there!!!
go to post Kyle Baxter · Nov 28, 2017 The advice you have received thusfar has been OK, but the easiest thing to do would be to watch Mike Smart's global summit presentation, which takes you from literally nothing, to having a (nearly) fully fleshed out REST API in a simple case. See that here:https://learning.intersystems.com/course/view.php?id=681If this is your first time working with REST Applications, this is the best place to start. Then, if you'd like, you can continue with an online learning course, where Mike is going to expand on this to include some best practices. Announcement for that is here:https://community.intersystems.com/post/webinar-dec-7-rest-and-relaxatio...Hopefully we'll see you there!