go to post Dmitry Maslennikov · Oct 10, 2016 You can't reset query, and loop again on the same result. You should execute as many as you need their results.But I think you can store result somehow, to some you buffer, and use it in next time.
go to post Dmitry Maslennikov · Oct 6, 2016 For such task, Caché supports XPath -XML Path Language. And you should use class %XML.XPATH.Document, and in this class you may find some methods with examples.
go to post Dmitry Maslennikov · Oct 5, 2016 When you upgrade Caché from any previous version, every time you should look at Upgrade Checklist in the documentation, and this checklist while upgrade from such old version as 5And even with just a search by documentation you may find this link, with a textSPOOLER Heading Processing ChangedIn this version, a number of changes have been made to the HEADING and FOOTING statements, and general printer/terminal output in this context. Applications that depend on the format of SPOOLed output should be carefully checked to make sure the output still conforms to expectations.
go to post Dmitry Maslennikov · Sep 21, 2016 in your code,obj - it is some object, it may have some ID or not, if it just createdname1 - it is a value for property name in that objectbut I completely don't understand why is here name2 and name3, and what do you suppose should be happens after this line ?and how it should save data in other objects which we even don't know which ?you should know somehow which objects you want to update. If you know only some other properties, you can use SQL command UPDATE
go to post Dmitry Maslennikov · Sep 21, 2016 Please forget about old-way programming. We now have so many features out-of-the-box which helps write understandable code quite easy. set fs=##class(%Stream.FileCharacter).%New() set fs.Filename="c:\csvfile.csv" while 'fs.AtEnd { set line=$listfromstring(fs.ReadLine(), ",") #; in line you will get listbuild for all columns in a row } class %Stream.FileCharacter helps to read text files, which may contain text in different codepages, and line ends. Or if you need to read some binary data, which should have some conversion on the fly, use %Stream.FileBinary.
go to post Dmitry Maslennikov · Sep 21, 2016 I've already answered for exactly the same question at google groupsIn first you should look at the official documentation which is available online here. You have very old system, so you should install new version of Ensemble at new windows server. Installation Guide And copy all of you data from old server to new. But it is may be very difficult task, without knowledge about your application.As well you should look at Cache Upgrade checklists archive and latest, and Ensemble Release Notes
go to post Dmitry Maslennikov · Sep 20, 2016 I've used Delphi so long ago, and could be mistaken. But to be sure that application is not interactive, it should not have any visual components. And as I remember you should start developing from Console Application. To check that actually it does work correctly, you may try with real console tool, something like: dir, md, etc.. You may try this $zf(-2,"dir > testdir.txt"), if after executing this code testdir.txt file will appaer with content for some folder, you'll see that it's work. And it means that in your application should be changed something to be as console application.
go to post Dmitry Maslennikov · Sep 19, 2016 You can find any sent data as in CSP pages, just because %CSP.REST inherits %CSP.Page. So, you can read it from %request.Content. Very parse JSON, only on versions since 2016. s obj = {}.$fromJSON(%request.Content) You may read more about newest support for JSON in articles here.
go to post Dmitry Maslennikov · Sep 19, 2016 It does not matter CSP-page or terminal process, for $ZF(-1). Only one issue which may be in your case, if this application is interactive. In this case, Windows may prevent to run such application, just because it works as a service, but it is possible to change it if you allow interactive mode for service of this instance Cache.
go to post Dmitry Maslennikov · Sep 16, 2016 You can only use array instead of list of exported elements. USER>zw list list("a(1).gbl")="" list("a(3).gbl")="" USER>d $system.OBJ.ExportToStream(.list,.stream) Exporting to XML started on 09/16/2016 11:19:58 Exporting global: ^a(1) Exporting global: ^a(3) Export finished successfully.
go to post Dmitry Maslennikov · Sep 6, 2016 Your version of Cache is unsupported, you should have at least 2016.2
go to post Dmitry Maslennikov · Sep 6, 2016 Looks like you want to achieve something else, and on the wrong way. any way you can get the same output as in zwrite to array of lines, with command Do DumpObjectToArray^%occRun(obj,.lines) If you have to restore some object by this data, you have to use serialization, XML for example. For xml I would recommend to look at this part of the documentation.
go to post Dmitry Maslennikov · Sep 5, 2016 It is not so easy, as you may expect, you should look at some tools like Phonegap and so on
go to post Dmitry Maslennikov · Sep 5, 2016 Looks like, you do not know about %Installer.Manifest. You can use it in any different ways, be it installation new application or just simple changing instance's settings. With this manifest I'm building installation archive with project, it includes deployed code some data, and web sources. I'm installing new server with it, manually, or even with docker. And you can use internal Task Manager to run this installation by schedule automatically. You may also look at this project - GitHubCI, it helps to deploy application automatically just after commit to your github repository.
go to post Dmitry Maslennikov · Sep 5, 2016 I think you should look at class %SYSTEM.Encryption where all encryption placed, and at the method $system.Encryption.HMACSHA()
go to post Dmitry Maslennikov · Aug 29, 2016 You can look at the documentation here onlineand excerpt about custom installationThe Caché installation program allows you to select certain Caché components to be installed on the computer. For example, you may want to install only the Caché SQL Manager. Keep in mind that some selections require that you also install other components.and about standard installationThe standard installation procedure installs both Caché server and client components on the computer.
go to post Dmitry Maslennikov · Aug 26, 2016 I did not show how you made connection to the Caché, and looks like, your Java application has hardcoded login password which used to connect to server. so, I may only suggest, that you use code like this Class.forName ("com.intersys.jdbc.CacheDriver").newInstance(); CacheDataSource ds = new CacheDataSource(); ds.setURL("jdbc:Cache://127.0.0.1:1972/SAMPLES"); Connection dbconn = ds.getConnection("_SYSTEM","SYS"); Last string is Caché login password, so you should use here user's login and password. Any works from your application should be with user's login.
go to post Dmitry Maslennikov · Aug 18, 2016 Macros - a part of the ObjectScript compiler that converts macro code into usable Caché ObjectScript code.Routine - a callable block of user-written code that is a Caché ObjectScript program.
go to post Dmitry Maslennikov · Aug 18, 2016 Why do you name it macro ?Maybe you mean MAC routine ? I highly recommend to read this tutorial about CacheObjectScript usually you can call routine by simple command do ^routine but sometime you need to call directly to concrete label in that routine do label^routine() but in this case if you use curly brace style, you should public such method in routine label() public { write "Hello World!" } or in old style label() write "Hello world!" quit
go to post Dmitry Maslennikov · Aug 17, 2016 So, you had to start with such explanation.Well, does not matter what do you set in Accept header, if you don't use it by yourself. Like, you should check incoming content type and send an error if it is not accepted. This Header change nothing in incoming data, if data was sent in another format.To read data, you should know that %request has three different ways for getting data. You have already known in %request.Content, which usually contains binary streams. Then %request.MimeData, and %request.Data, it is a Multidimensional properties, and %request has some getters for them, %request.GetMimeData and %request.Get. MimeData, needs when client send data in multipart mime format, such as several files or so on. And %request.Data, in all most cases, and you should look at this property and method %request.Get("somename")