You can use 'client->name as clientname' and .%Get("clientname") or use .%GetData(columnnumber)

To check if a database is corrupt : Do ^INTEGRIT

To repair a database : Do ^REPAIR (But if you don't know this utility or the internals of database blocks and pointers : don't use it !!!)

Hi Tiago,

There is always a risk of getting errors after an upgrade, depending how your application uses Caché.
For example : your application could use custom data/code that is stored in the manager's database, and that database will be overwritten in the upgrade, so you will risk loosing data/code. (It is bad practice to store info there, but it is possible) 

Best is to contact the vendor/developers, and test the upgrade by copying the server to a test server and do the upgrade there.
 

I added the way to find out which global name is used in my first reply  : try
 

write ##class(%Dictionary.CompiledStorage).%OpenId("MyPackage.MyClass||Default").DataLocation

You can use indirection :

USER>set field="name"
 
USER>set @field="Henry"
 
USER>write @field
Henry
USER>write name
Henry

Be carefull : the second parameter of $zdateh is =1 for US format (mm/dd/yyyy), =4 for European format (dd/mm/yyyy) and =8 for yyyymmdd format.
Luckily, $zdateh is smart enough to know your date is really US and not yyymmdd, but the correct answer is to use $zdateh(x,1) > $zdateh(y,1), and not 8 as second parameter :

write $zdateh("05/01/2022",1)
66230  -> the internal date for may 1st 2022
write $zdateh("05/01/2022",4)
66114  -> the internal date for 5 january 2022
write $zdateh("05/01/2022",8)
66230  -> $zdateh expects yyyymmdd, assumes this is US format (but this is wrong if European format was intended)
Set Attribute Mode	<ESC>[{attr1};...;{attrn}m
  • Sets multiple display attribute settings. The following lists standard attributes:
    0	Reset all attributes
    1	Bright
    2	Dim
    4	Underscore	
    5	Blink
    7	Reverse
    8	Hidden
    
    	Foreground Colours
    30	Black
    31	Red
    32	Green
    33	Yellow
    34	Blue
    35	Magenta
    36	Cyan
    37	White
    
    	Background Colours
    40	Black
    41	Red
    42	Green
    43	Yellow
    44	Blue
    45	Magenta
    46	Cyan
    47	White

Hi Eduard,

This works in Caché, i guess it should also work on Iris (vt100 escape codes) :

Can you try this :

...
set mysqlstat="select * from file.Log where ConfigName='hhhhhhhhhhh"
set sr=##class(%SQL.Statement).%ExecDirect(,mysqlstat)
if sr.%SQLCODE=0 {
  set file="/tmp/temp.txt"  ;or any existing directory path + file name
  open file:"wns":1 Else  Write "could not open file",!
  If $Test {
    use file
    do sr.%Display()
    close file
  }
}
halt
EOM

You should preferably put all the code between znspace... and halt in a routine or class method, and just call it from the script.