Article
· Sep 20, 2018 2m read
Get Day of the Week from Date

This code snippet determines the day of the week associated with a date. The class method "test" takes a date as a string in "mm/dd/yyyy" format, and returns an integer corresponding to a day of the week:


Class cartertiernan.getDayfromDate Extends %RegisteredObject
{
    classmethod test(date) as %Integer {
        //Set date = $ZDATE(date) //  Looks like: mm/dd/yyyy
     
        Set monthList = $LISTBUILD(0,3,3,6,1,4,6,2,5,0,3,5) // (Jan,Feb,Mar,Apr,...)
        Set centuryList = $LISTBUILD(6,4,2,0) // first two digits divisiable by 4, then subsequent centuries. EX (2000, 2100, 2200, 2300)
        Set dayList = $LISTBUILD("Sunday","Monday","Tuesday","Wednesday","Thursday","Friday","Saturday") // Index goes from 0-6
         
        Set day = $PIECE(date,"/",2) // get the day 
        Set monthVal = $LIST(monthList,($PIECE( date,"/",1 ))) // get the month value
        Set first2DigsYear = $PIECE( date,"/",3 ) \ 100 // get the last 2 digits of the year
        Set last2DigsYear = $PIECE( date,"/",3 ) # 100 // get the first 2 digits of the year
         
        // Used for DEBUG perpouses
        /*write !,"day: ",day
        write !,"Month: ",monthVal
        write !,"last2: ",last2DigsYear
        write !,"first2: ",first2DigsYear
        write !,"cen Val: ",$LIST(centuryList,(first2DigsYear # 4) + 1),!!*/
         
        // Look here for formula explination (its the "Basic method for mental calculation")
        // http://en.wikipedia.org/wiki/Determination_of_the_day_of_the_week
        Set dayOfWeekVal = ( day + monthVal + last2DigsYear + (last2DigsYear\4) + $LIST(centuryList,(first2DigsYear # 4) + 1 ) ) # 7
     
        Quit dayOfWeekVal
    }
}

Here's a link to the code on GitHub

(originally posted to CODE by Carter Tiernan, 6/18/14)

2 1
1 904
Article
· Jan 11, 2019 4m read
SQL Performance Resources

There are three things most important to any SQL performance conversation: Indices, TuneTable, and Show Plan. The attached PDFs includes historical presentations on these topics that cover the basics of these 3 things in one place. Our documentation provides more detail on these and other SQL Performance topics in the links below. The eLearning options reinforces several of these topics. In addition, there are several Developer Community articles which touch on SQL performance, and those relevant links are also listed.

There is a fair amount of repetition in the information listed below. The most important aspects of SQL performance to consider are:

  1. The types of indices available
  2. Using one index type over another
  3. The information TuneTable gathers for a table and what it means to the Optimizer
  4. How to read a Show Plan to better understand if a query is good or bad
8 1
4 920

Hello,

I have a very simple web service that I'd like to secure via SAML Authorization with X.509 Certificates. I am, however struggling with documentation and my lack of cryptographic skills. (I do this just for educational purposes now, but need to use it in the future)

Does anyone have an example that shows how to construct a SOAP Client with adding all necessary security headers manually or point me to a decent learning resource?

Thank you very much!

2 1
2 1.2K

Have enabled LDAP for our numerous , Ensemble, IRIS and cache instances with many namespaces. All is working fine and the ldap logins work.

But have noticed that the first instance that the user logs into the namespace is assigned to that user, but when that user than logs into another instance the default namespace from the first login is still there and doesn't update to the new namespace.

So this doesn't effect the ldap login but is now effecting the terminal logins where the user is now getting access denied.

0 1
0 270

InterSystems has corrected several critical defects that can result in data integrity issues. These defects were identified and corrected within a short time, so InterSystems has simplified the upgrade process by consolidating them into a single package. The effects of encountering these defects may not always be visible.

0 1
2 374

Last time we launched an IRIS application in the Google Cloud using its GKE service.

And, although creating a cluster manually (or through gcloud) is easy, the modern Infrastructure-as-Code (IaC) approach advises that the description of the Kubernetes cluster should be stored in the repository as code as well. How to write this code is determined by the tool that’s used for IaC.

In the case of Google Cloud, there are several options, among them Deployment Manager and Terraform. Opinions are divided as to which is better: if you want to learn more, read this Reddit thread Opinions on Terraform vs. Deployment Manager? and the Medium article Comparing GCP Deployment Manager and Terraform.

5 1
2 1.4K

Hey Community,

We're pleased to invite all the developers to the upcoming InterSystems IRIS 2020.1 Tech Talk: Speed Under Pressure on July 14 at 10:00 AM EDT!

In this InterSystems IRIS 2020.1 Tech Talk, we'll learn about the open source Ingestion Speed Test. We will explain:

  • the architecture of the ingestion speed test
  • how we are leveraging Docker containers to run it on our PCs
  • how we are leveraging InterSystems Cloud Manager to easily run it on AWS so we can compare InterSystems IRIS with other databases, such as AWS Aurora

After this Tech Talk, you'll be able to use the Ingestion Speed Test on InterSystems Open Exchange for your own testing and benchmarking.

2 1
1 354

In Oracle database, the synonym is an alternative name for objects such as tables, views, sequences, stored procedures, and other database objects.

You generally use synonyms when you are granting access to an object from another schema and you don't want the users to have to worry about knowing which schema owns the object.

Is IRIS SQL sintax has something like this: (oracle sintax)

1 1
0 181
Article
· Mar 2, 2021 1m read
Vote for us
Hotel Overbooking in hospitality industry

This is the first InterStstems programming contest that we participated in! Come check out and vote for us!

3 1
0 161

Hello,

I have a question about a problem calling a SOAP Web Service.

Indeed, to retrieve data via a Web Service, I need to make 4 calls, one to connect, one to place parameters, one to retrieve data and one to disconnect. Using the EnsLib.SOAP.OutboundAdapter class, I manage to make my first connection call but for the other calls I would need to keep my session cookie otherwise it doesn't consider me as connected. I know it's possible to do this in REST directly in the EnsLib.REST.OutboundAdapter class but I can't find a way to do it in SOAP.

0 1
0 269

Hi Experts

I am trying to pull the code tables Information and this code table has linked code table not exactly obviously joined by SQL tables or columns. This is confusing me. Please can you clarify how to link these two tables.

I will be generic to ensure, any privacy is protected

CT_Hospital has CT_Staff linked in.

When CT_Hospital has data, for that relevant hospital code, CT_Staff can be clicked and data entered.

When I see in the Components - > Items I do not see any SQL table or SQL column common between CT_Hospital and CT_Staff.

0 1
1 299
Article
· Sep 11, 2021 5m read
iris-analytics-for-money

I regret getting a late start in the InterSystems Analytics contest. I had tried a couple of times before to use Analytics, but I had not gotten too far. I have been recording financial transactions in Excel workbook ever since I had to retire Microsoft Money. Since my iris-for-money was not fully functional, I created a worksheet per account I was tracking. I had developed a CSP page in iris-for-money to import transactions by reading a CSV file.

8 1
0 234

Hello,

I'm experiencing a recurrent problem that I haven't found the way to solve, so I'm coming here with the hope somebody can give me a new approach.

To make it short: we are creating categories on-demand to be able to place the maximum numbers of workers in memory, avoiding the limits established by system categories. But from time to time, one of this creation fails and system is no able to start the queue. The error we are getting is:

0 1
0 214
Article
· Jan 28, 2022 2m read
Embedded SQL Bug and Workaround

We recently encountered an Embedded SQL issue while upgrading to IRIS 2021.1, and thought the issue and workaround might be interesting to share.

Key takeaway: Host variables in an ORDER BY clause of an embedded SQL query that is inside of a method don't work as expected. IRIS versions starting with 2020.1 are affected. As a workaround, add the host variable to the Method's PublicList list and "new" them so the embedded query has access to them.

6 1
0 319

Diabetes can be discovered from some parameters well known to the medical community. In this way, in order to help the medical community and computerized systems, especially AI, the National Institute of Diabetes and Digestive and Kidney Diseases published a very useful dataset for training ML algorithms in the detection/prediction of diabetes. This publication can be found on the largest and best known data repository for ML, Kaggle at https://www.kaggle.com/datasets/mathchi/diabetes-data-set.

6 1
1 290

Hi,

I need to do a DELETE and then do some INSERT transactions on a linked table and don't want the DELETE and need to be able to ROLLBACK the DELETE if any of the INSERT transactions fail.
I have tried Object Script transaction processing (TSTART, TCOMMIT and TROLLBACK) and the SQL transaction processing (START TRANSACTION, COMMIT and ROLLBACK), but neither work.
Could I be doing something wrong in the way I am implementing these, or do does transaction processing simply not work for linked table?

Thanks for any advices, in advance.

Neil

0 1
0 179