<html>
<head>
<base href="https://bugs.documentfoundation.org/">
</head>
<body><table border="1" cellspacing="0" cellpadding="8">
<tr>
<th>Bug ID</th>
<td><a class="bz_bug_link
bz_status_UNCONFIRMED "
title="UNCONFIRMED - SQL TRIGGER does not properly display SQLSTATE message text in a Base form"
href="https://bugs.documentfoundation.org/show_bug.cgi?id=122048">122048</a>
</td>
</tr>
<tr>
<th>Summary</th>
<td>SQL TRIGGER does not properly display SQLSTATE message text in a Base form
</td>
</tr>
<tr>
<th>Product</th>
<td>LibreOffice
</td>
</tr>
<tr>
<th>Version</th>
<td>4.3.5.2 release
</td>
</tr>
<tr>
<th>Hardware</th>
<td>All
</td>
</tr>
<tr>
<th>OS</th>
<td>All
</td>
</tr>
<tr>
<th>Status</th>
<td>UNCONFIRMED
</td>
</tr>
<tr>
<th>Severity</th>
<td>normal
</td>
</tr>
<tr>
<th>Priority</th>
<td>medium
</td>
</tr>
<tr>
<th>Component</th>
<td>Base
</td>
</tr>
<tr>
<th>Assignee</th>
<td>libreoffice-bugs@lists.freedesktop.org
</td>
</tr>
<tr>
<th>Reporter</th>
<td>rssalerno@gmail.com
</td>
</tr></table>
<p>
<div>
<pre>Description:
I have a LO Base app using a split HSQLDB 2.3.2. It includes a table "checks"
that has a boolean column "issued". When issued is "true" I want to prevent
deletion of that row. So I created the following trigger to detect this
condition and prevent deletion:
CREATE TRIGGER "delete_check" BEFORE DELETE ON "checks"
REFERENCING OLD AS oldrow
FOR EACH ROW WHEN (oldrow."issued" = true)
BEGIN ATOMIC
SIGNAL SQLSTATE '45000' SET MESSAGE_TEXT = 'Issued check cannot be deleted';
END;
When I use the built-in grid view and try to delete a row with the issued flag
set, the message box DOES pop up as expected.
But running in a Base form and trying to delete the row using the form
navigation control, the message box does not pop up. (In either case the row is
not deleted, which is good because it means the trigger is working.)
Deleting from the 'Toolbar' navigation bar does not generate the message and
once tried it also negates the display of the message from the form navigation
control.
This does start working once the form is closed & opened again.
Steps to Reproduce:
1.create HSQLDB before delete trigger as shown above
2.attempt to delete record that matches the trigger condition using form
navigation control
3.expected message box does not appear
Actual Results:
no message box is displayed
Expected Results:
message box with error message should be displayed
Reproducible: Always
User Profile Reset: No
Additional Info:
See
<a href="https://ask.libreoffice.org/en/question/175909/how-to-get-sql-trigger-to-display-sqlstate-message-text-in-a-base-form/">https://ask.libreoffice.org/en/question/175909/how-to-get-sql-trigger-to-display-sqlstate-message-text-in-a-base-form/</a></pre>
</div>
</p>
<hr>
<span>You are receiving this mail because:</span>
<ul>
<li>You are the assignee for the bug.</li>
</ul>
</body>
</html>