SQL

Syndicate content 29 

Hi,

I've a Service utilising the Adapter EnsLib.SQL.InboundAdapter, which uses a Credentials item set with the details of a local SQL account. This currently works, however, we're looking to use the credentials of an AD domain account.

The domain account is a member of an AD security group, which has the required permissions on the source SQL database. I've checked that access is possible with this account via SQL studio.

Last answer 3 days ago
+ 1   0 3
0

comments

21

views

+ 1

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. 

Last answer 6 September 2019
+ 2   0 4
0

comments

130

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 5 September 2019 Last comment 5 September 2019
0   0 3
44

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:

Last comment 5 September 2019
0   0 2
0

answers

90

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 3 September 2019
+ 1   2 1
71

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

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

110

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

133

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

74

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
249

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
71

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

208

views

+ 5

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
138

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
150

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
109

views

0

rating

Say I have a property in  a persistent class that stores list of colours and I would like to query that field and return  a list and be able to loop that list to get individual colours how will l go about achieving this I have tried something like this but its not working as expected

 

 

 &sql(SELECT colour INTO :colourList FROM favouritecolours)
 While (SQLCODE = 0) 
{
 for i=1:1:$LENGTH($P(colourList,","))
 {
 set fvalue=$P(colourList,",",i) 
write "the first"_fvalue,i, 
} 
}

 

 

0   0 1
0

comments

135

views

0

rating

Hi everyone,

Im new  in cache, i came from Java and im missing some features that i couldn't find in the documentation,  I hope you can help me with this questions.

Just a brief introducction: 

- Im in a project with old cache version, so saddly i can't use Eclipse + Atelier, so im using Studio.

- Currently im in a project with persistent classes, we want to turn apart the globals and focus on tables. 

The questions:

Last answer 21 May 2019 Last comment 21 May 2019
0   0 5
206

views

0

rating

Hi All,

I have two tables LB_TestSet and LB_Transfer

LB_Transfer has a list if TestSet row IDs, so i am doing the following join

SELECT 
LBTS_RowID,
,LBTS_CollectedDate
FROM SQLUser.LB_TestSet 
JOIN SQLUser.LB_Transfer ON ($LISTBUILD(LBTS_RowID) %INLIST LBTR_TestSetList)
WHERE LBTS_CollectedDate BETWEEN '2019-01-01' AND  '2019-05-10'

 

Without the date filter the query returns data, but if i add the date filter no data is returned

I also tried using %INTERNAL, %EXTERNAL TO_DATE('2009-01-01','YYYY-MM-DD')

Last answer 21 May 2019
0   0 3
0

comments

176

views

0

rating

Hi! I've been fiddling with linked tables to get data from other servers, and I encountered a problem that I'm curious about. Maybe I'm not using these tools as intended or there's more going on, so I'm asking here.

I'm running a query on linked table A, something simple like this:

select name from A where id = 5983658923646

And I get this error:

[SQLCODE: <-400>:<Fatal error occurred>]

  [%msg: <>]

Last answer 8 May 2019 Last comment 10 May 2019
0   0 3
116

views

0

rating