Benjamin De Boe · Jun 8, 2020 go to post

You can force embedded SQL to be compiled along with the embedding application code using a compile flag /compileembedded=1. This is not recommended though, so we'd really like to know more about why the current model doesn't suit you. In fact this first-run compiling would allow your customers to leverage the statistics for their data rather than what you baked into it when compiling the embedded SQL. See also this article.

Benjamin De Boe · May 24, 2020 go to post

Access Denied errors can stem from a variety of reasons. As a sanity check, running the windows ODBC connection manager's test function never hurts to rule out connectivity issues. By any means, you can consult with the WRC on support issues like this.

Benjamin De Boe · May 20, 2020 go to post

For more about where the source code for embedded SQL has gone in 2020.1, please see this article on the Universal Query Cache

Indeed funny the doc doesn't call out table names while it does talk about field names, probably because it silently assumes the one implies the other. I'll ask our doc writer to fix that. Thanks for the notification.

Benjamin De Boe · May 11, 2020 go to post

Depends on how you're set up. There is a setting to allow specifying those values that is meant for this type of bulk load scenario.

@Daniel Buxton : the multi-row insert syntax you're asking about is currently not supported by IRIS SQL (as you figured by now :-)). Robert's approach using UNION all is a creative workaround, but depending on where your big INSERT is coming from you might also just be able to generate / rewrite it into separate INSERTs? Once you have that in place, you can use the SQL Shell's RUN command or the ObjectScript $SYSTEM.SQL.DDLImport() method to execute your script file.

Benjamin De Boe · Apr 27, 2020 go to post

I don't want to discourage creativity, but this approach feels very risky to me. When you issue any SQL against this table before setting the % variable, it's going to cause ugly errors or unpredictable behaviour. I also wouldn't bet my money on this working in all possible parallel query execution scenarios (likely some, likely not all).

FWIW, within InterSystems development, we typically call % variables that survive between method calls a leak rather than single-rivet-keeping-your-skyscraper-together :-). Again, apologies for putting it a little strong here, but I think most use cases asking for flexibility can be addressed with more robust solutions, such as temporary tables, class inheritance (with the NoExtent keyword), etc. 

Benjamin De Boe · Apr 27, 2020 go to post

If you need a programmatic entry point for dealing with complex filter conditions, take a look at %SQL.AbstractFind. It allows you to invoke ObjectScript code to populate bitmaps based on (any number of) user-provided arguments through a %FIND predicate. It is built on by iFind and this older (but worthwhile) community article on custom spatial indices, although in both cases it works hand-in-hand with a custom index (using %FunctionalIndex). That isn't required, but usually the flip side of the same use case coin.

Benjamin De Boe · Apr 22, 2020 go to post

Hi Hansel,

at Global Summit 2019, we already showed some early prototypes of our forthcoming System Alerting and Monitoring tool that also leverages Prometheus and Grafana to monitor your IRIS deployments (recording is here). It's still a few weeks away, but this Tech Talk will discuss this subject in more detail.

Thanks,
benjamin

Benjamin De Boe · Apr 15, 2020 go to post

coming late to the party, but just as a small and likely irrelevant note: if you use a PPG for storage and at some point (because the table appears big) the query optimizer thinks it's worth using parallel query execution, it won't see a thing in those worker processes. You should be able to avoid that using the %NOPARALLEL keyword though.

Benjamin De Boe · Mar 15, 2020 go to post

In addition to Eduard's response: sharding is a feature of our SQL / Objects layer. Raw globals are at a level below what we'd need for hooking in the workload distribution you're referring to.

Benjamin De Boe · Mar 15, 2020 go to post

indeed, system schemas (whose name starts with a % sign) require certain privileges (that you quickly get used to once you have them :-) ). That's why I suggested querying the INFORMATION_SCHEMA

Benjamin De Boe · Mar 13, 2020 go to post

and if you prefer something more database-independent, you can use the standard INFORMATION_SCHEMA package:

SELECT TABLE_SCHEMA, TABLE_NAME, COLUMN_NAME FROM INFORMATION_SCHEMA.COLUMNS WHERE COLUMN_NAME LIKE 'PATID%'
Benjamin De Boe · Mar 11, 2020 go to post

FWIW, you can just put as many conditions as you want in the same SQL query. InterSystems IRIS includes an excellent SQL optimizer that will consider all the conditions (and other clauses) in your query and decide on the most efficient path to access the data.

Benjamin De Boe · Mar 9, 2020 go to post

