Hi,
I just tried putting a database as read-only and then executing a dynamic SQL query which worked for me.
Are you able to provide some more information? For example, the SQL query, any <PROTECT> in the audit log? etc
Thank you
Hi Dmitrii,
The issue stems from the fact that 'su' is designed to run interactively, so it expects a tty to read the password securely. You have to find a way to run a command as another user non-interactively.
If you have the option, you can use 'sudo' with the -S flag instead.
-S, --stdin read password from standard input
Example:
#dim cmd As %String = "echo "_password_" | sudo -S ls"
set status = Session.Execute(cmd, .device)
$$$ThrowOnError(status)
use device
read response:2
use 0
zwrite response
Otherwise 'expect' might work,
expect -c 'spawn su - root -c "ls"; expect "Password :"; send "password\n"; interact

Hi Fahima,
Perhaps something along these lines will be useful to you (Note: You need to add some more checks, but you get the gist)
set status=##class(%XML.TextReader).ParseFile(<filepath>,.textreader) do textreader.ReadStartElement("content") while textreader.Read() { if (textreader.NodeType="endelement")&&(textreader.Name="content") { quit } // Handle values of content element here }