Question
· Feb 20, 2020
Sql request

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

0 5
0 253
Question
· Jan 6, 2020
ODBC Providers for SQL Server

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?)

0 4
0 1.6K

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

1 3
0 284
Question
· Feb 28, 2020
How to get a Numbers View

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!

0 3
0 280
Question
· Mar 1, 2020
SQL Inbound Adapter Errors

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'"

0 1
0 286
Article
· Mar 2, 2020 2m read
SQL -99 error while viewing a listing

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.

1 0
0 803
Question
· Feb 28, 2020
SQLCODE Error -400

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.

0 2
0 1.6K

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.

https://5e18edf067eb59-03854285.castos.com/player/153376
[This is an embedded link, but you cannot view embedded content directly on the site because you have declined the cookies necessary to access it. To view embedded content, you would need to accept all cookies in your Cookies Settings]

1 0
0 203

Hi Developers,

Enjoy watching the new video on InterSystems Developers YouTube:

SQL Performance: Need for Speed

https://www.youtube.com/embed/ASO_OG1xxgc
[This is an embedded link, but you cannot view embedded content directly on the site because you have declined the cookies necessary to access it. To view embedded content, you would need to accept all cookies in your Cookies Settings]

1 0
1 298
Announcement
· Feb 13, 2020
Class Queries

Class Queries in InterSystems IRIS (and Cache, Ensemble, HealthShare) is a useful tool that separates SQL queries from Object Script code. Basically, it works like this: suppose that you want to use the same SQL query with different arguments in several different places.In this case you can avoid code duplication by declaring the query body as a class query and then calling this query by name.

0 6
0 581

I'm using Cache SQL and want the ability to choose a specific index.

I've boiled the problem down to one table and simplified the query down to

SELECT *
FROM Registration.PatResp
WHERE SchedApptNum=8450022

SchedApptNum is indexed, but instead of using that column, "Show Plan" indicates that it's looping through the entire Registration.PatResp table on Id (the primary key for the table).

I've done a tune-table with no change.

0 6
0 881

Hi,

we're planning some work on our SQL Query Plan functionality for a future release of InterSystems IRIS and are interested to hear how you're using them today, or what'd keep you from using them. Rather than try and fit everything in a rigid survey, I thought a simple thread on our beloved DC might also reveal some use patterns that we support or could do a better job on.

3 7
0 282

A quick question regarding to SQL Query Plan:
Why these two requests have different plans, in particularly, why second request needs temp file? To me, temp file is a bad thing which should be avoided, right?

  1. select * from Test.Log where cdate = 1
  2. select * from Test.Log where cdate > 1

Plan for 1:

Read index map Test.Log.cdateIndex, using the given %SQLUPPER(cdate), and looping on ID.
For each row:
Read master map Test.Log.IDKEY, using the given idkey value.
Output the row.

Plan for 2:

0 4
0 222

Ok so I am way outside of my comfort zone, and had to build an application using CSP to give users the ability to access SQL configuration tables. These SQL Configuration tables will affect the data that is sent to the downstream system.

I saw in the examples where we were able to import GIF's/IMAGES into the CSP folders to use as a reference in our CSP pages. My question is how do you do that? If I try to import through studio, it tells me the file is invalid.

Just trying to make it a little more user friendly then blocks on a page.

0 1
0 805

Hi All,

We have few queries which are simple selects . For simplicity let's say there is a query that joins two tables and gets few columns and both tables have no indexes.

Select Tab1.Field1, Tab2.Field2
From Table1 Tab1
Join Table2 Tab2
On Tab2.FK = Tab1.PK

When we do query plan for this it shows approx 6 million, however if we make a simple adjustment to the query

0 5
0 243

cache 2017.2.1 (Build 801_3)

when I look into the "sql statements" ( sql page of the management portal ) I have lots of old statements with a lot of them frozen. many of them are %sqlcq routines (I believe these are the SLQ's I run when testing/running random SQL queries in the sql page. )

I can clearly see where I can click on an individual query and untick an individual query to unfreeze it. or delete it. but thats a painful slow process. I can't see anywhere to delete/change multiple queries

0 2
0 211

I am working on a BPL to take data from a MS SQL database and create an HL7 Materials Message for our EMR. I have done this plenty of times in the past however I am running into an error.

"Remote Gateway Error: JDBC Gateway SP execute(0) error 0: Access to the remote server is denied because no login-mapping exists."

What is confusing is that this BPL doesn't differ from any of my other BPLs in connecting to MS SQL Server. I know I am missing something..

0 3
0 594

I have a case where I have an external table that lives out in MS SQL. Using Ensemble Security functions has anyone created a csp or cls page that acts like a portal to allow users to Update a multidimensional table without knowing SQL? I could clone the EnsPortal.LookupSettings but that was made for LUT which are only 2 columns.

I know its a long shot but trying to see if there was anything off the shelf that I can use to help meet the requirements of this project.

1 4
0 211

What is %SQLRESTRICT

%SQLRESTRICT is a special %FILTER clause for use in MDX queries in InterSystems IRIS Business Intelligence. Since this function begins with %, it means this is a special MDX extension created by InterSystems. It allows users to insert an SQL statement that will be used to restrict the returned records in the MDX Result Set. This SQL statement must return a set of Source Record IDs to limit the results by. Please see the documentation for more information.

Why is this useful?

This is useful because there are often times users want to restrict the results in their MDX Result Set based on information that is not in their cubes. It may be the case that this information may not make sense to be in the cube. Other times this can be useful when there is a large set of values you want to restrict. As mentioned before, this is not a standard MDX function, it was created by InterSystems to handle cases were queries were not performing well or cases that were not easily solved by existing functions.

6 0
1 544