SQL

Syndicate content 29 

Mark All as Read

I have several BPL's that act like SQL Server Integration Services (SSIS) where they are transferring data. When I do this they are all being written under 1 session id, is it possible to make the BPL create multiple session ID's as it is cycling through a Snapshot, so it is easier to read in the trace?

Thanks

Scott Roth

Last answer 9 March 2018 Last comment 9 March 2018
0   0 3
272

views

0

rating

Date range queries going too slow for you?  SQL Performance got you down?  I have one weird trick that might just help you out! (SQL Developers hate this!)*

If you have a class that records timestamps when the data is added, then that data will be in sequence with your IDKEY values - that is, TimeStamp< TimeStampif and only if ID1 < IDfor all IDs and TimeStamp values in table - then you can use this knowledge to increase performance for queries against TimeStamp ranges.  Consider the following table:

Last comment 10 days ago
+ 16   1 10
6500

views

+ 16

rating

hi,

i have two where-clauses:

a)  ... WHERE company=1 and product=7

b)  ... WHERE product=7 and company=1 

with other words the position of the where fields are swapped.

now the question is:

bring the where clauses a) and b) the same performance(queryplan) or do i have to write it in a special order???

in my point of view, there is a  parser/optimizer who cares about this, so i don't have to care about. 

+ 2   0 4
0

comments

119

views

+ 2

rating

Hello,

I have a small SQL question.  

Running an example queries in our Samples Namespace: 

1. select top 5 Description,Category from Cinema.Film order by Category - runs fine no issues and returns 2 columns as expected

2. select top 5 * from Cinema.Film order by Category - runs fine no issues and returns 8 columns as expected

3. select top 5 Description,Category,* from Cinema.Film order by ID - runs fine no issues, and returns 10 columns, with my first 2 repeated

4. When I try to combine the first 2 queries: 

Last answer 11 days ago Last comment 11 days ago
0   0 3
43

views

0

rating

Hi, I have used CSP to exec SQL selects from  any own NAMESPACE. But in our servers we have many SQL GATEWAY CONNECTIONS.

I'd like to create a CSP page that could use these gateway to exec SQL using these gateway connections, only Administrators will use that page to launch many select at many dsn. I'm not sure if we must deploy that CSP on %SYS namespace and how to use DSN(SQL Gateway connections) that are defined on server.

Anoyone has made that?

For example:

DSN CLIENT ONE

DSN CLIENT ONE

 

CSP Webpage:

TEXTBOX: Introduce your select:

0   0 2
0

answers

87

views

0

rating

Hi, I’m trying to setup a Business Operation where the Property is a drop down list of Strings.  I was able to produce the desired effect but only using a hard coded list like Property LookupProp As %String(VALUELIST = ",value1,value2").  Instead I would like i

Last answer 30 August 2019 Last comment 13 days ago
+ 1   2 1
68

views

+ 1

rating

Our team is reworking an application to use REST services that use the same database as our current ZEN application. One of the new REST endpoints uses a query that ran very slowly when first implemented. After some analysis, we found that an index on one of the fields in the table greatly improved performance (a query that took 35 seconds was now taking a fraction of a second).

Last comment 23 August 2019
+ 3   0 2
77

views

+ 3

rating

The newer dynamic SQL classes (%SQL.Statement and %StatementResult) perform better than %ResultSet, but I did not adopt them for some time because I had learned how to use %ResultSet. Finally, I made a cheat sheet, which I find useful when writing new code or rewriting old code. I thought other people might find it useful.

First, here is a somewhat more verbose adaptation of my cheat sheet:

Last comment 15 August 2019
+ 7   2 13
1432

views

+ 7

rating

An exciting position has arisen for a Junior Application Support Analyst in an established support team at CDS Computer Design Systems Ltd  CDS is an independent SME, based near Manchester City Centre, specialising in the Oil and Gas distribution software market for over 45 years with strong ties throughout the industry https:

0   0 1
0

comments

103

views

0

rating

An exciting position has arisen for an Application Support Analyst 3rd Line, in an established support team at CDS Computer Design Systems Ltd.  CDS is an independent SME, based near Manchester City Centre (United Kingdom) specialising in the Oil and Gas distribution software market for over 45 years with strong ties throughout the industry - https://www.codas.com

0   0 1
0

comments

130

views

0

rating

I've setup ODBC connection so I can access Cache data within SQL Server.