Indeed, that's the recommended SQL way of achieving what Eduard described about PPGs. Drawbacks are that queries on these tables cannot be parallelized (as that implies multiple processes, of course).

Our TSQL support is meant for Sybase customers wishing to redeploy their TSQL applications on IRIS (especially now that SAP/Sybase is terminating support for those platforms). Just temporary table support by itself wouldn't be a reason to start building TSQL applications and abandon IRIS SQL/ObjectScript, of course :-). However, for a recent TSQL migration we did some work on our TSQL temp table support and were considering to roll that out to regular IRIS SQL, so this thread is a good place to share your experiences and requirements so we can make sure to do that properly, as needed. yes

Benjamin De Boe · Feb 20, 2020 go to post

Hi Darko,

LONGVARCHAR is actually storing the text as a stream, so to make LIKE work, you'll need to convert it to a string, e.g. using SUBSTRING(), in the expression you're serving to the LIKE operator. The following works fine for me:

SELECT SUBSTRING(text, 1, 999999) FROM table WHERE SUBSTRING(text, 1, 9999999) LIKE '%abc%'

This looks a little clumsy, but streams are really meant for huge data that wouldn't fit in a VARCHAR. Note that you can get a massive amount of text in VARCHAR (%String) columns these days, so maybe that's worth considering.

Separately, when working with iFind, that'll provide faster search results and it also transparently takes care of the stream aspect.

Benjamin De Boe · Feb 6, 2020 go to post

I didn't mind being lured into reading this excellent article, but the concept of "DataOps" is entirely different from what's being discussed here :-)

You could also add the failed Ariana V  501 launch as an example of a case where conversion between units / data types caused somewhat costly trouble

Benjamin De Boe · Feb 2, 2020 go to post

Hi Conor,

We added a "cancel" button to the SMP in IRIS 2019.3 and are looking at an equally convenient mechanism from the shell. 

Benjamin De Boe · Jan 2, 2020 go to post

That's what POSIXTIME does for you under the hood, so no need to require all your queries to be aware of this frugal innovation ;-)

Benjamin De Boe · Jan 2, 2020 go to post

In addition to the suggestions made earlier (to provide more context such as full query & plan), you may also want to consider POSIXTIME as the data type for your date / time columns. It encodes dates as a simple 64-bit integer, which makes for efficient storage, indices and queries.

Benjamin De Boe · Jan 2, 2020 go to post

Could you share the rest of the error message (hidden behind the alert) and more specifics on the ODBC connection type?

And is there anything special about these tables or do you get this for each and every table?

Benjamin De Boe · Nov 29, 2019 go to post

No, we indeed don't support that syntax feature. Like Evgeny said, this recursion is something we'd typically try to wrap inside ObjectScript methods, which you could then expose as a stored procedure.

Benjamin De Boe · Nov 29, 2019 go to post

Besides the elaborate earlier answers about the actual interfaces under (or at) the hood, maybe a simple question to ask is which version you're on. If I'm not mistaking, that SELECT option was only added some 5 years ago and because the word "legacy" shows up on this page, I thought it's worth checking too ;-)

Benjamin De Boe · Oct 28, 2019 go to post

We're working on support for OVER syntax (as part of SQL window functions) for a future release of IRIS. Feel free to reach out to me directly with more details on the specific requirements you have to see if they correspond to the feature set currently in the pipeline.

Benjamin De Boe · Oct 3, 2019 go to post

If you know which non-NoExtent (for lack of a YesExtent keyword :-) ) subclass of A you're targeting in B's subclass, you can override your property definition pointing to that subclass.

Benjamin De Boe · Sep 13, 2019 go to post

The Jupyter support is very exciting, adding a neat and highly appropriate mechanism for exposing IRIS-side concepts to a typical Python environment (Jupyter). This release is introducing a first taste of such an interaction, but we're very interested in learning from your experiences and ideas on making this even more effective at adding process control to your Python work. yes

Benjamin De Boe · Sep 6, 2019 go to post

InterSystems IRIS (and Caché before that) will indeed make this decision for you. The SQL optimizer will analyze all the conditions in your query and select the best query plan based on the available table statistics, which includes column selectivity. See also this article on collecting those stats with the TuneTable command.

As a matter of fact, our development team is making some exciting enhancements to the cost functions used to turn those table statistics into the actual cost estimates for the possible query plans. More about that at our upcoming Global Summit!

Benjamin De Boe · Aug 28, 2019 go to post

Thanks for sharing Dave, great article!

As this is an area we'd like to develop further on the product end, we're very eager to hear customers' experiences and feedback on this.