Find

Question
· Jun 25, 2024

SQL DatePart Not Working With ISO 8601 Formatted Date & Time

Given a properly formatted ISO 8601 date time of 2024-06-23T06:03:00Z using SQL DatePart results in an error:

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

  [%msg: <Invalid input to DATEPART() function: datepart='ss', datetime value='2024-06-23T06:03:00Z')>]

If I remove the trailing Z (for Zulu / UTC time) and leave the T, DatePart works fine.

I have also tried various ± offsets from UTC e.g. +0400 and that also results in the same SQL error

I can Trim the trailing "Z", but I would hope that DatePart would work with an acceptably formatted ISO 8601 date time string without having to go through the machinations of trimming the data.

Any help or suggestions on how to use SQL DatePart with ISO 8601 formatted Date Time strings would be appreciated.

This is the query I was experimenting with:

select 'YEAR: '||DATEPART(YEAR,'2024-06-23T06:03:00Z') 
UNION
select 'MONTH: '||DATEPART(MONTH,'2024-06-23T06:03:00Z') 
UNION
select 'DAY: '||DATEPART(DAY,'2024-06-23T06:03:00Z')
UNION
select 'HOUR: '||DATEPART(HOUR,'2024-06-23T06:03:00Z')
UNION 
select 'MINUTE: '||DATEPART(MINUTE,'2024-06-23T06:03:00Z')
UNION
select 'SECOND: '||DATEPART(SECOND,'2024-06-23T06:03:00Z')

2 Comments
Discussion (2)2
Log in or sign up to continue
Question
· Jun 25, 2024

How can i see the request size in kilobytes/megabytes?

I need to be able to take the size of the request from a given %CSP.request

however it seems the best the docs suggest is to get the length of characters in  the request (using $order and Get, Count)...
this is not good enough for what I need to do, Any suggestions?
I scanned the docs and couldn't find anything.

5 Comments
Discussion (5)1
Log in or sign up to continue
Question
· Jun 25, 2024

How to remove line feed and carriage return from start and end, but not from the middle of a string

Hello,

Thanks for reading this question.

We need to remove the line feeds and carriage returns from start and end, but not from the middle of a string

We have tested the following ways:

set output = $ZStrip("[line feed](carriage return) str [line feed](carriage return) ing [line feed](carriage return)","<>C")

But it removes also control characters which we need to preserve...

Also we have tested:

set output = $REPLACE("[line feed](carriage return) str [line feed](carriage return) ing [line feed](carriage return)",$C(13,10),"")

But it deletes line feed and carriage return at the middle of the string, so it is not what we need...

How would you recommend us to implement it.

We have read:

https://community.intersystems.com/post/trimming

https://docs.intersystems.com/irislatest/csp/docbook/DocBook.UI.Page.cls...

https://docs.intersystems.com/irislatest/csp/docbook/DocBook.UI.Page.cls...

https://community.intersystems.com/post/zstrip-clean-string

https://docs.intersystems.com/irislatest/csp/docbook/DocBook.UI.Page.cls...

 

Could you help us please?

Thanks.

7 Comments
Discussion (7)3
Log in or sign up to continue
Announcement
· Jun 25, 2024

InterSystems Developer Ecosystem Spring News 2024

Hello and welcome to the Developer Ecosystem Spring News!

This spring was full of online and offline activities in the InterSystems Developer Ecosystem. In case you missed something, we've prepared for you a selection of the hottest news and topics to catch up on!

News

💡 InterSystems Ideas News #12 and #13

📝 Deprecation: InterSystems Public Key Infrastructure (PKI)

🛑 Alert: SQL Query using “NOT %INLIST” fails to return results

🛑 Apr. 8, 2024 – Alert: Upgrades fail for HealthShare® Health Connect instances not licensed for HL7® FHIR®

 Mar.19, 2024 - Advisory: AIX Memory Leak

 May 30, 2024 – Advisory: License Enforcement Changes – REST and SOAP

📝 InterSystems IRIS & IRIS for Health 2024.2 Developer preview update

📝 Windows upgrade removes Studio in 2024.2

📝 InterSystems Platforms Update Q2-2024

😭 The Global Masters Program will be temporarily PAUSED from April 26th