I want to be able to write SQL queries for internal monitoring purposes, similar to what's possible with SQL Server.  Specifically I want to be able to check mirroring status (i.e. check which is the current primary mirror member), check the status of any Ensemble productions (started/stopped), check the status of business hosts etc.  I want to do all of this from SQL Server to go with our other system monitoring solutions.

Last answer 1 August 2019
0   0 1
0

comments

71

views

0

rating

Hello community! I have to work with queries using all kinds of methods like embedded sql and class queries. But my favorite is dynamic sql, simply because of how easy it is to manipulate them at runtime. The downside to writing a lot of these is the maintenance of the code and interacting with the output in a meaningful way.

Last comment 29 July 2019
+ 6   1 4
245

views

+ 6

rating

I'm having trouble accessing the snapshots  EnsLib.SQL.Snapshot in %Library.ListOfObjects that are returned from method ExecuteProcedure in EnsLib.SQL.OutboundAdapter.  The Microsoft SQL stored procedure I am executing returns multiple resultsets.

The issue I am having is that my code works fine when executed in the business operation (commented out in the code below) but when it is executed in the business process it errors.  Any ideas as to why this happens?  The error I get is:

Last answer 16 July 2019 Last comment 17 July 2019
0   0 1
69

views

0

rating

When I start talking about InterSystems IRIS with more technically-minded people I always talk about how at the root of things it is a multimodel DBMS.

In my opinion that is the main advantage (on the DBMS side).

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? Think again. Use globals!

And the data is stored only once. You just choose the way you want to access it.

On the first overview it's a nice story - short and concise and it gets the message across, but when people really start working with InterSystems IRIS the questions start.

How are classes and tables and globals related? What are they to each other? How's data really stored?

In this article I would try to answer these questions and explain what's really going on.

+ 5   1 1
0

comments

205

views

+ 5

rating

The select query here "select Settings from Ens_Config.Item" in the SQL Query of management portal returns this: 

ValidationHost 7ActOnTransformErrorHost1 ReplyCodeActionsHostE=D AlertOnErrorHost1 9 AlertGroupsHost$LabAlertGroup,1-CriticalAlertGroup BusinessPartnerHost

How do I isolate just one of the settings e.g. ReplyCodeActions or LocalInterface

For example, i want to search for all entries that have  a value for ReplyCodeActions

I realize i can open the production in studio and search for those setting values.

 

 

 

Last answer 12 November 2016 Last comment 8 July 2019
0   0 2
365

views

0

rating

Hi guys!

As you know there are two (at least) ways to get the stored value of the property of InterSystems IRIS class if you know the ID of an instance (or a record).

1. Get it by as a property of an instance with "Object access":

ClassMethod GetPropertyForID(stId As %Integer) As %String

{

set obj=..%OpenId(stId)

return obj.StringData

}

2. Get it as a value of a column of the record with "SQL access":

Last answer 29 June 2019 Last comment 6 July 2019
0   0 4
136

views

0

rating

Hello,

When i click on the menu to  run the  Data import wizard  from MP, i receive following CSP error

<UNDEFINED>zOnPageHEAD+229^%cspapp.exp.utilsqleximwizardcontent.1 *schemaname : CSP Error

 

It is happening for all the namespaces. Looks like some permission issue.  Same issue with Data Export wizard. Help to resolve this will be appreciated.

I am using

Cache for Windows (x86-64) 2017.2.2 (Build 865_0_18763U)

Thanks,

Jimmy Christian.

Last answer 28 June 2019 Last comment 12 April 2019
0   0 2
81

views

0

rating

I have a custom process that is parsing HL7 and inserting it into a table. Periodically the inserts fail with # due to error: ERROR #5803: Failed to acquire exclusive lock on instance of.... 

Traditional databases would wait until the lock is removed then do the insert, but cache fails. I'm sure it's my coding approach.

How can I work around this? A Try/Catch loop?

Thanks in advance.

Last answer 6 June 2019 Last comment 6 June 2019
0   0 4
147

views

0

rating

Hello all,

I have a Recordset object  which contains data from a table "XYZ". 

Currently i use this object to extract data using  %Get(COL1,COL2...) in a loop and than pass it to a function which inserts the data into another dynamically created  Table "ABC"  for each record. This takes a lot of time when 100's of records.

Is there a way i can directly copy a RecordSet to a dynamic table without looping through..?

Something like copy Recordset (COL1,COL2..)--> "ABC"

Thanks,

Jimmy

Last answer 3 June 2019 Last comment 3 June 2019
0   0 2
107

views

0

rating