That's a very good point, thank you for this suggestion.
At the moment the Trigger is already finished and linked to the file, so i will wait until I have the first change to make and change it the way you described.
Original Message:
Sent: 09-19-2023 17:53
From: Mark Baldridge
Subject: Database Triggers on UV-Data Files - GRANT SQL Acces for first user...
While injecting a little overhead, make the trigger program something small that calls the routine that does the actual work. Then, you can simply recompile and recatalog the work program to change the trigger behavior. Otherwise, you need to DROP TRIGGER, make changes and CATALOG, and CREATE TRIGGER.
------------------------------
Mark A Baldridge
Principal Consultant
Thought Mirror
Nacogdoches, Texas United States
Original Message:
Sent: 09-18-2023 11:13
From: Thomas Ludwig
Subject: Database Triggers on UV-Data Files - GRANT SQL Acces for first user...
exactly this was happening :-)
I thought im my small Test-Basic subroutine I do a write to some log-file in the Account without caring for readu and so on.
After reading the log-record with readu before writing it works now. And I can continue.
Thanks a lot Neil - You helped a lot!
Lüdi
------------------------------
Thomas Ludwig
System Builder Developer
Rocket Forum Shared Account
Original Message:
Sent: 09-18-2023 10:48
From: Neil Morris
Subject: Database Triggers on UV-Data Files - GRANT SQL Acces for first user...
One thing to note is that the Trigger will execute as a "transaction". The error noted in your screen shot may be an indication that a WRITE operation is happening in the Trigger program without a READU lock for the record being active.
------------------------------
Neil Morris
Universe Advanced Technical Support
Rocket Software
Original Message:
Sent: 09-18-2023 10:38
From: Thomas Ludwig
Subject: Database Triggers on UV-Data Files - GRANT SQL Acces for first user...
Thanks a lot, for the help.
-> Had to find out how to catalog globally but finaliy got the trigger to work.
Now I guess I have to learn a bit more about Triggers because I get the next error message after saving an entry in the triggered File in the SB+ Screen-Editor

I Will go through the Docs and try to find how the Subroutine should look like...
best Regards
Thomas
------------------------------
Thomas Ludwig
System Builder Developer
Rocket Forum Shared Account
Original Message:
Sent: 09-18-2023 09:22
From: Neil Morris
Subject: Database Triggers on UV-Data Files - GRANT SQL Acces for first user...
Also, the file need not be a SQL Table to be able to add the trigger. Triggers can be added to regular UV files.
------------------------------
Neil Morris
Universe Advanced Technical Support
Rocket Software
Original Message:
Sent: 09-18-2023 09:04
From: Thomas Ludwig
Subject: Database Triggers on UV-Data Files - GRANT SQL Acces for first user...
Hi All,
Im back to MV-World after a 20-year break. Formerly i was developing an application with advanced Pick / SB+.
I want to activate Database triggers on a UV Database for some UV Datafiles to get dependent tables updated.
But im struggling right at the beginning.
I created the following:
FILE TEST.TRIGGER FILE TYPE 18
BAISC SUBROUTINE B.TESTTRIGGER with the needed parameters.
After that I try to activate the Trigger with
CREATE TRIGGER TESTTRIGGER BEFORE INSERT OR UPDATE TEST.TRIGGER B.TESTTRIGGER
-> I Get the message TEST.TRIGGER unexpected.
I thought that I have to convert the file to SQL Table befor so i tried the following command:
CONVERT.SQL TEST.TRIGGER
-> I Get the Message: Can't run CONVERT.SQL: 'UV11TEST-TL\Administrator' is not an SQL User
So i logged in as Administrator User and tried:
GRANT DBA TO t.ludwig or GRANT DBA TO Administrator
-> I Get the message: UniVerse/SQL: "UV11TEST-TL\Administrator" is not an SQL user.
I think the problem is to get the first user as an SQL User.
In the Help-File i found that NT AUTHORITY\system gets registered as SQL user during install, but how do I use this user to Grant Access to other users?
Everey Idea is welcome...
------------------------------
Thomas Ludwig
System Builder Developer
Rocket Forum Shared Account
------------------------------