#ObjectScript

14 Followers · 1.6K Posts

InterSystems ObjectScript is a scripting language to operate with data using any data model of InterSystems Data Platform (Objects, Relational, Key-Value, Document, Globals) and to develop business logic for serverside applications on InterSystems Data Platform.

Documentation.

New
Question Jeffrey Drumm · 3 hr ago

I have a number of services that call SQL stored procedures and map their result sets to Record Map Batch objects. The stored procedures take optional start and end date parameters, but default to the prior day for their daily run.

Because the database they're running against is an asynchronously updated data repository for an EHR, there are times where the stored procedures will not capture all the data that should have been there and we need to re-execute the stored proc with a specific date (and sometimes time) range.

0
0 7
Article Guillaume Rongier · Mar 13 6m read

ObjectScript Search icon

If you have ever dug through a large IRIS namespace looking for where a particular string, method call, or pattern was used, you know the pain: there was no built-in way to do a grep-style search across your server-side ObjectScript code from VS Code — at least not without jumping through some hoops.

That is what ObjectScript Search fixes.

Try it today with a simple install from the VS Code Marketplace. If you don't like it, uninstalling is just as easy. But I think you will like it — it is a huge quality-of-life improvement for anyone doing ObjectScript development in VS Code.


7
1 183
New
Question Scott Roth · Mar 23

I have created the following Task to kick off a Ens.BusinessService to execute a SQL query and process the results

Class OSU.Workday.TerminationsTask Extends %SYS.Task.Definition
{

Parameter TaskName As STRING = "OSU - Workday Termination Update";

Method OnTask() As %Status
{
    #Dim sc as %Status
    #Dim ex as %Exception.AbstractException
    
    set sc = $$$OK

    try{
        // create the service
        #Dim tService As OSU.DataSource.Workday.TermService
        Set tServiceConfigName = "OSU.DataSource.Workday.
1
0 35
Discussion Gabriel Ing · Mar 4

Anyone up for a round of golf?

Are you fed up of making a machine write code for you? Do you miss thinking through problems yourself? Then you are in luck, this round, I propose adding the rule of no AI use. obviously its a game of honor with no prize, so I shan't be enforcing this, but you'll know... 

Challenge:

Create a function which takes a string as a parameter, and returns the length of thelongest sequence of alternating consonants and vowels. The sequence is broken by having two vowels or two consonants in a row.

8
1 220
Question Scott Roth · Mar 12

We are trying to track down significant growth within our Namespaces, one big culprit is Ens.AppData (EnsLib.SQL.Snapshot). 

Within many of our BPL's we use EnsLib.SQL.Snapshot to return Results from External SQL Stored Procedures or Query's. The same EnsLib.SQL.Snapshot context variable is used for many of these calls within a BPL. 

Is there something we should be doing at the end of the BPL to ensure that EnsLib.SQL.Snapshot gets cleaned up and purged from Ens.AppData?

1
0 28
Question Scott Roth · Mar 10

How can I create a Task that tells a Ens.BusinessService to execute its SQL query using the EnsLib.SQL.InboundAdapter?

So far I have come up with

Class OSU.Workday.TerminationsTask Extends %SYS.Task.Definition
{

Parameter TaskName As STRING = "OSU - Workday Termination Update";

Method OnTask() As %Status
{
    try{
        // Call BusinessService
        set tSC = ##class(Ens.Director).CreateBusinessService("OSU.DataSource.Workday.TermService",.tService)

        if $IsObject(tService){
            set inputMessage = ##class(Ens.StringContainer).
6
0 73
Article Scott Roth · Mar 11 3m read

Background

Emergency Medical Services (EMS) teams often arrive at the emergency department with patients whose demographics are incomplete or unknown—no medical record number (MRN), no confirmed name, and sometimes no date of birth. Yet EMS transportation notes still need to land in the correct chart.

To support safe and reliable documentation, EMS agencies, third-party integration services, and hospital integration teams build secure interfaces that exchange identifiers and clinical messages.

0
0 51
Question Luis Dellán · Mar 10

How to execute a stored procedure in a remote DB2 database?

Hi Everyone,

I want to access a stored procedure in a remote DB2 database. The stored procedure in question is linked and receives a numeric value, returning a cursor with N number of rows. Sometimes the number of rows reaches hundreds of thousands, so I need to apply pagination.

I've been reading about the %ScrollableResultSet library, but it doesn't allow me to call a stored procedure.

Here's part of the code:
Set pValor=12345678
Set callSql="CALL Paquete.ClaseSpRemoto(?)"
Set rs=##class(%ScrollableResultSet).

0
0 39
Question Scott Roth · Mar 2

I am stuck at a crossroad and was wondering if I could get a second pair of eyes to help with a query that I am sending from a Task to a Service to process some data.

I have a Linked Table (view) that points back to a MS SQL View that I am trying to query. However, my execution keeps either failing or not returning any rows. When I take the SQL Query and execute it within the Management Portal I get results, however Cache is not seeing it when trying to execute this code.

4
0 87