I agree, makes total sense. Documentation also have a feedback button on every page IIRC
- Log in to post comments
I agree, makes total sense. Documentation also have a feedback button on every page IIRC
Cool! Add dsw? Curious how it displays it? Also, DSW works neatly on a mobile
Congrats, @henry ! Well deserved!
Thanks @David Hockenbroch !
An almost ideal pattern to run an SQL query in ObjectScript.
If you could also share with error handling around?
My typical pattern looks like this one below. Includes try-catch in case when I need to rollback something:
try {
set tStatement = ##class(%SQL.Statement).%New()
set query = "ALTER Table "_table_" ADD PRIMARY KEY ("_column_")"
$$$TOE(st,tStatement.%Prepare(query))
set rset=tStatement.%Execute()
if rset.%SQLCODE < 0 {
write "Error adding primary key: "_rset.%SQLCODE_" "_rset.%Message
set ex=##class(%Exception.SQL).CreateFromSQLCODE(rset.%SQLCODE,rset.%Message)
$$$ThrowStatus(ex.AsStatus())
}
}
catch ex {
set st=ex.AsStatus()
}Oh my god! What a drama!

Guys, you are maybe late for the Venice Film Festival 2025, but the Oscar 2026 nomination is yours!

And moreover, Dave Davidson is healthy and sound because of Interoperability and InterSystems! Thanks @Vishal Pallerla and team!

Great project! If the source code is available?
It's not for JSON transformation directly, but a nice package by @Guillaume Rongier that lets you have messages contain data in JSON vs XML in the Interoperability pipeline.
Hi @Dmitrij Vladimirov ! This is pure ObjectScript AFAIK in an expression mode (think of it if you create a classmethod in ObjectScript in Expression mode), with options of %source to reference base class properties and %cube to reference Cube class methods.
BTW, faced the same situation today to have an option of getting full sqlname for a class, and generated a classmethod in VSCode with AI (no my personal touch):
ClassMethod GetSQLTableName(pclass As %String) As %String
{
// returns the SQL table name for a class
set tablename = ##class(%DeepSee.Utils).%GetSQLTableName(pclass)
if tablename="" {
set tablename=$TR($P(pclass,".",1,*-1),".","_")_"."_$p(pclass,".",*)
}
return tablename
}And its working. Not bad for a bot.
Hi @Sam Duncan !
I think DC AI Bot answered right: if you try also add:
zpm "enable -community"
this will allow to install packages from a community registry
I guess DC AI bot takes only the post body into the consideration thinking the title is a summary of the post. I this case title is one question and post body is another one.
Thanks for this great contribution, @David McCaldon ! Could you please also publish at Open Exchange?
In anyways, there are folks on the community that can help even with these already undocummented stuff )
$zel, $zlp - two new ObjectScript functions in one day after more than 10 years in InterSystems... Love this community! )
Great app, @Raj Singh ! thanks for the contribution!
Adding two more "cents" for different LOAD DATA usage options:
1. csvgen app, which allows you to create a table and import data automatically as simply as:
do ##class(community.csvgen).Generate("/home/irisowner/dev/data.csv",",","package.class")
It will guess datatypes and use LOAD DATA under the hood.
2. And csvgen-ui - a web UI for csvgen by @Guillaume Rongier
Also, if you are into embedded Python, take a look at csvgenpy, which uses not LOAD DATA, but sqlalchemy.
Thank you, @John Murray, for what you did and keep doing for this community! Well deserved!
It works because you published a question on Developer Community :) (Joking, of course :)
Jokes aside - a very helpful discussion! Thanks @Sylvain Guilbaud !
a really helpful repo, @Sylvain Guilbaud ! do you want to publish it on OEX? Please? )
Hi Paul!
I suggest to take a look two mechanisms:
1. merge cpf - you can list the configuration changes made to vanilla iris/or your custom image.
2. IPM
with IPM you can deploy classes, web apps, files and production elements, run install scripts and version product changes.
I see, makes sense
I see that coding guidlines for ObjectScript linter should be a document (json? yaml?) you include in your code repository or reference any file in a github/gitlab and VSCode linter follows it on-the-go.
Or as some ObjectScript.Quality like ruleset, is it possible @Daniel Tamajon ?
Or as a codetidy feature by @Timothy Leavitt, but it's not easy to use.
This is great, @Ben Spead! Could you please provide an example of how any developer can leverage the code guidelines @Robert Barbiaux suggests in this post?
Voted.
Rebuild indices, this could be the case.
Great points, Dima. But I think any discussions make sense - this is how people communicate and exchange ideas, as you did in your post as well. We could request ObjectScriptQuality to add a profile that will enforce the rule and also, there is a linter in VSCOde ObjectScript - maybe it is possible to request the change in it too.
The idea of an open-source parser for ObjectScript - a good one, do we have it published on the ideas portal?
Are you sure you want to see that many rectangles on a treemap?
Thank you, @Jonathan Lent ! Pleasure to hear we are still better in some spaces than bots :)
Hi @Jonathan Lent !
Great question!
It is supported. You can take a look at the Interoperability template on Open Exchange.
Here is the line of code in a module.xml file.
Great example of custom class queries, @Timothy Leavitt !
I wonder if the recursion with ..AllFetch() is necessary here and in every case?
Very useful article, a lot of use-cases and examples! Thank you @Ashok Kumar T !