I noticed that the subscript of the index map is actually the collated field (%SQLUPPER).
Is String the only data type going through this transformation? Any other data type would also go through this transformation?
Thanks.
SQL is a standard language for storing, manipulating and retrieving data in relational databases.
I noticed that the subscript of the index map is actually the collated field (%SQLUPPER).
Is String the only data type going through this transformation? Any other data type would also go through this transformation?
Thanks.
I'm trying to learn how To use SQL in CACHE, so I hope I don't bore you with "Dumb" questions....
I'm getting "ERROR #6022: Gateway failed" message following this line of code.
s sc=gc.Prepare(hstmt,pQuery)
This line of code comes from an example I found in the documentation. pQuery is the "Select" statement setting up the variables and tables I'm trying to pull information from.
What does that error indicate?
Thank you.
Hi, I am trying to execute a store procedure within an ensemble operation to connect to aMsSQL database and I am having problem to pass the input arguments... I have tried several things but only one seems to work and it is not the ideal solution.
This is the code that works...as you can see the parameter is added to the sql query...not the best solution but the only that works at the moment.
My question is actually about IDKEY since Primary Key is the common concept of SQL.
Why do we need IDKEY? In what kind of scenario, the IDKEY would be different from Primary Key?
Thanks.
This might be more of a math problem than a Caché question.
I have a SQL query that joins two tables. I want to assign a unique ID to each row of the product table.
What's the chance of collision if I append the GUIDs and truncate the result to 50 characters? Is there a good way to solve this without updating the clients?
Last week, we announced the InterSystems IRIS Data Platform, our new and comprehensive platform for all your data endeavours, whether transactional, analytics or both. We've included many of the features our customers know and loved from Caché and Ensemble, but in this article we'll shed a little more light on one of the new capabilities of the platform: SQL Sharding, a powerful new feature in our scalability story.
Hi,
My doubt is about the SQL Query in Caché:
I don't want to take all results from the table and orgainze them manually, for example: I have a table with 50 records, but I only want to select 10 records, being from tenth until the twentieth and this without knowing their IDs.
So, how can I do this, without losing performance, there is any way?
NOTE: In other SQL languages I can do, for example, SELECT * FROM extbl Limit 10 OFFSET 10
Thanks,
Andrei L. Nenevê
Just wondering which table holds detail for SQL Gateway Connections.
I'm trying to create an sal connections from one cache system to another. I've created the connection part and I think that is working. When trying to link a table through the link table wizard, I'm getting an error "<MAXSTRING>
Is this due to my global block size in the new system not being large enough? It is currently set at 8192.
Thank you
Mike
Hi -
I'm creating a custom report in Health Insight via SQL and one of the requirements says that I must include patients who are >= 13 years old (which is easy) but I also need to include patients who WILL be 13 years old as of December 31st of current year that the report is ran in.
I see that there is an Age column and an AgeInMonths column in HSAA.Patient. and of course a DOB column. I'm wondering if it is possible to do this purely using SQL (and SQL functions) or if I will have to incorporate a COS function to achieve this requirement.
Any suggestions?
Thanks,
Blake
select * from A left join B on A.x = B.x inner join C on B.y = C.y
does Cache SQL treat the join path: LEFT_JOIN(A,INNER_JOIN(B.C)) also a valid candidate path?
Thanks.
Hi, I'm a student, weak programming. I ask for your help, I write a program in C #, there are two tables, but I do not understand how to organize the connection between them many to many. Table in DataGridView1 from DataSet1 on Form1 key connection in DataGridView1 from DataSet1 to Form3
I do this on Form1
Hi,
I'm trying to use the IN operator in SQL.
does not work, can anyone tell me why that could be?
for example:
SELECT * FROM TafnitCore_Logistics_TransferPackage_DB.PackageData WHERE ID IN ('1||1||9852553062' , '1||1||9852553061' ) ORDER BY Building
And I get the following error:
We have 1lakh records in table and while using sql select statement , it is taking more than 9mins to 12 mins to get the records. could you please how to optimize this performance issue if we have more records. how to optimize it.
Does anyone know how to return the sys.process table with the corresponding configname item for each process? Also, is there a key for the Job Type field?
I have a query that I am attempting to run, but inner query is being rolled up into the overall query - per the optimizer (and jobexam observation). While I know that if the inner query runs first, I will eliminate a number of records (making the result set smaller, and return quicker).
Just an example of what I am attempting to do:
Any suggestions on the most efficient way to convert yyyymmdd string to mm/dd/yyyy?
I have a Cache-compatible sql script file and each query is separate by white space.
How could I ask Cache to execute all the queries in this file and dump the result to a specified file?
Thanks.
Hello All,
what is the best method for search a portion of text in a non-indexed global?
I need to implement an autocomplete kind of search, in a global of >1M registers (text type, not $lb)
Maybe the best way would be use a SQL mapped class, with 'Bitmap' indexes?
Thanks in advance!
I get two methods below: I would run both methods concurrently.
However, the "testRead" would always read the uncommitted results from "testInsert".
Anyway to avoid that? Thanks.
ClassMethod testInsert()
{
&sql(START TRANSACTION ISOLATION LEVEL READ COMMITTED, READ WRITE)
&sql(insert into Test.Table(AttrA,AttrB,AttrC,AttrD) values(1,2,3,4))
hang 15
&sql(ROLLBACK)
}
ClassMethod testRead()
{
&sql(START TRANSACTION ISOLATION LEVEL READ COMMITTED)
&sql(select count(*) into :ans from Test.Table)
&sql(COMMIT)
w !,ans
}I am trying to replace one of our SQL Integration Service jobs with Ensemble and I am running into an issue executing a query against a MS SQL database using JDBC drivers.
My SQL Outbound code looks like this.
The Art of Mapping Globals to Classes (3 of 3)
If you are looking to breathe new life into an old MUMPS application follow these steps to map your globals to classes and expose all that beautiful data to Objects and SQL.
If the above does not sound familiar to you please start at the beginning with the following:
This example is going to show you how to map a classic parent-child structure.
So just this morning we started to get this error from all of our SQL-client based tools that connect to our Caché SQL via ODBC:
[%msg: <Error instantiating cached query class in Prepare(): <METHOD DOES NOT EXIST>Prepare+41^%SYS.SQLSRV *%New,%sqlcq>] (State:S1000, Native Code: 190)]
No queries work... any help? stumped over here.
Greetings to all!!!Suppose there is a table Mother (ID, Name) and Child (ID, Name, Mother), Mother in the table Childis a relationship.Let's say the task is to deduce the names of all the children whose their moms' names start with the letter 'A', I can do this in two ways in sql, and I can not understand the difference, the pros and cons that when to use:
1) SELECT Child.Name FROM Mother INNER JOIN Child ON Mother.ID = Child.Mother WHERE Mother.Name LIKE 'A%'
2) SELECT Child.Name FROM Child WHERE Child.Mother->Name LIKE 'A%'
Hi,
I have a class with around 400k lines and 60 columns. Class storage is Cache SQL storage (Mapped from a global).
I want to create multiple indices on certain fields.
I am familiar with two approaches:
1. Create a new map (Index type) on a pointer global.
2. Create a bitmap index
Which approach is more recommended to be used in the case I described? If there are any other approaches, I will be happy to hear.
Thanks :)
Hi World
I've a problem when in extract a float value from my database
the problem is that i get an interger instead of float.
my record is 2,56 but when i do a select , the request extract only 2
can you have a solution for it.
thank you
HI,
I have a query like below but its syntax is not accepted by Cache.
I would like to perform a left join on two tables first and then make a inner for this result with another table.
Given the constraint that we only allow one SELECT in the query, it is possible to achieve this semantics ?
Thank for your help.
Select *
FROM ( sample . employee e
LEFT JOIN sample . company c
on c . id = e . id ) g
JOIN sample . vendor v
on v . %id = g . attr
I am pleased to announce that Release Candidates of Caché and Ensemble 2017.2 are now available.
Many customers have already downloaded the Field Test over the past few months, and we appreciate your feedback.
This release contains significant improvements, including:
I have a class that has a list property, which contains a list of other objects, and I want to join against it in SQL.
Class Foo Extends %Persistent
{
Property MyBars As list Of Bar;
}Class Bar Extends %Persistent { Property Name As %String; }
Simply querying the Foo table, I see that MyBars looks like a $LIST, so I tried using a query with the %inlist operator but that didn't seem to work as expected. The following query produces zero results:
select bar.name from foo join bar on bar.id %INLIST MyBars
Hi, folks!
Is there any way to use $CASE or $SELECT functionality in SQL SELECT query?
E.g. something like this:
SELECT product, $CASE(status,"New":field1,"Payed":field2) as data from sales
To see either in data column either field1 or field2 values in regard of status value.