9 Followers · 1.1K Posts

SQL is a standard language for storing, manipulating and retrieving data in relational databases.

Question Eduard Lebedyuk · Apr 1, 2020

During runtime I build an object which is essentially a wrapper over in-memory table:

col1 ... colN
val11 ... valN1
val12 ... valN2

I want to use this object as a part of INSERT or UPDATE queries, based on a value of some column (the main use case one of the columns is an ID value)

What's the best way to expose the object to SQL?

I have complete control over object class, so if I need  to add something (or even change runtime internals), it's no problem.

Object may have different columns depending on runtime situation, but during one query execution the fields are constant.

13
0 791
Article Eduard Lebedyuk · Jul 16, 2019 4m read

When I describe InterSystems IRIS to more technically-minded people, I always start with how it is a multimodel DBMS at its core.

In my opinion that is its main advantage (on the DBMS side). And the data is stored only once. You just choose the access API you want to use.

  • You want some sort of summary for your data? Use SQL!
  • Do you want to work extensively with one record? Use objects!
  • Want to access or set one value and you know the key? Use globals!
1
5 1681
Question Florian Hansmann · Apr 22, 2020

Hey Community,

my Caché Version: 2013.1 and can't update now.

is it possible to highlight SQL Statements like in embedded SQL with all the features from SQL Statements?

Actually I use SQL Statements with a simple string like:

set myquery = "SELECT TOP 5 Name,DOB AS bdate,FavoriteColors FROM Sample.Person"

But when the queries are more complex it will be very cluttered and unstructured.

It would be nicer if I could set line breaks (I know here could I use indexed variables) and have highlighting like in an embedded SQL:

&sql(
 SELECT TOP 5 Name,DOB AS bdate,FavoriteColors 
 FROM Sample.Person
)
2
0 348
Announcement Anastasia Dyubaylo · Apr 16, 2020

Hi Community,

We're pleased to invite you to join the upcoming InterSystems IRIS 2020.1 Tech Talk: Data Science, ML & Analytics on April 21st at 10:00 AM EDT!

In this first installment of InterSystems IRIS 2020.1 Tech Talks, we put the spotlight on data science, machine learning (ML), and analytics. InterSystems IntegratedMLTM brings automated machine learning to SQL developers. We'll show you how this technology supports feature engineering and chooses the most appropriate ML model for your data, all from the comfort of a SQL interface. We'll also talk about what's new in our open analytics offerings. Finally, we'll share some big news about InterSystems Reports, our "pixel-perfect" reporting option. See how you can now generate beautiful reports and export to PDF, Excel, or HTML.

 

2
1 499
Question Florian Hansmann · Apr 16, 2020

Hey Community,

my Caché Version is 2013.1 and I can't update now.

I want to serialize a SQL Answer row into an Array filled with objects and then convert it to json.

Actually I use the following, which is very error prone when I have to do that often:

7
0 849
Article Allyson Gerace · Feb 6, 2019 13m read

This is the first in a pair of articles on SQL indices.

Part 1 - Know your indices

What is an index, anyway?

Picture the last time you went to a library. Typically they have books sorted by subject matter (and then author and title), and each shelf has an end-plate with a code describing the subject of its books. If you wanted to collect books of a certain subject, instead of walking across every aisle and reading the inside cover of every book, you could head straight for the bookshelf labelled with your desired subject matter and choose your books.

2
6 2274
Question Mike Kadow · Jun 15, 2017

I am experimenting with Relationships, both Parent to Child and One to Many.

I have done some SQL look-ups and have searched through the documentation, however not in a lot detail, but wonder if there are more and better ways to access both sides of Relationships through SQL?

Thank you in advance for any help provided.

25
0 2369
Article Benjamin De Boe · Mar 25, 2020 5m read

InterSystems IRIS 2020.1 brings a broad set of improved and new capabilities to help build important applications. In addition to the many significant performance improvements accrued through 2019.1 and 2020.1, we are introducing one of our biggest changes in recent SQL history: the Universal Query Cache. This article provides more context on its impact to SQL-based applications at a technical level.

0
0 1053
Question Swathi Chilukuri · Mar 19, 2020

Hi ,

I have a code written in cache  sql and trying to understand it, below is the code , can anyone help me understand what does that mean 

ex - !! dosage_unit !!

