How to find out if a database is connected -RO

Posted by martinz on 04-Oct-2016 03:21

Hi,

We have an environment where we connect some databases, but not all, read-only. These databases are replication targets, so read-only is the only option for these databases.

Now we want to determine in ABL whether a database is connected read-only or not. Is that possible and how?

We're on OE 11.5.1.

Thanks,

- Martin

Posted by Ken McIntosh on 04-Oct-2016 07:30

If you want to specifically know what parameters were used to connect to a database, use the DBPARAM function.

e.g.

MESSAGE DBPARAM("<dbname>") VIEW-AS ALERT-BOX.

All Replies

Posted by Peter Judge on 04-Oct-2016 03:30
If you connect from the command line, then look at SESSION:STARTUP-PARAMETERS . Otherwise I’m not sure.
Posted by martinz on 04-Oct-2016 06:42

Found it: it's in the _DbParams VST. Look for _DbParams-Name = "-ERO", _DbParams-Value = "1" when read-only, "0" when not. I just searched for -RO, not -ERO.

Also, its one of the entries reported by the DBRESTRICTIONS()-function.

Problem solved!

Posted by Ken McIntosh on 04-Oct-2016 07:30

If you want to specifically know what parameters were used to connect to a database, use the DBPARAM function.

e.g.

MESSAGE DBPARAM("<dbname>") VIEW-AS ALERT-BOX.

This thread is closed