go to post Robert Cemper · Nov 15, 2021 callSQL ; ; compose an SQL Statement set query="SELECT something FROM TABLE_A JOIN TABLE_B ON ...........WHERE ...." set rs=##class/%ResultSet.%NEW() set sc=rs.Prepare(query) if 'sc write $system.OBJ.DisplayError(sc) set sc=rs.Execute() if 'sc write $system.OBJ.DisplayError(sc) while rs.%Next() { ;consume the result set row by row } OK yo can write this in .INT, in .MAC, in Methods .....and SORRY:IDX is still just 3 chars to me, as Athena is 6 chars. (or the Greek Godess of Wisdom)
go to post Robert Cemper · Nov 12, 2021 BIG CONGRATULATIONS to the team that made this possible! When I joined ISC ~20 years ago I was shocked that there was no exchangeof information and code between customers. There was just nothing.As SSE I met customers that didn't know of each other just living within a mile's distance. I made noise and rumors and proposals to change this.Located in Vienna(Austria, EU) with no local office I had zero influence.I was like an alien from the outer edge of the milky way. Only 4 years ago, 3 years after my retirement from ISC, and just by accident, I met the Community. I'm happy that "my personal" dream became so successful true.Thanks to the amazing team and their many ideas that move the Community forward.
go to post Robert Cemper · Nov 11, 2021 I assume your Classmethod runs from console / terminal.running as scheduled Task you are always running in Background.So where do you expect all the WRITE to go.I did neither see a log file or a Spool device.
go to post Robert Cemper · Nov 11, 2021 I just found this. https://stackoverflow.com/questions/3897694/python-convert-csv-to-dbf (just 1 of several dozens) You have no embedded Py in Caché. But you could create a CSVand then convert it to DBF with an external converter triggered by some $ZF(-1) Or via CPIPE device.
go to post Robert Cemper · Nov 11, 2021 "ok but where should I specify $ or $.firstName, please answer if you know this."Sorry, I'm lost as you. From the docs I understand this is a position definition. Though I have no idea how to apply it to the %iFind.
go to post Robert Cemper · Nov 11, 2021 There is a basic mistake:docs refer to "Indexing a JSON Object aka %DynamicObject But in your example, you use %Stream.GlobalCharacter which is a totally different objectThe fact that it contains a JSON formatted string is not visible from the outside of the stream.Instead of writing it to the Stream (which is an overkill anyhow) convert it and store it as JSON Object. That's what I had to do in my example
go to post Robert Cemper · Nov 10, 2021 OK. I was blocked by other activities. But this is my solution:Assumption1: Property JSON As %Stream.GlobalCharacter;Assumption2: You know the properties you want to index, as with normal tables The idea: A calculated property is mainly used for building indices The solution: the Stream needs to be presented as %DynamicObject to get the value. And here is it: Property JSON As %Stream.GlobalCharacter; Property FirstName As %String [ Calculated, SqlComputed , SqlComputeCode = { set {*}=..GetDyn({ID},"FirstName") } ]; Property LastName As %String [ Calculated, SqlComputed , SqlComputeCode = { set {*}=..GetDyn({ID},"LastName") } ]; Index fn on FirstName; Index ln on LastName; ClassMethod GetDyn(ID As %Integer, item = "") As %String { set JSON=..%OpenId(ID).JSON do JSON.Rewind() set st=JSON.Read(3000000) set dyno={}.%FromJSON(st) set rep=$Property(dyno,item) quit rep } There is room to improve the speed of the method. Also saving your keys in individual properties during data load could be a valid approach.The principle is always the same. %Stream --> %DynamicObject --> extract keys by name
go to post Robert Cemper · Nov 10, 2021 Just an idea:If you use calculated properties (==columns) for FirstName, LastNameyou can create an index on these properties without increasing the storage requirement.
go to post Robert Cemper · Nov 7, 2021 Hi @Herman Slagman ,You got exactly my point and my interpretation of the message.- forget about the file and CSP-TAG-based frontend.No word on the backend this works perfect and there is no reason for change.
go to post Robert Cemper · Nov 4, 2021 A rather personal view:The development of customized tags was an attempt to hide COS from "TAG-SHUFFLERS" as we named back at the start of this century WebPage coders. Neither JS nor CSS was there yet,But something more "modern" than the previous VB5 and VB6 tools were required.ISC was never a leader in WebPages rather a follower. Also with ZEN and MOJO.And CSP was definitely never a buying argument for Caché or IRIS.It was never a core business. Rather a necessary requirement, demanding quite some effort.Today nobody is forced to drop existing development. It is there and it will persist, and it's not hidden, but it will not be pushed. A personals note.The first CSP Training for customers was written by my friend Salva (@Jose-Tomas Salvador) And I did the translation of this training to German and English.( ~ 2 decades back)
go to post Robert Cemper · Nov 4, 2021 And as you might also have seen the version was 2021.2 which is not released yet.
go to post Robert Cemper · Nov 4, 2021 Your reference explicitly mentions CSP files (with CSP markup language)that are stored outside of Caché / IRIS. But this doesn't affect class-based CSP and the related server technology.
go to post Robert Cemper · Nov 4, 2021 as by reply of @Andreas Dieckow on June 23, 2021https://community.intersystems.com/post/advisory-discontinued-technologies-and-features#comment-159616 Caché Server Pages are fully supported on InterSystems IRIS and C/E.
go to post Robert Cemper · Nov 4, 2021 ??? you seem to insert the ID already ???set sql = " INSERT INTO Prenotazioni_CUP "_" (ID, cf)"_" VALUES (SEQTAB.NextVal, ?) ??? not clear what you are looking for ???
go to post Robert Cemper · Nov 3, 2021 A Super Tool. I wish I had it in past alreadyThanks for posting
go to post Robert Cemper · Nov 3, 2021 What you experience is the effect of the Global Buffer Pool.The rule is to overwrite the least used buffer if a new is required.So the older the buffer the higher the chance to be overwritten and later reloaded.Purging queries only affects code not data Possible option: increase your buffer pool (double or triple size)or try this approach: https://community.intersystems.com/post/global-buffer-questionssuggested by @Julius Kavay
go to post Robert Cemper · Nov 3, 2021 Utils.GetNumber('456') is a static expression and not depending on rows so it is calculated only once. do this changes: ClassMethod GetSomeNumber(intInput As %Integer, id ) As %Integer [ SqlName = GetNumber, SqlProc ] and your query SELECT Utils.GetNumber('456',ID), .... by adding ID you force a recalculation by a row dependency
go to post Robert Cemper · Nov 1, 2021 not so clear what you mean by MUMPS routine.if it is an .INT routine you just create an object from one of the ResultSet classes and execute the queryif it is a .MAC routine you may also use Embedded SQL which I don't prefer so much. And BTW. what is an IDX routine ??? What do expect by a VIEW? It is just a kind of store SQL statement.