SELECT (CASE WHEN (order_description IS NULL OR (order_description='')) THEN '' ELSE (order_description) END) !! (CASE WHEN (dosage IS NULL OR dosage_unit IS NULL OR (dosage='') OR (dosage_unit='')) THEN '' ELSE (', ' !! dosage !! ' ' !! dosage_unit !!

Thank You in advance.

12
0 353
Question Drew Holloway · Mar 12, 2020

Is there a way to query the database structure?  In SSMS there are queries for finding tables with a column with a certain name (using LIKE).  And there is the redgate tool SQL Search.  But I'm not sure how to go about looking for columns that have say a value of 'PATID' and returning all tables that match.  Does anyone know?

5
0 1800
Announcement Thomas Dyar · Mar 12, 2020

Greetings Developer Community!

InterSystems IntegratedML (formerly known as QuickML) is ready for external beta, and is looking for some users to kick the tires!

IntegratedML is an all-SQL machine learning (ML) feature in IRIS that:
    • Gives users the ability to create, train and deploy powerful models from simple SQL syntax
    • Wraps "best of breed" open source and proprietary ML and "automl" frameworks such as TensorFlow, XGBoost, H2O-3, and DataRobot
    • Focuses on ease of deployment, so you can add predictions to your application with a single SQL function call 

0
0 311
Question amine benchaou · Feb 20, 2020

Hi All,

I need to build a search using a lot of filters, what's the best way to implement my sql requests.

1 sql request per property, or only one "big" sql request ?

what's the disadvantage of using lot of indexes ?    Thank you

KR,

Amine

5
0 363
Question Ken Wenze · Jan 6, 2020

Where can i get the latest odbc providers from SQL Server 2012/2016?

I see some posts on line to  an ftp site out there but I am unsuccessful at getting access to it.  I have a version loaded on my server but get errors when querying cache'.

"[Cache ODBC][State : 22005][Native Code 22005]" 

Any help would be appreciated.

the one we have might be version  2014.01.05851  64 bit (would that make sense?)

4
0 1819
Question Drew Holloway · Feb 28, 2020

Let's say I start with a date range of '1-5-2019' to '5-25-2019' that occurs on one row.  I'd like to ultimately have this show as 5 rows in Crystal Reports as shown below

Result

1-5-2019  1-31-2019

2-1-2019 2-28-2019

3-1-2019 3-31-2019

4-1-2019 4-30-2019

5-1-2019 5-25-2019

I found a result that worked in T-SQL, but I'm not sure how to translate it to Cache SQL.  The T-SQL code is

select dateadd(d,N.number,d.begindate) adate, data
  from data d
  join Numbers N ON number between 0 and datediff(d, begindate, enddate)

3
0 435
Question Drew Holloway · Feb 28, 2020

In T-SQL, I can create a recursive CTE to create a subquery or a view that will hold a whole lot of numbers.  Is there a way to do this in Cache SQL?  I'd like the numbers from 0 to 10000 if possible. 

Thanks!

3
0 366
Question Yakov Berger · Mar 1, 2020

Hi,

I created a BS with a SQL Inbound Adapter.

Query = "SELECT rowid, fname ,lname,datesent  
                   FROM labs
                   WHERE datesent IS NOT  NULL"

DeleteQuery = " update labs set datesent  =  Getdate() where rowid = ?"

KeyFieldName = "rowid"

i am getting the following errors.

"NOT assuming network disconnect error based on: Gateway failed: DropStatement."

"Skipping previously errored row '235'"

"Assuming network disconnect error based on: SQLState: (HY000) NativeError: [0] Message: [Microsoft][SQL Server Native Client 11.0]Connection is busy with results for another command"

1
0 386
Article Peter Steiwer · Mar 2, 2020 2m read

This error is sometimes seen while viewing a listing in InterSystems IRIS Business Intelligence:
ERROR #5540: SQLCODE: -99 Message: User <USERNAME> is not privileged for the operation (4)  

As the error suggests, this is due to a permission error. To figure out which permissions are missing/needed, we can take a look at the SQL query that is generated. We will use a query from SAMPLES as an example.

0
0 1278
Question Larry Pinsky · Feb 28, 2020

I have a code block in a BPL.  I have the below SQL and code.  All variables have been declared and set.  When I run the SQL, if there are no values returned, I get 100 for the value of SQLCODE when I perform the FETCH, which is correct.  If values are returned, I get a -400 error when I perform the first FETCH.  I've investigated, but cannot find the reason for a -400 error.  Hoping someone out here understands this and knows what's wrong.

2
0 2090
Announcement Derek Robinson · Feb 26, 2020

In Episode 4 of Data Points, we welcome @Benjamin De Boe to the pod to discuss some of the things you can do to optimize your SQL queries in InterSystems IRIS. We've all heard — either from ourselves or from others — the "this runs too slowly" complaint. I thought Benjamin did a great job walking through many of the things within IRIS you can look at with your queries to see what can be improved.

0
0 266