Are All Your Tables Getting Logged?

classic Classic list List threaded Threaded
1 message Options
Reply | Threaded
Open this post in threaded view

Are All Your Tables Getting Logged?

4D Tech mailing list
Hey All,

I ran into an issue today where I was surprised (understatement) to
see some tables did not show up in my log file. It turns out the
little check box "Include in Log File" on the table definitions was
unchecked. (24 tables out of 229)

For those of you who use custom primary keys, it's an easy mistake to
make. Now-a-days when you create a new table in 4D, 4D automatically
assigns a primary key and turns on logging. The problem is, to change
the primary key format, you need to first drop the existing key which
turns the logging off. Just because you re-add your custom primary
key, the logging is not automatically turned back on - you have to
manually check the box - easy to forget.

When you have 200+ tables in your structure, clicking on each table to
find out where you forgot to turn logging back on is not practical.
Below is code based on an earlier post on the NUG from a thread
between Cannon and Arnaud (thanks to both of you for that). Running it
simply gives you an alert with all the tables that have Journaling
(logging) turned off.

ARRAY BOOLEAN($logged_ab;0)  //>>>this one
ARRAY LONGINT($table_al;0)
ARRAY TEXT($name_at;0)
Begin SQL
INTO :$logged_ab, :$name_at, :$table_al;

$Size_vl:=Size of array($name_at)
For ($x;1;$Size_vl)
If (Not($logged_ab{$x}))
End if

End for


David Nasralla
Clean Air Engineering
4D Internet Users Group (4D iNUG)
Unsub:  mailto:[hidden email]