Andreas Schneider 路 Jan 6, 2025 go to post

Hey Steve, you said 'no subqueries,' but I figured Common Table Expressions with window functions were fair game, right? 馃槈
This is just a shot based on your example data. Not entirely sure I nailed your explanation about 'previous' and 'next'? 馃

Maybe this will help:

WITH RankedEntries AS 
(
    SELECT 
        TheNO,
        TheID,
        TheDate,
        Item,
        ROW_NUMBER() OVER (PARTITION BY TheID, Item ORDER BY TheDate ASC) AS ItemRank
    FROM MultipleEntries
)
SELECT 
    TheNO,
    TheID,
    TheDate,
    Item,
    CASE 
        WHEN ItemRank = 1 THEN 'new'
        ELSE 'old'
    END AS Status
FROM RankedEntries
ORDER BY TheNO;


Andreas

Andreas Schneider 路 Dec 26, 2022 go to post

That looks strange. If you execute the query via JDBC the error ist the same. A CAST to the same datatype as provided from Config.ConfigFile works:

SELECT
       CAST(ID AS VARCHAR(512)),
       CAST(CPFName AS VARCHAR(255)),
       CAST(Comments AS VARCHAR(4096)),
       CAST(Name AS VARCHAR(64)),
       CAST(Product AS VARCHAR(64)),
       CAST(SectionHeader AS VARCHAR(255)),
       CAST(Version AS VARCHAR(7))
FROM Config.ConfigFile
Andreas Schneider 路 Aug 14, 2022 go to post

Hi! Unfortunately there is no way to UPDATE the %DESCRIPTION information on a table or column with SQL.
But you can add these information while CREATEing a table like this:

or this way for a column:

Please see CREATE TABLE | InterSystems SQL Reference | InterSystems IRIS Data Platform 2022.1 for more details.

By default the %DESCRIPTION information is projected to the Remarks column via JDBC:

As you can see the text comes from the %DESCRIPTION property:

This works also for the columns.
This is from JDBC:

This is from INFORMATION_SCHEMA.COLUMNS:

Andreas

Andreas Schneider 路 Feb 9, 2022 go to post

The column parameter has MAXLEN 229:

parameter As %Library.String(MAXLEN = 229) [ SqlColumnNumber = 6 ];

that is why the insert fails

Andreas Schneider 路 Jan 3, 2022 go to post

Maybe you haven't send the complete statement?
This works for me via JDBC, tested with Cach茅2018.1.0.184  and IRIS 2021.2.0.617

LOCK TABLE dc_data_flights.airports IN EXCLUSIVE MODE

-- OR
LOCK dc_data_flights.airports IN EXCLUSIVE MODE

-- OR
LOCK TABLE dc_data_flights.airports IN SHARE MODE

-- OR
LOCK dc_data_flights.airports IN SHARE MODE

If try this I get the same error like you:

-- this create an error, the "IN EXCLUSIVE MODE" or "IN SHARE MODE" is missing
LOCK TABLE dc_data_flights.airports

Andreas