User bio
18+ experience with InterSystems products, in different sizes of projects, different countries, and different fields except for healthcare.
Melbourne, VIC, Australia
Member since Dec 4, 2015
Posts:
Replies:
Did you try using more appropriate package %Stream for it?
In your case, you would need to use %Stream.FileCharacter
Set stream=##class(%Stream.FileCharacter).%New()
$$$ThrowOnError(stream.LinkToFile("c:\export.csv"))
set rs = ##class(%SQL.Statement).%ExecDirect(, "SELECT a, b FROM table")
if rs.%SQLCODE'=0 {
throw ##class(%Exception.SQL).CreateFromSQLCODE(rs.%SQLCODE, rs.%Message)
}
while rs.%Next() {
set line = $listbuild(rs.a, rs.b)
do f.WriteLine($listtostring(line, ","))
}
$$$ThrowOnError(stream.%Save())
Additionally, nowadays using embedded classes does not give much advantage, if it's not for one row result, only makes the code a bit harder to read
And what was the reason for it?
Routnes now deprecated in IRIS?
Open Exchange applications:
Certifications & Credly badges:



Global Masters badges:







Followers:
Following:
Dmitry has not followed anybody yet.
did you try /usr/irissys/mgr/python, that's the path expected to be used by IRIS packages
and another place is /usr/irissys/lib/python, it's a place where InterSystems places Python Embedded support
sys.path, is a list of folders where python will look for the installed modules