Question MARK PONGONIS · Apr 11, 2024 using variable as package/class name to call Class method Is it possible to use a variable instead the actual class name when calling a class method? Ex. s var = "MyPackage.MyClass" d ##class(var).Main() #ObjectScript #Caché 0 6 0 146
Question MARK PONGONIS · Nov 9, 2023 check if %Net.HttpRequest.HttpResponse.StatusCode is success Is there a function that will check if an http request was successful or not? Maybe something similar to c# respose.IsSuccessStatusCode? %Status still returns success even if the response status code equals say 404. Ex. #InterSystems IRIS 1 4 1 583
Question MARK PONGONIS · Jul 15, 2022 Dynamic SQL query on record that is locked Is there a way to perform an %Prepare()/%Execute() that will wait until the record being queried is unlocked by another process? Ex: Process 1 - is opening record, updating, then saving. NOTE: this is using embedded SQL #Caché 0 3 0 216
Question MARK PONGONIS · Apr 7, 2021 string search from list of keywords anyone know of a simple way to search a blob of text from a list of keywords in one fell swoop, without having to iterate through each keyword and perform an individual search? Ex. s keywords="This,blob,text" s text = "This is a sample blob of text" i text[keywords w "hit" #ObjectScript #Caché 0 2 0 254
Question MARK PONGONIS · Dec 15, 2020 Using a variable to reference an object property Anyone know if it's possible using cache objectscript (or something else maybe) to reference an object property using a variable? For example: s obj={} s obj.prop1="hello" s var="prop1" w obj.var <== which would result in a reference to obj.prop1 and write out "hello" #Caché 0 7 0 354
Question MARK PONGONIS · Aug 27, 2018 Cache SQL Lock at record level Is there a way to lock at the record level? I know that you can lock at the table level: &sql(UNLOCK mytest IN EXCLUSIVE MODE) but am unable to find a way to lock just at the record/row level. Would this also affect a SELECT statement done on the record? #SQL #Caché 0 1 0 395
Question MARK PONGONIS · Jul 17, 2018 Cache Dynamic SQL Pagination Would like to know if there is an alternative or better way to paginate through a dataset using dynamic SQL than what I am using below. The problem is that as the potential pool of data gets larger, this code slows down to the point of not being useable. In analyzing each line of code below, it appears the slow down is related to the initial rset.%Next() iteration. Is there anything available which does not require a subquery/%VID such as a simple LIMIT/OFFSET?My code is similar to :s sql=##class(%SQL.Statement).%New() #Object Data Model #SQL #Caché 2 30 3 3.3K