検索

Artículo
· 8 sep, 2024 Lectura de 1 min

Como ler um arquivo CSV programaticamente linha por linha

Rubrica InterSystems FAQ

Isso pode ser conseguido usando o procedimento CSV() da classe %SQL.Util.Procedures .
Abaixo está o exemplo de uso do código. (Assumindo que o arquivo test.csv está em c:\temp.)

 Set rowtype="Name VARCHAR(50),UID VARCHAR(50), PHONE VARCHAR(50)"
 Set filename="c:\temp\test.csv"
 Set result=##class(%SQL.Statement).%ExecDirect(,"call %SQL_Util.CSV(,?,?)",.rowtype,.filename)
 Set rset =result.%NextResult()
 
 // To display all results, use do rset.%Display()
 While rset.%Next() {
     Write "Name:",rset.%GetData(1)," UID:",rset.%GetData(2)," PHONE:",rset.%GetData(3),!
     }

 Set rset="",result=""
 Quit

Ao executar o código acima, você pode acessar cada linha e campo como um result set. Exemplo de execução:

USER>do ^CSV
Name    UID     PHONE
aaa     0001    080-1111-1111
bbb     0003    090-2222-2222
ccc     0009    050-3333-3333
ddd     0010    0120-17-1972
4 Rows(s) Affected

Por favor, também veja a referência de classe para a classe %SQL.Util.Procedures.
Referência de classe:%SQL.Util.Procedures.CSV()

Comentarios (0)1
Inicie sesión o regístrese para continuar
Anuncio
· 8 sep, 2024

Key Questions of the Month: August 2024

Hey Community,

It's time for the new batch of #KeyQuestions from the previous month.

Key questions your HR system can help you answer - Cezanne HR

Here are the Key Questions of August chosen by InterSystems Experts within all Communities:

📌 PIP install iris to use in python source file by @Ashok Kumar T (EN)

📌 Search in all namespaces by @Mary George (EN)

📌 There's any way to check if some part of the code is an abbreviated command? by @Igor Barboza (EN)

These questions will be highlighted with the #Key Question tag, and their authors will get the Key Question badge on Global Masters (when it's back).

If you find the key question(s) from other communities interesting, just drop us a line in the comments and we will translate the question(s) and the accepted answer(s).

Congrats, and thank you all for your interesting questions. Keep them coming!

See you next month😉

Comentarios (0)2
Inicie sesión o regístrese para continuar
Artículo
· 7 sep, 2024 Lectura de 2 min

第十九章 添加时间戳和用户名令牌 - 时间戳和用户名令牌示例

第十九章 添加时间戳和用户名令牌 - 时间戳和用户名令牌示例

时间戳和用户名令牌示例

此示例显示了一个需要密码验证的 Web 服务,以及一个在其请求消息中发送时间戳和用户名令牌的 Web 客户端。

注意:此示例以明文形式发送用户名和密码。

为了使此示例在自己的环境中运行,请首先执行以下操作:

  • 对于 Web 服务所属的 Web 应用程序,将该应用程序配置为仅支持密码验证:
  1. 从管理门户主页,选择系统管理 > 安全 > 应用程序 > Web 应用程序。
  2. 选择 Web 应用程序。
  3. 仅选择密码选项,然后选择保存。
  • 如果不使用默认设置,请编辑客户端以使用适当的 IRIS 用户名和密码。

Web服务如下:

Comentarios (0)1
Inicie sesión o regístrese para continuar
Artículo
· 7 sep, 2024 Lectura de 1 min

Improve Searching in DC by Tags

You might know that you can search posts in DC by Tags
starting in left upper  corner   and  

that's fine to start. But - based on some local feedback - some improvements
might make is more useful. actual the SELECT works .. IF TAGS CONTAIN %tag 
This spams you with a lot of results but often much more than useful
so the suggestions for extensions:

  • ... IF TAGS CONTAINS ONLY %tag   // for 1 specific Tag
  • ... IF TAGS CONTAIN  (%tag1,%tag2,%tag3,...)    // several specific tags
  • ... IF TAGS NOT CONTAIN   (%tag4,%tag5)         // exclude unwanted content  
  • ... IF TAGS CONTAIN  (%tag1,%tag2,%tag3,...)  AND NOT CONTAIN   (%tag4,%tag5) 

practical case:  ... CONTAIN ("global","python") and NOT CONTAIN ("ObjectScript")

the syntax borrowed from SQL is just to illustrate  the functionality. 
practical implementation nay use a list where you set + -

the​ proposal is also posted in IDEAS  https://ideas.intersystems.com/ideas/DPI-I-630​​​​​
for support and comfort I also suggest to forced tagging of all postings (and replies?)
in IDEAS https://ideas.intersystems.com/ideas/DPI-I-629

If you agree I appreciate your votes

Comentarios (0)1
Inicie sesión o regístrese para continuar
Anuncio
· 7 sep, 2024

Top Videos for InterSystems Developers in August 2024

Hey Community,

Here is a digest of the Developer Community videos on InterSystems Developers YouTube Channel in August 2024:

 

Stay tuned with InterSystems Developers YouTube!

Comentarios (0)1
Inicie sesión o regístrese para continuar