Contests & Events

 
Code Golf

⏯️ [Webinar in Hebrew] Maximize Your Success with InterSystems Support

⏯️ [Webinar in Hebrew] Introducing InterSystems Cloud Services

⏯️ [Webinar in Spanish] SMART on FHIR, extending the capabilities of HealthShare

🧑‍🤝‍🧑 InterSystems Developer Community Roundtable - March 5, 2024

🧑‍🤝‍🧑 InterSystems Developer Community Roundtable - March 26, 2024

🧑‍🤝‍🧑 InterSystems Online Developer Roundtable - April 25, 2024

🤝 Developer Meetup in Boston, March 27

🤝 Developer Meetup in Boston, April 24

👨‍💻 [Hackathon] InterSystems at MIT GrandHack 2024

👥 [Conference] J On The Beach

🚰 [Water Cooler Talk] Is ChatGPT effective in providing ObjectScript guide?

✍ The 3rd edition of the InterSystems Technical Article Contest in Spanish

Latest Releases

⬇️ InterSystems announces General Availability of InterSystems IRIS 2024.1

⬇️ InterSystems announces InterSystems IRIS 2024.1.0.267.2, includes support for Ubuntu 24.04

⬇️ InterSystems announces General Availability of InterSystems IRIS for Health, and HealthShare Health Connect 2024.1

 
⬇️ InterSystems IRIS, IRIS for Health, & HealthShare Health Connect 2024.1 developer previews
 
⬇️ InterSystems IRIS, IRIS for Health, & HealthShare Health Connect 2024.2 developer previews

Best Practices & Key Questions

❓ Key Questions of Winter 2023/2024: March, April, May

People and Companies to Know About 

🌟 Global Masters of Winter 2023/2024: March, April

👨‍💻 Celebrating a True Pillar of the Developer Community: A Journey of Dedication and Expertise

Job Opportunities

💼 HealthShare & IRIS Expertise wanted - Swiss based job opportunity

💼 Contract Job Opportunities?

💼 IRIS Engineer

💼 InterSystems Developer Job opportunity at Virtusa

💼 Software Engineer- IRIS

💼 Intersystems - Cache Objects Health Share Application Developer

💼 IRIS Developer/Support engineer opportunity

💼 InterSystems HealthShare Developer

And more

❗ How to showcase your Credly Badges

❗ How to manage subscriptions on InterSystems Ideas

So...

Here is our take on the most interesting and important things! 

What were your highlights from this past season? Share them in the comments section and let's remember the fun we've had!

Discussion (0)2
Log in or sign up to continue
Question
· Jun 25, 2024

Erreur de compilation sur IRIS 2024.01 sans changement de code

Bonjour,

Suite à la mise à jour d'IRIS de la version 2022.3 à 2024.01, une erreur de compilation apparaît lors de la compilation de la requête `qryGetAllLinkedActByAct` dans la classe `Di.Act`, bien que le code n'ait pas été modifié.

Voici la requête concernée :

Query qryGetAllLinkedActByAct(actId As %String) As %SQLQuery(CONTAINID = 1) {
    SELECT %ID, count(*) as maxRow FROM Di.Act WHERE (linkedAct = :actId) and status <> 'C'
}

Avant la mise à jour, tout fonctionnait correctement. L'erreur indique que le stockage de colonne n'est pas autorisé avec la licence actuelle. Des idées pour résoudre ce problème sans modifier la licence ?

Voici l'erreur complète

 ERREUR #5521: SQLError: SQLCODE=-157 %msg=Error compiling query qryGetAllLinkedActByAct in class "Di.Act": Le stockage de colonne est utilisé dans le tableau 'DI.ACT', mais il n'est pas autorisé avec la licence actuelle
  > ERREUR #5030: Une erreur s'est produite lors de la compilation de la classe Di.Act

Le soucis ne se produit pas lorsque je retire l'index suivant de la classe ( l'index est de type %Library.FunctionalIndex)

 Index wbI On (wbActDStart, wbActDEnd, stay) As Care.fidx.wb.WBIndex(ISACTPID = 1);

Comment faire fonctionner la compilation sans retirer cet index ?

Merci pour votre aide.

2 Comments
Discussion (2)2
Log in or sign up to continue