I need to execute multiple DELETE statements in a single query like this

DELETE FROM TableName WHERE ID = 2;
DELETE FROM TableName WHERE ID = 3;
DELETE FROM TableName WHERE ID = 4;

However It does not work when there're more than 2 statements and gives me an error

Expected FROM found WHERE^DELETE FROM TableName WHERE

Using IN is not an option.

0 9
0 327

PORTUGUESE

Olá a todos!

Estou com dificuldades de fazer meu select para retornar palavras que contém acentos.

Na minha tabela TESTE, por exemplo, tenho palavras no campo NOME como Fábio e Fabio, porém se eu coloco a instrução:

SELECT * FROM TESTE
WHERE nome LIKE 'FÁBIO'

a instrução só traz FÁBIO.

Como eu faço para trazer todas as palavras: FÁBIO, FABIO, FABÍO, FABIÓ, FÁBÍÓ, FÂBIO, etc...

Conto com sua ajuda!

0 9
0 1.6K

Class ICT.Experiments.A Extends %Persistent
{
Property Name As %String;
Property Collection As list Of ICT.Experiments.B;
Property Collection2 As array Of ICT.Experiments.C;
}

Class ICT.Experiments.B Extends %Persistent
{
Property Name As %String;
}

Class ICT.Experiments.C Extends %Persistent
{
Property Name As %String;
}

I have the classes above and I can select columns from the array collection by using two joins as follows:

0 9
1 1.8K
Question
· Oct 30, 2019
SQL query index using

Hi guys,
I ran into a strange (for me) situation, when I run same query but change the WHERE clause the plan is different and is not connected to the additional condition.
Query that doesn't use the necessary index:

0 9
0 518
Question
· Jun 14, 2017
SQL Query for Range

Hello,

I have a question related to running an SQL query for range of data.

I am running a query like:

Select A,B from table_name where A>=12345 AND A<=12390

- Where A and B are my two of the properties under the mentioned table/class definition

- A is an integer property

Question: The result of the above query does not return me all the values between the mentioned range of integer though I do have all the values in that range. I see that some of the values are missing in result.

0 9
0 449

Hello everyone,

I am looking for the syntax or the way to use a class created in the "BNA" Namespace (my application) from the %SYS Namespace.

Here is the context:

I have a "BNA" application contained in the "BNA" NS, this application provides a user creation functionality. This feature creates both the user in a table in the application and in the Iris system.

0 9
0 229

Hi All,

I use SQL function JSON_OBJECT to get data as a JSON object.

However, sometimes I get error with function JSON_OBJECT when values contain [, ], { or }.

Error:

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

Unexpected error occurred in JSON_OBJECT() function execution of <JSON_OBJECT>.%FromJSON().Parsing error

For example,

Query: SELECT JSON_OBJECT('idSQL':id, 'content':content) FROM DocBook.block

0 9
0 1.3K
Question
· Apr 6, 2018
sql insert from cache

I am tasked with using CACHE to insert data retrieved from a CACHE data base and insert it into an sql database. The columns in the sql table that I am trying to insert data into have names that contain underscores such as "ACCESSION_DATE" I found a utility in CACHE to connect to the sql data base and perform inserts. I have the data I need to insert. I need to pass the data into the sql utility referencing the column names.

I tried using indirection to set the data into underscored variables, but that isn't allowed in cache object script.

0 8
0 1.3K

I have a serial object:

Class EmbedObj Extends %SerialObject

which is stored as a property of another object

Class ContainerObj Extends %Persistent

Property InnerObj As EmbedObj;

Property Foobar As %String;

Question:

From within the context of an instance of EmbedObj, how can I navigate to the containing instance of "ContainterObj" and find that value of its Foobar property?

0 8
0 617
Question
· Nov 19, 2017
Force inner select to be executed

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:

0 8
0 406
Question
· Apr 12, 2019
Timing of Database look up

We use a lot of external MS SQL calls to look up numerous things when it comes to HL7. I am running into an issue where the outbound calls are queued but the message is sent onto the next process before it gets a response. How do I get it to wait till the response gets back from the MS SQL call before sending it onto the next process?

Below is a screen shot of what I am trying to explain...Select Research Study executes at 8:33 the message is sent to the next process at 8:34, but the response of the MSSQL call doesn't come till 9:31.

1 8
0 320
Question
· May 27, 2021
JDBC counts don't match

I'm using a JDBC driver to connect PGSQL -> Cache. I'm noticing when I run SELECT queries and COUNT(*) command against the same table, I get different result sets. I'm pretty new to Cache in general - so I'm trying to understand why these would be different.

Examples (TransID and InvNum should occur in every "row"):

SELECT COUNT(*) FROM ACCT.Services = 1,090,324 WHERE ACCT.Dept = 483

SELECT TransID FROM ACCT.Services = 1,085,776 WHERE ACCT.Dept = 483

SELECT InvNum FROM ACCT.Services = 586,023 WHERE ACCT.Dept = 483

0 8
0 176

Hi!

I'd like to know if there are any issues if an index is inserted into a table without running the %BuildIndices() method.

It's important to note that data inserted before the index is not important for retrieval, so it's not a problem data inserted before the index don't show up in queries.

The reason why I'm asking this is that I'd like to avoid index reconstruction on big tables which I need to inser such index.

I'm using Cache 2018.1.

Thanks,

José

0 8
0 272

Cache ODBC State S1000 Native Code 400 Illegal Value

This is my query:

select DateTijdSec from
GLPPatTcActie
where pnr = '27085070017' and LTestId->Makey='BLA' and VerzamelDatTijd < '2021-03-04-2021 09:04' and glpactieid->makey in ('TAV','TMA') order by DateTijdSec desc

Most likely there is a wrong date time in the table, how can i get the data?

0 8
0 839

Hello, I am running into a little problem.

I am trying to create a Cache Trigger on a FACS table using the SQL CREATE TRIGGER command but I am getting the message [SQLCODE: <-300>:<DDL not allowed on this table definition>].

I am not creating a persistent class but using the SQL CREATE TRIGGER command.

Please advise.

thanks.

0 8
0 269

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?

1 8
1 3.1K